forked from colmap/glomap
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
44 lines (34 loc) · 1.4 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
cmake_minimum_required(VERSION 3.28)
project(glomap VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES ON)
option(OPENMP_ENABLED "Whether to enable OpenMP parallelization" ON)
option(TESTS_ENABLED "Whether to build test binaries" OFF)
option(ASAN_ENABLED "Whether to enable AddressSanitizer flags" OFF)
option(CCACHE_ENABLED "Whether to enable compiler caching, if available" ON)
option(FETCH_COLMAP "Whether to use COLMAP with FetchContent or with self-installed software" ON)
option(FETCH_POSELIB "Whether to use PoseLib with FetchContent or with self-installed software" ON)
option(FETCH_RERUN "Whether to use Rerun with FetchContent or with self-installed software" ON)
include(cmake/FindDependencies.cmake)
if (TESTS_ENABLED)
enable_testing()
endif()
if(ASAN_ENABLED)
message(STATUS "Enabling ASan")
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope)
add_link_options(-fsanitize=address)
endif()
if(CCACHE_ENABLED)
find_program(CCACHE ccache)
if(CCACHE)
message(STATUS "Enabling ccache support")
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
else()
message(STATUS "Disabling ccache support")
endif()
else()
message(STATUS "Disabling ccache support")
endif()
add_subdirectory(glomap)