-
Notifications
You must be signed in to change notification settings - Fork 54
/
CMakeLists.txt
105 lines (83 loc) · 3.21 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
cmake_minimum_required(VERSION 3.15)
file(READ VERSION CURRENT_VERSION)
project(pluginval VERSION ${CURRENT_VERSION})
if (APPLE)
# Target OS versions down to 10.11
set (CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE INTERNAL "")
# Uncomment to produce a universal binary
# set(CMAKE_OSX_ARCHITECTURES arm64 x86_64)
endif()
# Uncomment to enable tsan
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
# Adds all the module sources so they appear correctly in the IDE
set_property(GLOBAL PROPERTY USE_FOLDERS YES)
option(JUCE_ENABLE_MODULE_SOURCE_GROUPS "Enable Module Source Groups" ON)
option(PLUGINVAL_FETCH_JUCE "Fetch JUCE along with PluginVal" ON)
if(PLUGINVAL_FETCH_JUCE)
add_subdirectory(modules/juce)
endif()
if (DEFINED ENV{VST2_SDK_DIR})
MESSAGE(STATUS "Building with VST2 SDK: $ENV{VST2_SDK_DIR}")
juce_set_vst2_sdk_path($ENV{VST2_SDK_DIR})
else()
MESSAGE(STATUS "Not building with VST2")
endif()
juce_add_gui_app(pluginval
BUNDLE_ID com.Tracktion.pluginval
COMPANY_NAME Tracktion
ICON_BIG "${CMAKE_CURRENT_SOURCE_DIR}/Source/binarydata/icon.png"
HARDENED_RUNTIME_ENABLED TRUE
HARDENED_RUNTIME_OPTIONS com.apple.security.cs.allow-unsigned-executable-memory com.apple.security.cs.disable-library-validation com.apple.security.get-task-allow)
juce_generate_juce_header(pluginval)
target_compile_features(pluginval PRIVATE cxx_std_17)
set_target_properties(pluginval PROPERTIES
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden)
set(SourceFiles
Source/CommandLine.h
Source/CrashHandler.h
Source/MainComponent.h
Source/PluginTests.h
Source/TestUtilities.h
Source/Validator.h
Source/CommandLine.cpp
Source/CrashHandler.cpp
Source/Main.cpp
Source/MainComponent.cpp
Source/PluginTests.cpp
Source/tests/BasicTests.cpp
Source/tests/BusTests.cpp
Source/tests/ParameterFuzzTests.cpp
Source/TestUtilities.cpp
Source/Validator.cpp)
target_sources(pluginval PRIVATE ${SourceFiles})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/Source PREFIX Source FILES ${SourceFiles})
if (DEFINED ENV{VST2_SDK_DIR})
target_compile_definitions(pluginval PRIVATE
JUCE_PLUGINHOST_VST=1)
endif()
target_compile_definitions(pluginval PRIVATE
JUCE_PLUGINHOST_AU=1
JUCE_PLUGINHOST_LADSPA=1
JUCE_PLUGINHOST_VST3=1
JUCE_PLUGINHOST_LV2=1
JUCE_USE_CURL=0
JUCE_WEB_BROWSER=0
JUCE_MODAL_LOOPS_PERMITTED=1
JUCE_GUI_BASICS_INCLUDE_XHEADERS=1
VERSION="${CURRENT_VERSION}")
target_link_libraries(pluginval PRIVATE
juce::juce_audio_devices
juce::juce_audio_processors
juce::juce_audio_utils
juce::juce_recommended_warning_flags)
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(pluginval PRIVATE
-static-libstdc++)
endif()
set (cmdline_docs_out "${CMAKE_CURRENT_LIST_DIR}/docs/Command line options.md")
add_custom_command (OUTPUT "${cmdline_docs_out}"
COMMAND pluginval --help > "${cmdline_docs_out}"
COMMENT "Regenerating Command line options.md..."
USES_TERMINAL)
add_custom_target (PluginvalDocs DEPENDS "${cmdline_docs_out}")