forked from apl-ocean-engineering/liboculus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·108 lines (79 loc) · 2.77 KB
/
CMakeLists.txt
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
cmake_minimum_required(VERSION 3.5)
project(liboculus)
if( FIPS_CONFIG AND NOT FIPS_IMPORT )
get_filename_component(FIPS_ROOT_DIR "../fips" ABSOLUTE)
include("${FIPS_ROOT_DIR}/cmake/fips.cmake")
fips_setup()
else()
find_package(catkin QUIET)
endif()
# == Code common to all builds =======================================
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package( Boost REQUIRED COMPONENTS system )
# Actually not using full SDK, just the header files
# in thirdparty/Oculus
#find_package( OculusSDK REQUIRED )
if (FIPS_CONFIG)
#== fips-specific section ==========================================
add_compile_options(-std=c++17)
## Set global include paths
fips_include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty
)
## Verbose output about ASIO handlers
#add_definitions( -DBOOST_ASIO_ENABLE_HANDLER_TRACKING )
fips_add_subdirectory("lib/")
if( NOT FIPS_IMPORT )
add_subdirectory("tools/")
endif()
if( FIPS_UNITTESTS )
add_subdirectory( test/ )
endif()
fips_finish()
else()
# == ROS / Catkin-specific section =================================
project(liboculus)
find_package(catkin REQUIRED
#cmake_modules
g3log_ros )
catkin_package(
CATKIN_DEPENDS g3log_ros
INCLUDE_DIRS include thirdparty
LIBRARIES liboculus_LIB )
add_compile_options(-std=c++14)
include_directories(
include
thirdparty
${catkin_INCLUDE_DIRS} )
set(oculus_SRCS
lib/DataRx.cpp
lib/SonarConfiguration.cpp
lib/SonarStatus.cpp
lib/StatusRx.cpp
lib/SonarPlayer.cpp
lib/OculusMessageHandler.cpp
lib/SimpleFireMessage.cpp
lib/IoServiceThread.cpp )
add_library(liboculus_LIB ${oculus_SRCS})
target_link_libraries(liboculus_LIB ${catkin_LIBRARIES})
install(TARGETS liboculus_LIB
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
## Install headers
install(DIRECTORY include/${PROJECT_NAME}/ thirdparty/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h"
PATTERN ".git" EXCLUDE)
if (CATKIN_ENABLE_TESTING)
add_definitions(-DTEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/test/data")
include_directories( test/data/ )
file(GLOB oculus_test_SRCS
test/unit/*cpp )
catkin_add_gtest(oculus_test ${oculus_test_SRCS})
target_link_libraries(oculus_test ${catkin_LIBRARIES}
liboculus_LIB
Boost::system )
endif()
endif()