-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (38 loc) · 1.64 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
cmake_minimum_required(VERSION 3.5)
project(modern-rgbd-slam LANGUAGES CXX)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_CXX_STANDARD 14)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(COMPILE_FLAGS "-W;-Wall;-Werror;-fsigned-char;-freg-struct-return;"
"-Wextra;-Wpointer-arith;-Wcast-qual;-Wshadow;-Wno-error=unused-variable;"
"-Wno-error=unused-parameter;-Wpedantic;-ggdb;-march=native")
add_compile_options("${COMPILE_FLAGS}")
endif()
if(NOT TARGET uninstall)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
export(TARGETS FILE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake)
endif()
file(WRITE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake
"include(CMakeFindDependencyMacro)\n"
"include(\${CMAKE_CURRENT_LIST_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake)\n")
add_subdirectory(modules)
add_subdirectory(apps)
add_subdirectory(doc)
install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake
DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})
install(EXPORT ${CMAKE_PROJECT_NAME}Targets NAMESPACE room::
DESTINATION lib/cmake/${CMAKE_PROJECT_NAME})
if(NOT TARGET install-app)
add_custom_target(install-app COMMAND
"${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=install-app
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
endif()