Skip to content

Commit

Permalink
Use on-system color-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jun 18, 2018
1 parent 3ca351c commit 76c29f3
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 60 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ before_install:
- '[[ "$TRAVIS_EVENT_TYPE" = cron ]] && export YARP_CHECKOUT=devel || export YARP_CHECKOUT=master'

install:
# Install color-debug
- git clone https://github.com/roboticslab-uc3m/color-debug
- cd color-debug && mkdir build && cd build
- cmake ..
- sudo make install
- cd ../..
#-- Install googletest
- sudo apt-get install libgtest-dev
#-- Install yarp
Expand Down
16 changes: 3 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ list(APPEND CMAKE_MODULE_PATH ${ROBOTICSLAB_TOOLS_MODULE_PATH}
set(YCM_TAG v0.6.0)
include(YCMBootstrap)

# Find project's hard dependencies
find_package(COLOR_DEBUG REQUIRED)

# Retrieve current ROBOTICSLAB_TOOLS version.
include(ROBOTICSLAB_TOOLSVersion)

Expand All @@ -32,19 +35,6 @@ include(ROBOTICSLAB_TOOLSOptions)
# Define global properties to store relevant configuration.
set_property(GLOBAL PROPERTY ROBOTICSLAB_TOOLS_TARGETS)

# Superbuild phase - include color-debug
include(FindOrBuildPackage)
find_or_build_package(COLOR_DEBUG)

# find_or_build_package() doesn't bring into scope COLOR_DEBUG_INCLUDE_DIRS
# nor other config variables. If a system copy is found, we have to call the
# find_package() command and proceed as usual.
if(USE_SYSTEM_COLOR_DEBUG)
find_package(COLOR_DEBUG REQUIRED)
include_directories(${COLOR_DEBUG_INCLUDE_DIRS})
add_library(COLOR_DEBUG UNKNOWN IMPORTED)
endif()

# Define and enter subdirectories.
add_subdirectory(share)
add_subdirectory(libraries)
Expand Down
20 changes: 0 additions & 20 deletions cmake/ycm-modules/BuildCOLOR_DEBUG.cmake

This file was deleted.

5 changes: 2 additions & 3 deletions doc/tools-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
First install the dependencies:
- [Install CMake](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-cmake.md)
- [Install YARP](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-yarp.md)
- [Install color-debug](https://github.com/roboticslab-uc3m/color-debug)

Additionally, this project depends on YCM to download and build external packages. Although this process is intended to run automatically during the CMake configuration phase, you may still want to install YCM and said packages by yourself. In that respect, refer to [Install YCM](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-ycm.md) and to the installation guides of any package listed below:

- [color-debug](https://github.com/roboticslab-uc3m/color-debug)
Additionally, this project depends on YCM to download and use additional CMake modules. Although this process is intended to run automatically during the CMake configuration phase, you may still want to install YCM by yourself. In that respect, refer to [Install YCM](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-ycm.md).

For unit testing, you'll need the googletest source package. Refer to [Install googletest](https://github.com/roboticslab-uc3m/installation-guides/blob/master/install-googletest.md).

Expand Down
6 changes: 3 additions & 3 deletions libraries/Playback/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
add_library(Playback Playback.cpp
Playback.hpp)

# Set dependencies.
add_dependencies(Playback COLOR_DEBUG)

# Set target properties.
set_target_properties(Playback PROPERTIES PUBLIC_HEADER Playback.hpp)

# Specify include directories.
target_include_directories(Playback PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

# Specify usage requirements.
target_link_libraries(Playback PRIVATE ROBOTICSLAB::ColorDebug)

# Create installation rule.
install(TARGETS Playback
EXPORT ROBOTICSLAB_TOOLS
Expand Down
2 changes: 2 additions & 0 deletions libraries/Playback/Playback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "Playback.hpp"

#include <ColorDebug.h>

namespace roboticslab
{

Expand Down
2 changes: 0 additions & 2 deletions libraries/Playback/Playback.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#include <fstream>
#include <vector>

#include "ColorDebug.hpp"

namespace roboticslab
{

Expand Down
3 changes: 1 addition & 2 deletions libraries/YarpPlugins/PlaybackThread/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ if(NOT SKIP_PlaybackThread)
IPlaybackThreadImpl.cpp
ThreadImpl.cpp)

add_dependencies(PlaybackThread COLOR_DEBUG)

target_link_libraries(PlaybackThread YARP::YARP_OS
YARP::YARP_dev
ROBOTICSLAB::ColorDebug
Playback
ToolsInterfaces)

Expand Down
8 changes: 1 addition & 7 deletions libraries/YarpPlugins/PlaybackThread/PlaybackThread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@

#include <limits> // NAN

//#define CD_FULL_FILE //-- Can be globally managed from father CMake. Good for debugging with polymorphism.
//#define CD_HIDE_DEBUG //-- Can be globally managed from father CMake.
//#define CD_HIDE_SUCCESS //-- Can be globally managed from father CMake.
//#define CD_HIDE_INFO //-- Can be globally managed from father CMake.
//#define CD_HIDE_WARNING //-- Can be globally managed from father CMake.
//#define CD_HIDE_ERROR //-- Can be globally managed from father CMake.
#include "ColorDebug.hpp"
#include <ColorDebug.h>

#include "Playback.hpp"

Expand Down
3 changes: 2 additions & 1 deletion programs/controlboardStateToIPosition/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ add_executable(controlboardStateToIPosition main.cpp
# Link external libraries.
target_link_libraries(controlboardStateToIPosition YARP::YARP_OS
YARP::YARP_init
YARP::YARP_dev)
YARP::YARP_dev
ROBOTICSLAB::ColorDebug)

# Create installation rule.
install(TARGETS controlboardStateToIPosition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <yarp/os/Value.h>
#include <yarp/dev/IControlMode.h> // Defines VOCAB_CM_POSITION_DIRECT.

#include <ColorDebug.hpp>
#include <ColorDebug.h>

namespace roboticslab
{
Expand Down
2 changes: 1 addition & 1 deletion programs/controlboardStateToIPosition/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <yarp/os/Network.h>
#include <yarp/os/ResourceFinder.h>

#include <ColorDebug.hpp>
#include <ColorDebug.h>

#include "ControlboardStateToIPosition.hpp"

Expand Down
5 changes: 2 additions & 3 deletions tests/testPlayback/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
add_executable(testPlayback testPlayback.cpp)

add_dependencies(testPlayback COLOR_DEBUG)

target_link_libraries(testPlayback Playback
target_link_libraries(testPlayback ROBOTICSLAB::ColorDebug
Playback
gtest_main)
2 changes: 1 addition & 1 deletion tests/testPlayback/testPlayback.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "gtest/gtest.h"

#include "ColorDebug.hpp"
#include <ColorDebug.h>

#include "Playback.hpp"

Expand Down
3 changes: 1 addition & 2 deletions tests/testPlaybackThread/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ include_directories(${YARP_INCLUDE_DIRS}) # remove if YARP > v2.3.70

add_executable(testPlaybackThread testPlaybackThread.cpp)

add_dependencies(testPlaybackThread COLOR_DEBUG)

target_link_libraries(testPlaybackThread YARP::YARP_OS
YARP::YARP_dev
ROBOTICSLAB::ColorDebug
ToolsInterfaces
gtest_main)
2 changes: 1 addition & 1 deletion tests/testPlaybackThread/testPlaybackThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <yarp/os/all.h>
#include <yarp/dev/all.h>

#include "ColorDebug.hpp"
#include <ColorDebug.h>

#include "IPlaybackThread.h"

Expand Down

0 comments on commit 76c29f3

Please sign in to comment.