From 75e07d63d3437d03db0843f6ed0a146ecfb332b0 Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Sat, 11 Jun 2011 12:04:52 +0200 Subject: [PATCH] Fixed error in FindSFML.cmake when parsing SFML 1.x Config.hpp for version number --- cmake/Modules/FindSFML.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/Modules/FindSFML.cmake b/cmake/Modules/FindSFML.cmake index b616b146..dac0132f 100644 --- a/cmake/Modules/FindSFML.cmake +++ b/cmake/Modules/FindSFML.cmake @@ -42,6 +42,7 @@ 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) + 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}") math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10 + ${SFML_FIND_VERSION_MINOR}") @@ -59,6 +60,8 @@ if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR) # SFML version is < 2.0 if (SFML_REQUESTED_VERSION GREATER 19) set(SFML_VERSION_OK FALSE) + set(SFML_VERSION_MAJOR 1) + set(SFML_VERSION_MINOR x) endif() endif() endif()