-
Notifications
You must be signed in to change notification settings - Fork 56
/
CMakeLists.txt
66 lines (52 loc) · 2.74 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 3.16)
# cmake options
# required to decide default triplet
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
include("${CMAKE_CURRENT_SOURCE_DIR}/CMake/helpers.cmake")
att_default_triplet(ATT_TRIPLET)
# setup vcpkg manifest mode, set before first project() call
set(VCPKG_TARGET_TRIPLET "${ATT_TRIPLET}" CACHE STRING "")
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg-ports")
set(VCPKG_OVERLAY_TRIPLETS "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg-triplets")
set(VCPKG_INSTALL_OPTIONS "--clean-after-build" "--x-abi-tools-use-exact-versions" CACHE STRING "")
# clone a local vcpkg install if user doesn't already have
# set the toolchain file to vcpkg.cmake
att_bootstrap_vcpkg()
# vcpkg stuff must be done before project
project("April-Tag-VR-FullBody-Tracker" CXX)
# on windows default install is C:\Program Files (x86)\ which requires admin perms
# this sets it for any platform if use doesn't provide
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/install" CACHE PATH "Install directory." FORCE)
message(STATUS "Installing to ${CMAKE_INSTALL_PREFIX}")
endif()
# multi config generators like Visual Studio and Ninja Multi-Config
get_property(ATT_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(NOT ATT_IS_MULTI_CONFIG)
# Set default build type to release on single config
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Debug or Release.")
endif()
# cmake options
option(CMAKE_EXPORT_COMPILE_COMMANDS "Create compile_commands.json (not available with VS)" ON)
option(ENABLE_TESTING "Build and install test binary" OFF)
# project options
option(ATT_INSTALL_RESOURCES "Copy various required resources to install" ON)
option(ATT_ENABLE_DRIVER "Build and install the BridgeDriver" ON)
option(ATT_ENABLE_DEBUG_DRIVER "Build and install a debug/testing driver" OFF)
option(ATT_DEBUG "Developer mode. Enable custom assert, debug logging, and debugger support. Can be used in release build." OFF)
option(ATT_ENABLE_ANALYZER "Enable compiler static analyzers with ATT_DEBUG. CPU intensive." OFF)
option(ATT_ENABLE_ASAN "Build with address sanitizer" OFF)
set(ATT_LOG_LEVEL "1" CACHE STRING "0 - Silent, 1 - Info, 2 - Debug")
option(ATT_TEST_ENABLE_ASAN "Build tests with address sanitizer" ON)
# include libs in common/ for every project
add_subdirectory("common" EXCLUDE_FROM_ALL)
att_clone_submodule("BridgeDriver")
att_read_version_file(DRIVER_VERSION "${CMAKE_CURRENT_SOURCE_DIR}/BridgeDriver/VERSION.txt")
add_subdirectory("AprilTagTrackers")
if (ATT_ENABLE_DRIVER)
add_subdirectory("BridgeDriver")
endif()
# folder layout maintained
if (ATT_INSTALL_RESOURCES)
install(DIRECTORY "utilities" "bindings" "locales" "images-to-print" DESTINATION ".")
endif()