From eb1f90d89c8b78ee40184500eef0fd8b5396e790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Pe=C3=B1aranda?= Date: Mon, 4 Apr 2011 10:45:49 +0000 Subject: [PATCH] print RS version while configuring --- Installation/cmake/modules/CGAL_UseRS.cmake | 17 +++++++++++++++++ Installation/cmake/modules/FindRS.cmake | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Installation/cmake/modules/CGAL_UseRS.cmake b/Installation/cmake/modules/CGAL_UseRS.cmake index 544a4392229..b4cdaa7dcd2 100644 --- a/Installation/cmake/modules/CGAL_UseRS.cmake +++ b/Installation/cmake/modules/CGAL_UseRS.cmake @@ -37,6 +37,23 @@ if( NOT CGAL_RS_SETUP ) add_definitions( ${RS_DEFINITIONS} "-DCGAL_USE_RS3" ) link_libraries( ${RS3_LIBRARIES} ) + # extract RS3 version from the file rsversion.h (based on Fernando + # Cacciola's code for FindBoost.cmake) + 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}") + STRING(REGEX REPLACE ".*#define[ \t]+rs_middle[ \t]+([0-9]+).*" + "\\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") + + message( STATUS "RS version is ${RS3_LIB_VERSION}" ) + endif( RS3_FOUND ) endif( RS_FOUND ) diff --git a/Installation/cmake/modules/FindRS.cmake b/Installation/cmake/modules/FindRS.cmake index 0d2424e65f8..b354ca42795 100644 --- a/Installation/cmake/modules/FindRS.cmake +++ b/Installation/cmake/modules/FindRS.cmake @@ -36,8 +36,8 @@ if( MPFI_FOUND ) if(_IS_GMP_VERSION_TO_LOW) - message( STATUS - "RS needs GMP>=4.2. Your GMP version is ${CGAL_GMP_VERSION}." ) + message( STATUS + "RS needs GMP>=4.2. Your GMP version is ${CGAL_GMP_VERSION}." ) else(_IS_GMP_VERSION_TO_LOW)