From 634a8b0c04cb7becf93813e2184b55bb8c431813 Mon Sep 17 00:00:00 2001 From: derselbst Date: Fri, 14 Jan 2022 22:33:38 +0100 Subject: [PATCH] Correctly override MacOS Framework installation prefix --- cmake_admin/DefaultDirs.cmake | 9 +++++++-- src/CMakeLists.txt | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake_admin/DefaultDirs.cmake b/cmake_admin/DefaultDirs.cmake index e1fb668e..b747cbba 100644 --- a/cmake_admin/DefaultDirs.cmake +++ b/cmake_admin/DefaultDirs.cmake @@ -11,15 +11,20 @@ else ( WIN32 ) endif ( WIN32 ) mark_as_advanced (DEFAULT_SOUNDFONT) +set(FRAMEWORK_INSTALL_PREFIX "") +if ( CMAKE_VERSION VERSION_GREATER "3.7.0" AND NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT ) + set(FRAMEWORK_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) +endif() + # BUNDLE_INSTALL_DIR - Mac only: the directory for application bundles 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 "The install dir for framework bundles") -mark_as_advanced (FRAMEWORK_INSTALL_DIR) +mark_as_advanced (FRAMEWORK_INSTALL_DIR) # BIN_INSTALL_DIR - the directory where executables will be installed set (BIN_INSTALL_DIR "bin" CACHE STRING "The install dir for executables") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b4b37f79..2803ca88 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -406,8 +406,8 @@ target_link_libraries ( fluidsynth if ( MACOSX_FRAMEWORK ) install ( TARGETS fluidsynth libfluidsynth RUNTIME DESTINATION ${BIN_INSTALL_DIR} - FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR} - ARCHIVE DESTINATION ${FRAMEWORK_INSTALL_DIR} + FRAMEWORK DESTINATION "${FRAMEWORK_INSTALL_PREFIX}/${FRAMEWORK_INSTALL_DIR}" + ARCHIVE DESTINATION "${FRAMEWORK_INSTALL_PREFIX}/${FRAMEWORK_INSTALL_DIR}" ) else ( MACOSX_FRAMEWORK ) install ( TARGETS fluidsynth libfluidsynth