-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
68 lines (57 loc) · 2.3 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
67
68
cmake_minimum_required(VERSION 3.15)
project(tobanteAudioJuce6Demo VERSION 0.1.0)
# Only do these if this is the main project,
# and not if it is included through add_subdirectory.
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Let's nicely support folders in IDE's
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
if(MSVC)
CHECK_CXX_COMPILER_FLAG("/arch:AVX2" COMPILER_OPT_ARCH_AVX2_SUPPORTED)
if(COMPILER_OPT_ARCH_AVX2_SUPPORTED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2")
endif()
endif()
if(NOT APPLE)
include(CheckIPOSupported)
check_ipo_supported(RESULT TOBANTEAUDIO_BUILD_LTO)
if(TOBANTEAUDIO_BUILD_LTO)
message(STATUS "tobanteAudio: LTO is available.")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif()
endif()
option(TOBANTEAUDIO_BUILD_TESTS "Build the unit tests with Catch2" ON)
option(TOBANTEAUDIO_BUILD_COVERAGE "Build with coverage enabled" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CodeCoverage)
include(CompilerOptions)
include(CompilerWarnings)
# JUCE
add_subdirectory(3rd_party/JUCE EXCLUDE_FROM_ALL)
juce_add_module(${CMAKE_SOURCE_DIR}/3rd_party/ff_meters)
# juce_set_aax_sdk_path(...)
# Company settings
set_directory_properties(PROPERTIES JUCE_COMPANY_COPYRIGHT "Copyright @ tobanteAudio")
set_directory_properties(PROPERTIES JUCE_COMPANY_NAME "tobanteAudio")
set_directory_properties(PROPERTIES JUCE_COMPANY_WEBSITE "https://github.com/tobanteAudio/juce-6-demo")
set_directory_properties(PROPERTIES JUCE_COMPANY_EMAIL "[email protected]")
# Plugin
add_subdirectory(plugin)
# Tests
if(TOBANTEAUDIO_BUILD_TESTS)
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/Catch2/contrib")
enable_testing()
add_subdirectory(3rd_party/Catch2 EXCLUDE_FROM_ALL)
include(CTest)
include(Catch)
add_subdirectory(tests)
endif()