1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

CMake: Avoid adding target for LV2 manifest helper unless specifically required

This commit is contained in:
reuk 2022-09-06 16:23:12 +01:00
parent ec8cd0e48b
commit 436150b221
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
4 changed files with 18 additions and 32 deletions

View file

@ -163,9 +163,8 @@ install(FILES "${JUCE_BINARY_DIR}/JUCEConfigVersion.cmake"
DESTINATION "${JUCE_INSTALL_DESTINATION}")
if("${CMAKE_SOURCE_DIR}" STREQUAL "${JUCE_SOURCE_DIR}")
_juce_add_lv2_manifest_helper_target()
install(TARGETS juce_lv2_helper EXPORT LV2_HELPER DESTINATION "bin/JUCE-${JUCE_VERSION}")
install(EXPORT LV2_HELPER NAMESPACE juce:: DESTINATION "${JUCE_INSTALL_DESTINATION}")
else()
set_target_properties(juce_lv2_helper PROPERTIES EXCLUDE_FROM_ALL ON)
endif()

View file

@ -971,6 +971,8 @@ function(_juce_set_plugin_target_properties shared_code_target kind)
set(output_path "${products_folder}/${product_name}.lv2")
set_target_properties(${target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${output_path}")
_juce_add_lv2_manifest_helper_target()
add_custom_command(TARGET ${target_name} POST_BUILD
COMMAND juce::juce_lv2_helper "$<TARGET_FILE:${target_name}>"
VERBATIM)
@ -1716,6 +1718,21 @@ endfunction()
# ==================================================================================================
function(_juce_add_lv2_manifest_helper_target)
if(TARGET juce_lv2_helper)
return()
endif()
get_target_property(module_path juce::juce_audio_plugin_client INTERFACE_JUCE_MODULE_PATH)
add_executable(juce_lv2_helper "${module_path}/juce_audio_plugin_client/LV2/juce_LV2TurtleDumpProgram.cpp")
add_executable(juce::juce_lv2_helper ALIAS juce_lv2_helper)
target_compile_features(juce_lv2_helper PRIVATE cxx_std_17)
set_target_properties(juce_lv2_helper PROPERTIES BUILD_WITH_INSTALL_RPATH ON)
target_link_libraries(juce_lv2_helper PRIVATE ${CMAKE_DL_LIBS})
endfunction()
# ==================================================================================================
function(juce_add_console_app target)
add_executable(${target})
target_compile_definitions(${target} PRIVATE JUCE_STANDALONE_APPLICATION=1)

View file

@ -44,5 +44,3 @@ juce_add_modules(
juce_osc
juce_product_unlocking
juce_video)
add_subdirectory(juce_audio_plugin_client)

View file

@ -1,28 +0,0 @@
# ==============================================================================
#
# This file is part of the JUCE library.
# Copyright (c) 2022 - Raw Material Software Limited
#
# JUCE is an open source library subject to commercial or open-source
# licensing.
#
# By using JUCE, you agree to the terms of both the JUCE 7 End-User License
# Agreement and JUCE Privacy Policy.
#
# End User License Agreement: www.juce.com/juce-7-licence
# Privacy Policy: www.juce.com/juce-privacy-policy
#
# Or: You may also use this code under the terms of the GPL v3 (see
# www.gnu.org/licenses).
#
# JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
# EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
# DISCLAIMED.
#
# ==============================================================================
add_executable(juce_lv2_helper LV2/juce_LV2TurtleDumpProgram.cpp)
add_executable(juce::juce_lv2_helper ALIAS juce_lv2_helper)
target_compile_features(juce_lv2_helper PRIVATE cxx_std_17)
set_target_properties(juce_lv2_helper PROPERTIES BUILD_WITH_INSTALL_RPATH ON)
target_link_libraries(juce_lv2_helper PRIVATE ${CMAKE_DL_LIBS})