Correctly override MacOS Framework installation prefix

This commit is contained in:
derselbst 2022-01-14 22:33:38 +01:00 committed by Tom M
parent 166f767767
commit 634a8b0c04
2 changed files with 9 additions and 4 deletions

View File

@ -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")

View File

@ -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