forked from sylefeb/VoxSurf
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
executable file
·33 lines (28 loc) · 1.43 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
cmake_minimum_required(VERSION 3.10)
project(pyvoxsurf)
add_subdirectory(lib/LibSL-small)
set(XTL_INCLUDE_DIRS lib/xtl/include lib/xtensor/include
lib/xtensor-python/include)
find_package(HDF5 COMPONENTS CXX)
if(${HDF5_FOUND})
add_executable(VoxSurfExample src/pyvoxsurf/example.cpp)
target_compile_features(VoxSurfExample PRIVATE cxx_std_17)
target_include_directories(VoxSurfExample PRIVATE ${HDF5_INCLUDE_DIRS}
${XTL_INCLUDE_DIRS})
target_link_libraries(VoxSurfExample PRIVATE voxelizer ${HDF5_LIBRARIES})
endif(${HDF5_FOUND})
add_library(voxelizer STATIC src/pyvoxsurf/voxelizer.cpp)
target_compile_features(voxelizer PRIVATE cxx_std_17)
target_link_libraries(voxelizer PUBLIC LibSL)
target_include_directories(voxelizer PRIVATE ${XTL_INCLUDE_DIRS})
set_target_properties(LibSL PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
set_target_properties(voxelizer PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
find_package(Python COMPONENTS Interpreter NumPy)
add_subdirectory(lib/pybind11)
pybind11_add_module(pyvoxsurf src/pyvoxsurf/pyvoxsurf.cpp)
target_compile_features(pyvoxsurf PUBLIC cxx_std_14)
target_include_directories(
pyvoxsurf PRIVATE ${Python_INCLUDE_DIRS} ${Python_NumPy_INCLUDE_DIRS}
${XTL_INCLUDE_DIRS})
target_link_libraries(pyvoxsurf PUBLIC voxelizer)
install(TARGETS pyvoxsurf DESTINATION ${Python_SITELIB})