/
CMakeLists.txt
32 lines (25 loc) · 1.04 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
cmake_minimum_required(VERSION 3.17.1)
set(CMAKE_GENERATOR_PLATFORM Win32)
set(CMAKE_VS_PLATFORM_NAME Win32)
project(loupe LANGUAGES CXX)
include(cmake/Utilities.cmake)
loupe_is_top_level(LOUPE_TOP_LEVEL)
if (${LOUPE_TOP_LEVEL})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# Hide Cmake projects under 'CMakePredefinedTargets'
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Check to make sure that we are not building in source
if (${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
message("In source build are not supported. use a build/ subdirectory:")
message(" > cmake . <OPTIONS> -Bbuild")
message(FATAL_ERROR "Stopping build.")
endif()
endif()
option(LOUPE_TESTS "Build Loupe Test Executable" ${LOUPE_TOP_LEVEL})
option(LOUPE_ARCHIVER_CEREAL "Include an adapter archive for serialization with cereal." ON)
option(LOUPE_ENABLE_ASSERTS "Whether or not errors are signaled with a c-asserts (in debug builds)." ON)
add_subdirectory(external)
add_subdirectory(loupe)
if (LOUPE_TESTS)
add_subdirectory(tests)
endif()