-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
53 lines (40 loc) · 1.58 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
cmake_minimum_required(VERSION 2.8)
project(libucomm)
set(LIBUCOMM_VERSION 0.1)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/cmake/libucommConfigVersion.cmake"
VERSION ${LIBUCOMM_VERSION}
COMPATIBILITY AnyNewerVersion
)
configure_file(
cmake/libucommConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/cmake/libucommConfig.cmake"
COPYONLY
)
set(CMAKE_CXX_STANDARD 17)
set(CONF_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
set(CONF_PARSE_PY "${CMAKE_INSTALL_PREFIX}/bin/libucomm_parse.py")
configure_file(cmake/libucommConfig.cmake.in "${PROJECT_BINARY_DIR}/cmake/libucommConfig.cmake" @ONLY)
configure_file(cmake/libucommConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/cmake/libucommConfigVersion.cmake" @ONLY)
configure_file(cmake/libucommBuildTreeSettings.cmake.in "${PROJECT_BINARY_DIR}/cmake/libucommBuildTreeSettings.cmake" @ONLY)
set(LIBUCOMM_PARSE_PY ${CMAKE_HOME_DIRECTORY}/libucomm_parse.py)
set(LIBUCOMM_INCLUDE_DIR ${CMAKE_HOME_DIRECTORY}/include)
include(cmake/libucomm.cmake)
include_directories(include)
set(BUILD_EXAMPLES ON CACHE BOOL "Enable examples")
if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
set(ENABLE_TESTS ON CACHE BOOL "Enable tests")
if(ENABLE_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
install(DIRECTORY include/ DESTINATION include)
install(PROGRAMS libucomm_parse.py DESTINATION bin)
install(FILES
${PROJECT_BINARY_DIR}/cmake/libucommConfig.cmake
${PROJECT_BINARY_DIR}/cmake/libucommConfigVersion.cmake
cmake/libucomm.cmake
DESTINATION share/cmake/libucomm)