-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
50 lines (41 loc) · 1.49 KB
/
CMakeLists.txt
File metadata and controls
50 lines (41 loc) · 1.49 KB
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
cmake_minimum_required(VERSION 3.22)
option(CTX_PLUGIN_BUILD "Build for plugin target" OFF)
option(CTX_ENABLE_LOGGING "Enable logging capabilities" OFF)
project(cortex VERSION 0.1.0 LANGUAGES C CXX)
if(CTX_PLUGIN_BUILD)
# CAUTION: This assumes CMake is being run from plugin directory
# with JUCE modules in the vendor directory.
# add_subdirectory("../../vendor/juce" "../../bin/lib")
set(CTX_JUCE_SOURCE_DIR "../../vendor/juce/modules")
else()
# CAUTION: Only use this project's JUCE submodule if NOT working on a
# plugin project.
add_subdirectory("vendor/juce")
set(CTX_JUCE_SOURCE_DIR "vendor/juce/modules")
endif()
file(GLOB_RECURSE SRC_FILES "src/*.cpp")
add_library(cortex STATIC ${SRC_FILES})
set_target_properties(cortex PROPERTIES
PUBLIC
CXX_STANDARD 23
CXX_STANDARD_REQUIRED
CXX_VISIBILITY_PRESET hidden
OSX_ARCHITECTURES "x86_64;arm64")
if (CTX_ENABLE_LOGGING)
target_compile_definitions(cortex PUBLIC CTX_ENABLE_LOGGING=1)
else()
target_compile_definitions(cortex PUBLIC CTX_ENABLE_LOGGING=0)
endif()
target_link_libraries(cortex
PRIVATE
juce::juce_gui_basics
juce::juce_recommended_warning_flags
juce::juce_recommended_config_flags
juce::juce_recommended_lto_flags)
target_include_directories(cortex
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${CTX_JUCE_SOURCE_DIR})