-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
51 lines (38 loc) · 1.41 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
cmake_minimum_required(VERSION 3.4...3.18)
project(cmake_example)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(MSVC)
include(c:/vcpkg/vcpkg/scripts/buildsystems/vcpkg.cmake)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
if(MSVC)
else()
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -march=native -fopenmp")
endif()
set(CMAKE_VERBOSE_MAKEFILE ON)
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
if(MSVC)
find_package (Boost REQUIRED)
else()
add_subdirectory(boost-cmake)
endif()
add_subdirectory(pybind11)
add_library(pointcloudqueries MODULE src/main.cpp)
target_link_libraries(pointcloudqueries PRIVATE pybind11::module pybind11::lto pybind11::windows_extras Boost::boost Eigen3::Eigen)
pybind11_extension(pointcloudqueries)
if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo)
# Strip unnecessary sections of the binary on Linux/macOS
pybind11_strip(pointcloudqueries)
endif()
set_target_properties(pointcloudqueries PROPERTIES CXX_VISIBILITY_PRESET "hidden"
CUDA_VISIBILITY_PRESET "hidden")
# EXAMPLE_VERSION_INFO is defined by setup.py and passed into the C++ code as a
# define (VERSION_INFO) here.
#target_compile_definitions(pointcloudqueries
# PRIVATE VERSION_INFO=${EXAMPLE_VERSION_INFO})