-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
55 lines (46 loc) · 2.17 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
cmake_minimum_required(VERSION 3.11)
set(PROJECT_NAME mesh_sampling)
set(PROJECT_DESCRIPTION "Sample pointcloud from meshes")
set(PROJECT_URL https://github.com/arntanguy/mesh_sampling)
set(PROJECT_VERSION 1.0.0)
set(PROJECT_USE_CMAKE_EXPORT TRUE)
set(PROJECT_DEBUG_POSTFIX "_d")
set(CXX_DISABLE_WERROR 1)
set(CMAKE_CXX_STANDARD 11)
include(cmake/base.cmake)
include(cmake/eigen.cmake)
search_for_eigen()
project(${PROJECT_NAME} LANGUAGES CXX VERSION ${PROJECT_VERSION})
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
# Note:
# Instead of these find_package calls add_project_dependecy should be used to populate the
# mesh_sampling_DEPENDENCIES of the generated mesh_samplingConfig.cmake file
# add_project_dependency(mesh_sampling_3rd_party_assimp REQUIRED)
# add_project_dependency(mesh_sampling_3rd_party_PCL REQUIRED)
# However, since we are using custom cmake scripts to look for these libraries and create clean modern cmake targets, using add_project_dependency leads to the mesh_samplingConfig script to try and find these dependencies before the path to the required mesh_sampling_3rd_party_*.cmake have been included.
#
# For now, manually add those to the mesh_samplingConfig.cmake script
find_package(mesh_sampling_3rd_party_assimp REQUIRED)
find_package(mesh_sampling_3rd_party_PCL REQUIRED)
add_project_dependency(Boost COMPONENTS filesystem program_options REQUIRED)
# Export scripts to find the custom PCL/assimp dependencies
install(FILES
CMakeModules/Findmesh_sampling_3rd_party_PCL.cmake
DESTINATION lib/cmake/mesh_sampling
RENAME mesh_sampling_3rd_party_PCLConfig.cmake
)
install(FILES
CMakeModules/Findmesh_sampling_3rd_party_assimp.cmake
DESTINATION lib/cmake/mesh_sampling
RENAME mesh_sampling_3rd_party_assimpConfig.cmake
)
# Export custom package dependencies to the mesh_samplingConfig script such that they are found
# when importing the package with find_package(mesh_sampling)
set(PACKAGE_EXTRA_MACROS
"include(\"\$\{CMAKE_CURRENT_LIST_DIR\}/mesh_sampling_3rd_party_assimpConfig.cmake\")
include(\"\$\{CMAKE_CURRENT_LIST_DIR\}/mesh_sampling_3rd_party_PCLConfig.cmake\")"
)
add_subdirectory(src)
if(${BUILD_TESTING})
add_subdirectory(tests)
endif()