From 9e18f64d6b75e104bf0498653e0bcd1ed1b0c256 Mon Sep 17 00:00:00 2001 From: Marco Antognini Date: Thu, 19 Apr 2012 21:03:20 +0200 Subject: [PATCH] Added support of Mac OS X framework in FindSFML.cmake (Close #106) --- cmake/Modules/FindSFML.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/FindSFML.cmake b/cmake/Modules/FindSFML.cmake index cf28b165..037d4953 100644 --- a/cmake/Modules/FindSFML.cmake +++ b/cmake/Modules/FindSFML.cmake @@ -80,7 +80,13 @@ find_path(SFML_INCLUDE_DIR SFML/Config.hpp set(SFML_VERSION_OK TRUE) if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR) # extract the major and minor version numbers from SFML/Config.hpp - FILE(READ "${SFML_INCLUDE_DIR}/SFML/Config.hpp" SFML_CONFIG_HPP_CONTENTS) + # we have to handle framework a little bit differently : + if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework") + set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp") + else() + set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp") + endif() + FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS) STRING(REGEX MATCH ".*#define SFML_VERSION_MAJOR ([0-9]+).*#define SFML_VERSION_MINOR ([0-9]+).*" SFML_CONFIG_HPP_CONTENTS "${SFML_CONFIG_HPP_CONTENTS}") STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}") STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")