File: CMakeLists.txt

package info (click to toggle)
ros-diagnostics 1.12.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,264 kB
  • sloc: cpp: 3,034; python: 2,623; xml: 234; sh: 21; makefile: 5
file content (53 lines) | stat: -rw-r--r-- 1,930 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
cmake_minimum_required(VERSION 3.0.2)
cmake_policy(SET CMP0054 NEW)
project(self_test)

# Load catkin and all dependencies required for this package
find_package(catkin REQUIRED diagnostic_msgs diagnostic_updater roscpp rostest)

catkin_package(DEPENDS diagnostic_msgs diagnostic_updater roscpp
               INCLUDE_DIRS include
)

include_directories(include /usr/src/googletest/googletest/include /usr/src/googletest/googletest ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

find_package(Boost REQUIRED COMPONENTS thread)
include_directories(${Boost_INCLUDE_DIRS})

add_executable(run_selftest src/run_selftest.cpp)
find_package(Boost REQUIRED COMPONENTS thread)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(run_selftest ${Boost_LIBRARIES}
                                   ${catkin_LIBRARIES}
)

add_executable(selftest_example src/selftest_example.cpp)
find_package(Boost REQUIRED COMPONENTS thread)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(selftest_example ${Boost_LIBRARIES}
                                       ${catkin_LIBRARIES}
)

add_executable(selftest_rostest src/selftest_rostest.cpp
                                /usr/src/googletest/googletest/src/gtest-all.cc)
target_link_libraries(selftest_rostest ${Boost_LIBRARIES}
                                       ${catkin_LIBRARIES}
)

if(CATKIN_ENABLE_TESTING)
  add_subdirectory(test)

  add_rostest(test/launch/nominal_test.launch)
  add_rostest(test/launch/no_id_test.launch)
  add_rostest(test/launch/error_test.launch)
  add_rostest(test/launch/exception_test.launch)
endif()

install(DIRECTORY include/${PROJECT_NAME}/
        DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)

install(TARGETS run_selftest selftest_example selftest_rostest
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})