Skip to content

Commit db45729

Browse files
committed
cmake: Add option to use external JUCE installation
We have our own JUCE patches, though in some cases there is a need for people to use JUCE provided by package manager. Add `USE_SYSTEM_JUCE` cmake option. By default in-tree JUCE is used. See: werman#131 werman#147
1 parent c1cf430 commit db45729

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if(NOT BUILD_VERSION)
1313
set(BUILD_VERSION 1.99)
1414
endif()
1515

16+
option(USE_SYSTEM_JUCE "" OFF)
1617
option(BUILD_FOR_RELEASE "Additional optimizations and steps may be taken for release" OFF)
1718
option(BUILD_TESTS "" ON)
1819
option(BUILD_VST_PLUGIN "If the VST2 plugin should be built" ON)
@@ -31,10 +32,16 @@ add_subdirectory(src/common)
3132
if (BUILD_LADSPA_PLUGIN)
3233
add_subdirectory(src/ladspa_plugin)
3334
endif ()
35+
3436
if (BUILD_VST_PLUGIN OR BUILD_VST3_PLUGIN OR BUILD_LV2_PLUGIN OR BUILD_AU_PLUGIN OR BUILD_AUV3_PLUGIN)
35-
# For install JUCE copies all its headers, no one needs them. It also doesn't install actual libraries.
36-
# On the other hand JUCE could install libraries during build process (see COPY_PLUGIN_AFTER_BUILD option).
37-
# So we have to manually install plugins.
38-
add_subdirectory(external/JUCE EXCLUDE_FROM_ALL)
37+
if (USE_SYSTEM_JUCE)
38+
find_package(JUCE)
39+
else ()
40+
# For install JUCE copies all its headers, no one needs them. It also doesn't install actual libraries.
41+
# On the other hand JUCE could install libraries during build process (see COPY_PLUGIN_AFTER_BUILD option).
42+
# So we have to manually install plugins.
43+
add_subdirectory(${JUCE_SOURCE_DIR} external/JUCE EXCLUDE_FROM_ALL)
44+
endif ()
45+
3946
add_subdirectory(src/juce_plugin)
4047
endif ()

0 commit comments

Comments
 (0)