-
Notifications
You must be signed in to change notification settings - Fork 24
/
CMakeLists.txt
38 lines (33 loc) · 1.31 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
cmake_minimum_required(VERSION 3.15)
project(chowdsp_utils VERSION 2.3.0)
set(CMAKE_CXX_STANDARD 17)
include(CTest)
option(CHOWDSP_ENABLE_TESTING "Enable testing for chowdsp modules" OFF)
option(CHOWDSP_ENABLE_BENCHMARKS "Enable benchmarks for chowdsp modules" OFF)
option(CHOWDSP_ENABLE_EXAMPLES "Enable examples for chowdsp modules" OFF)
if(NOT (CHOWDSP_ENABLE_TESTING OR CHOWDSP_ENABLE_BENCHMARKS OR CHOWDSP_ENABLE_EXAMPLES))
# Add CMake utils
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include(AddDiagnosticInfo)
include(SubprojectVersion)
if("${JUCE_MODULES_DIR}" STREQUAL "")
message(STATUS "Using ChowDSP modules outside of JUCE...")
include(SetupChowdspLib)
else()
message(STATUS "Adding ChowDSP JUCE modules...")
include(AddJUCEModules)
endif()
else()
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/test)
# Useful for testing with address sanitizer:
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g")
if(CHOWDSP_ENABLE_TESTING)
enable_testing()
add_subdirectory(tests)
elseif(CHOWDSP_ENABLE_BENCHMARKS)
add_subdirectory(bench)
elseif(CHOWDSP_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()
endif()