-
Notifications
You must be signed in to change notification settings - Fork 128
/
CMakeLists.txt
27 lines (21 loc) · 1.03 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
cmake_minimum_required(VERSION 3.10)
project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION})
set(CMAKE_CUDA_ARCHITECTURES "native")
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Some fixes for the Glog library.
add_definitions("-DGLOG_NO_ABBREVIATED_SEVERITIES")
add_definitions("-DGL_GLEXT_PROTOTYPES")
add_definitions("-DNOMINMAX")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
# Enable object level parallel builds in Visual Studio.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()
find_package(colmap 3.9.1 REQUIRED)
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 REQUIRED)
pybind11_add_module(pycolmap pycolmap/main.cc)
target_include_directories(pycolmap PRIVATE ${PROJECT_SOURCE_DIR})
target_link_libraries(pycolmap PRIVATE colmap::colmap freeimage::FreeImage glog::glog)
target_compile_definitions(pycolmap PRIVATE VERSION_INFO="${PROJECT_VERSION}")
install(TARGETS pycolmap LIBRARY DESTINATION .)