Skip to content

Commit

Permalink
build Python library separately
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Jun 19, 2020
1 parent 3832f65 commit e849d06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ set(CMAKE_CXX_EXTENSIONS OFF)

add_compile_options(-O3 -Wall -Wpedantic -Wno-sign-compare)

add_library(${PROJECT_NAME}_cpu src/surface_normal.cpp)
target_link_libraries(${PROJECT_NAME}_cpu PRIVATE Eigen3::Eigen)

include(FetchContent)
FetchContent_Declare(pybind11 GIT_REPOSITORY https://github.com/pybind/pybind11)
FetchContent_MakeAvailable(pybind11)
pybind11_add_module(${PROJECT_NAME} src/python.cpp src/surface_normal.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE Eigen3::Eigen)
pybind11_add_module(${PROJECT_NAME} src/python.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_cpu)

option(WITH_CUDA "Build with CUDA support included" TRUE)
find_package(CUDA)
Expand Down

0 comments on commit e849d06

Please sign in to comment.