forked from norlab-ulaval/norlab_icp_mapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (37 loc) · 1.6 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
cmake_minimum_required(VERSION 2.8.3)
project(norlab_icp_mapper)
set(CMAKE_CXX_STANDARD 11)
set(EXTERNAL_INCLUDE_DIRS "")
set(EXTERNAL_LIBS "")
find_package(libpointmatcher CONFIG)
set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${libpointmatcher_INCLUDE_DIRS})
set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${libpointmatcher_LIBRARIES})
# norlab_icp_mapper target
include_directories(norlab_icp_mapper ${libpointmatcher_INCLUDE_DIRS})
add_library(norlab_icp_mapper SHARED norlab_icp_mapper/Mapper.cpp)
target_link_libraries(norlab_icp_mapper ${libpointmatcher_LIBRARIES})
# install target
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files")
set(DEF_INSTALL_CMAKE_DIR lib/cmake/norlab_icp_mapper CACHE PATH "Installation directory for CMake files")
install(TARGETS norlab_icp_mapper DESTINATION ${INSTALL_LIB_DIR})
install(FILES norlab_icp_mapper/Mapper.h
DESTINATION ${INSTALL_INCLUDE_DIR}/norlab_icp_mapper
)
configure_file(norlab_icp_mapperConfig.cmake.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/norlab_icp_mapperConfig.cmake" @ONLY
)
install(FILES
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/norlab_icp_mapperConfig.cmake"
DESTINATION ${DEF_INSTALL_CMAKE_DIR}
COMPONENT dev
)
# uninstall target
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()