From 9f2aecf9cff75307cb3f5857d193a43663cfba58 Mon Sep 17 00:00:00 2001 From: Marco Antognini Date: Thu, 8 Jan 2015 16:21:39 +0100 Subject: [PATCH] Relaxed cmake installation rules regarding OS X framework dependencies No longer install sndfile and/or freetype frameworks if SFML is built libraries not from the extlibs folder. Related to #620 and Homebrew/homebrew#35479 Xcode templates are not updated yet to reflect that change since it involve toying with `install_name_tool` and is quite complex. --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7a99ee07..52e3870bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -267,9 +267,14 @@ if(SFML_OS_WINDOWS) elseif(SFML_OS_MACOSX) - # install the non-standard frameworks SFML depends on - install(DIRECTORY extlibs/libs-osx/Frameworks/sndfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) - install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + # install extlibs dependencies only when used + if("${SNDFILE_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/sndfile.framework") + install(DIRECTORY extlibs/libs-osx/Frameworks/sndfile.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + endif() + + if("${FREETYPE_LIBRARY}" STREQUAL "${SFML_SOURCE_DIR}/extlibs/libs-osx/Frameworks/freetype.framework") + install(DIRECTORY extlibs/libs-osx/Frameworks/freetype.framework DESTINATION ${CMAKE_INSTALL_FRAMEWORK_PREFIX}) + endif() # install the Xcode templates if requested if(SFML_INSTALL_XCODE_TEMPLATES)