From 8a96ec9c3a8de78a5fcf638e9a1e45f1a9969d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Lo=CC=81pez-Cabanillas?= Date: Fri, 14 Jan 2022 19:56:50 +0100 Subject: [PATCH] cmake macos frameworks update The framework target needs to know about the headers, so cmake tries to copy the framework files into the bundle. The macro set_source_files_properties() is a modern (cmake >= 3.0) replacement of the general set_property(). --- cmake_admin/DefaultDirs.cmake | 4 ++-- src/CMakeLists.txt | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmake_admin/DefaultDirs.cmake b/cmake_admin/DefaultDirs.cmake index 0110bac7..e1fb668e 100644 --- a/cmake_admin/DefaultDirs.cmake +++ b/cmake_admin/DefaultDirs.cmake @@ -12,12 +12,12 @@ endif ( WIN32 ) mark_as_advanced (DEFAULT_SOUNDFONT) # BUNDLE_INSTALL_DIR - Mac only: the directory for application bundles -set (BUNDLE_INSTALL_DIR "/Applications" CACHE STRING +set (BUNDLE_INSTALL_DIR "Applications" CACHE STRING "The install dir for application bundles") mark_as_advanced (BUNDLE_INSTALL_DIR) # FRAMEWORK_INSTALL_DIR - Mac only: the directory for framework bundles -set (FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING +set (FRAMEWORK_INSTALL_DIR "Library/Frameworks" CACHE STRING "The install dir for framework bundles") mark_as_advanced (FRAMEWORK_INSTALL_DIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4f3ef86a..565bea04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -303,11 +303,15 @@ endif ( LIBFLUID_CPPFLAGS ) # note: by default this target creates a shared object (or dll). To build a # static library instead, set the option BUILD_SHARED_LIBS to FALSE. -add_library ( libfluidsynth $ ) +add_library ( libfluidsynth + $ + ${public_main_HEADER} + ${public_HEADERS} +) if ( MACOSX_FRAMEWORK ) - set_property ( SOURCE ${public_HEADERS} - PROPERTY MACOSX_PACKAGE_LOCATION Headers/fluidsynth + set_source_files_properties ( ${public_HEADERS} + PROPERTIES MACOSX_PACKAGE_LOCATION Headers/fluidsynth ) set_target_properties ( libfluidsynth PROPERTIES