-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
40 lines (29 loc) · 1.22 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
# min. version of cmake required for this project
cmake_minimum_required(VERSION 3.10)
# name of the project
project(pointCloudFilters)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build/bin)
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build/lib)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# collect all the .cxx needed for executable
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
add_subdirectory(thirdparty/flann)
add_subdirectory(example)
# Create library
add_library(${PROJECT_NAME}_shared SHARED ${SOURCES})
target_link_libraries(${PROJECT_NAME}_shared PUBLIC flann_cpp)
target_include_directories(
${PROJECT_NAME}_shared
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/flann/src/cpp
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/eigen)
add_library(${PROJECT_NAME}_static STATIC ${SOURCES})
target_link_libraries(${PROJECT_NAME}_static PUBLIC flann_cpp_s)
target_include_directories(
${PROJECT_NAME}_static
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/flann/src/cpp
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/eigen)