From 6edc4b951838771340512f7b91b27f05039ae606 Mon Sep 17 00:00:00 2001 From: Marco Antognini Date: Sun, 20 Apr 2014 21:32:05 +0200 Subject: [PATCH] Improved cmake script: add OS X specific options only on Mac platform --- CMakeLists.txt | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54d9cf9a0..91a1b5984 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,18 +47,18 @@ endif() # add an option for building the API documentation sfml_set_option(SFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it") - -# set default CMAKE_OSX_ARCHITECTURES value to x86_64 -sfml_set_option(CMAKE_OSX_ARCHITECTURES "x86_64" STRING "Build architectures for OS X") -# set default CMAKE_OSX_DEPLOYMENT_TARGET value to 10.7 -sfml_set_option(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" STRING "Minimum OS version to target for deployment (at runtime)") - # add an option for choosing the OpenGL implementation -sfml_set_option(SFML_OPENGL_ES ${OPENGL_ES} BOOL "TRUE to use an OpenGL ES implementation, FALSE to use a desktop OpenGL implementation") +sfml_set_option(SFML_OPENGL_ES ${OPENGL_ES} BOOL "TRUE to use an OpenGL ES implementation, FALSE to use a desktop OpenGL implementation") # Mac OS X specific options if(SFML_OS_MACOSX) + # set default CMAKE_OSX_ARCHITECTURES value to x86_64 + sfml_set_option(CMAKE_OSX_ARCHITECTURES "x86_64" STRING "Build architectures for OS X") + + # set default CMAKE_OSX_DEPLOYMENT_TARGET value to 10.7 + sfml_set_option(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" STRING "Minimum OS version to target for deployment (at runtime)") + # add an option to build frameworks instead of dylibs (release only) sfml_set_option(SFML_BUILD_FRAMEWORKS FALSE BOOL "TRUE to build SFML as frameworks libraries (release only), FALSE to build according to BUILD_SHARED_LIBS") @@ -173,8 +173,8 @@ if(SFML_OS_LINUX OR SFML_OS_FREEBSD) "tools/pkg-config/sfml-${sfml_module}.pc.in" "tools/pkg-config/sfml-${sfml_module}.pc" @ONLY) - INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/tools/pkg-config/sfml-${sfml_module}.pc" - DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig") + INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/tools/pkg-config/sfml-${sfml_module}.pc" + DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig") endforeach() endif() else() @@ -234,9 +234,9 @@ else() add_custom_command(TARGET SFML POST_BUILD COMMAND cp -r ${PROJECT_SOURCE_DIR}/include/SFML/* SFML.framework/Versions/${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}/Headers) - + # adapt install directory to allow distributing dylibs/frameworks in user’s frameworks/application bundle - # NOTE : it's not required to link agains SFML.framework + # NOTE : it's not required to link agains SFML.framework set_target_properties(SFML PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path/../Frameworks") @@ -251,12 +251,12 @@ install(FILES license.txt DESTINATION ${INSTALL_MISC_DIR}) install(FILES readme.txt DESTINATION ${INSTALL_MISC_DIR}) if(NOT SFML_OS_ANDROID) install(FILES cmake/Modules/FindSFML.cmake DESTINATION ${INSTALL_MISC_DIR}/cmake/Modules) -endif() +endif() -# install 3rd-party libraries and tools +# install 3rd-party libraries and tools if(SFML_OS_WINDOWS) - # install the binaries of SFML dependencies + # install the binaries of SFML dependencies if(ARCH_32BITS) install(DIRECTORY extlibs/bin/x86/ DESTINATION bin) if(SFML_COMPILER_MSVC) @@ -272,10 +272,10 @@ if(SFML_OS_WINDOWS) install(DIRECTORY extlibs/libs-mingw/x64/ DESTINATION lib) endif() endif() - + elseif(SFML_OS_MACOSX) - # install the non-standard frameworks SFML depends on + # 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})