File: CMakeLists.txt

package info (click to toggle)
ros-roscpp-core 0.6.13-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 400 kB
  • sloc: cpp: 2,797; ansic: 348; xml: 91; makefile: 2
file content (45 lines) | stat: -rw-r--r-- 1,472 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
cmake_minimum_required(VERSION 2.8.3)
project(rostime)

find_package(catkin REQUIRED COMPONENTS cpp_common)
find_package(Boost REQUIRED COMPONENTS date_time system thread)
catkin_package(
  INCLUDE_DIRS include
  LIBRARIES ${PROJECT_NAME}
  CATKIN_DEPENDS cpp_common
  DEPENDS Boost
)

include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})

add_library(rostime 
  src/duration.cpp
  src/rate.cpp
  src/time.cpp)
set_target_properties(rostime PROPERTIES VERSION ${rostime_VERSION} SOVERSION "0d")

target_link_libraries(rostime ${Boost_LIBRARIES})
if(NOT APPLE)
  target_link_libraries(rostime ${RT_LIBRARY})
endif()

install(TARGETS rostime
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})

install(DIRECTORY include/
  DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}
  FILES_MATCHING PATTERN "*.h")

if(CATKIN_ENABLE_TESTING)
  catkin_add_gtest(${PROJECT_NAME}-test_duration test/duration.cpp)
  if(TARGET ${PROJECT_NAME}-test_duration)
    target_link_libraries(${PROJECT_NAME}-test_duration ${catkin_LIBRARIES} rostime)
  endif()
  catkin_add_gtest(${PROJECT_NAME}-test_time test/time.cpp)
  if(TARGET ${PROJECT_NAME}-test_time)
    set_property(TARGET ${PROJECT_NAME}-test_time APPEND_STRING PROPERTY COMPILE_FLAGS "-std=c++11")
    target_link_libraries(${PROJECT_NAME}-test_time ${catkin_LIBRARIES} rostime)
  endif()
endif()