-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (42 loc) · 1.43 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
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(vn_driver)
find_package(cmake_macros)
include(create_package)
include(easy_find_packages)
easy_find_packages(vn_driver
"LibComms"
"vectornav"
"Boost system"
)
add_library(vn_driver SHARED src/driver.cpp)
target_link_libraries(vn_driver PUBLIC cc::vectornav Boost::system)
set_target_properties(vn_driver PROPERTIES CXX_STANDARD 17)
target_compile_features(vn_driver PRIVATE cxx_std_17)
target_include_directories(vn_driver
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/include>"
)
include(create_package)
create_package(vn_driver vn_driver)
install(
DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
FILES_MATCHING PATTERN "*.h"
)
# tests
add_executable(vn_driver_cons_test
test/main_cons.cpp
)
add_executable(vn_driver_tester
test/main_prod.cpp
)
add_executable(vn_listen_test
test/main_vn_test.cpp
)
target_link_libraries(vn_driver_cons_test PUBLIC vn_driver)
target_link_libraries(vn_driver_tester PUBLIC vn_driver)
target_link_libraries(vn_listen_test PUBLIC vn_driver)
set_target_properties(vn_driver_tester PROPERTIES CXX_STANDARD 17)
target_compile_features(vn_driver_tester PRIVATE cxx_std_17)
install(TARGETS vn_driver_cons_test vn_driver_tester vn_listen_test DESTINATION bin)