diff --git a/Installation/cmake/modules/CGAL_UseRS.cmake b/Installation/cmake/modules/CGAL_UseRS.cmake index b4cdaa7dcd2..32162b90773 100644 --- a/Installation/cmake/modules/CGAL_UseRS.cmake +++ b/Installation/cmake/modules/CGAL_UseRS.cmake @@ -39,7 +39,7 @@ if( NOT CGAL_RS_SETUP ) # extract RS3 version from the file rsversion.h (based on Fernando # Cacciola's code for FindBoost.cmake) - if(EXISTS "${RS3_INCLUDE_DIR}/rsversion.h") + if( EXISTS "${RS3_INCLUDE_DIR}/rsversion.h" ) FILE(READ "${RS3_INCLUDE_DIR}/rsversion.h" _rsversion_h_CONTENTS) STRING(REGEX REPLACE ".*#define[ \t]+rs_major[ \t]+([0-9]+).*" "\\1" RS3_MAJOR "${_rsversion_h_CONTENTS}") @@ -47,13 +47,21 @@ if( NOT CGAL_RS_SETUP ) "\\1" RS3_MIDDLE "${_rsversion_h_CONTENTS}") STRING(REGEX REPLACE ".*#define[ \t]+rs_minor[ \t]+([0-9]+).*" "\\1" RS3_MINOR "${_rsversion_h_CONTENTS}") - SET(RS3_LIB_VERSION "${RS3_MAJOR}.${RS3_MIDDLE}.${RS3_MINOR}") - else(EXISTS "${RS3_INCLUDE_DIR}/rsversion.h") - SET(RS3_LIB_VERSION "unknown") - endif(EXISTS "${RS3_INCLUDE_DIR}/rsversion.h") + SET( RS3_LIB_VERSION "${RS3_MAJOR}.${RS3_MIDDLE}.${RS3_MINOR}" ) + IS_VERSION_LESS( "${RS3_MAJOR}.${RS3_MIDDLE}" "3.1" RS_OLD_INCLUDES ) + else( EXISTS "${RS3_INCLUDE_DIR}/rsversion.h" ) + # rsversion.h did not exist in old versions + SET( RS3_LIB_VERSION "unknown" ) + SET( RS_OLD_INCLUDES TRUE ) + endif( EXISTS "${RS3_INCLUDE_DIR}/rsversion.h" ) message( STATUS "RS version is ${RS3_LIB_VERSION}" ) + if( RS_OLD_INCLUDES ) + add_definitions( "-DCGAL_RS_OLD_INCLUDES" ) + message( STATUS "Using old RS signatures" ) + endif( RS_OLD_INCLUDES ) + endif( RS3_FOUND ) endif( RS_FOUND )