Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Find simgrid version
[simgrid.git] / buildtools / Cmake / Modules / FindSimGrid.cmake
index 9a1cf4f..69b55de 100644 (file)
@@ -65,9 +65,17 @@ 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")
+  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}")
 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")