X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/30769c28f7021367f7d7f54e868dde6c2c17c050..151b538fec21b3fe1c3b46c61973635df5c291b9:/FindSimGrid.cmake diff --git a/FindSimGrid.cmake b/FindSimGrid.cmake index 9a1cf4f627..79aaa78810 100644 --- a/FindSimGrid.cmake +++ b/FindSimGrid.cmake @@ -65,9 +65,19 @@ find_program(HAVE_GRAS_STUB message(STATUS "Looking for lib SimGrid") if(HAVE_SIMGRID_LIB) -message(STATUS "Looking for lib SimGrid - found") + message(STATUS "Looking for lib SimGrid - found") + if(CMAKE_CACHE_MAJOR_VERSION EQUAL "2" AND CMAKE_CACHE_MINOR_VERSION GREATER "7") #need cmake version 2.8 + get_filename_component(simgrid_version ${HAVE_SIMGRID_LIB} REALPATH) + string(REPLACE "${HAVE_SIMGRID_LIB}." "" simgrid_version "${simgrid_version}") + string(REGEX MATCH "^[0-9]" SIMGRID_MAJOR_VERSION "${simgrid_version}") + string(REGEX MATCH "^[0-9].[0-9]" SIMGRID_MINOR_VERSION "${simgrid_version}") + string(REGEX MATCH "^[0-9].[0-9].[0-9]" SIMGRID_PATCH_VERSION "${simgrid_version}") + string(REGEX REPLACE "^${SIMGRID_MINOR_VERSION}." "" SIMGRID_PATCH_VERSION "${SIMGRID_PATCH_VERSION}") + string(REGEX REPLACE "^${SIMGRID_MAJOR_VERSION}." "" SIMGRID_MINOR_VERSION "${SIMGRID_MINOR_VERSION}") + message(STATUS "Simgrid version : ${SIMGRID_MAJOR_VERSION}.${SIMGRID_MINOR_VERSION}") + endif(CMAKE_CACHE_MAJOR_VERSION EQUAL "2" AND CMAKE_CACHE_MINOR_VERSION GREATER "7") else(HAVE_SIMGRID_LIB) -message(STATUS "Looking for lib SimGrid - not found") + message(STATUS "Looking for lib SimGrid - not found") endif(HAVE_SIMGRID_LIB) message(STATUS "Looking for gras.h")