Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added an index page for javadoc
[simgrid.git] / FindSimGrid.cmake
1 #IF YOU HAVE INSTALL SIMGRID IN A SPECIAL DIRECTORY
2 #YOU CAN SPECIFY SIMGRID_ROOT OR GRAS_ROOT
3
4 find_library(HAVE_SIMGRID_LIB
5     NAME simgrid
6     HINTS
7         $ENV{SIMGRID_ROOT}
8     PATH_SUFFIXES lib
9 )
10
11 find_path(HAVE_GRAS_H gras.h
12     HINTS
13         $ENV{SIMGRID_ROOT}
14     PATH_SUFFIXES include
15 )
16
17 message(STATUS "Looking for lib SimGrid")
18 if(HAVE_SIMGRID_LIB)
19   message(STATUS "Looking for lib SimGrid - found")
20   if(CMAKE_CACHE_MAJOR_VERSION EQUAL "2" AND CMAKE_CACHE_MINOR_VERSION GREATER "7") #need cmake version 2.8
21           get_filename_component(simgrid_version ${HAVE_SIMGRID_LIB} REALPATH)
22           string(REPLACE "${HAVE_SIMGRID_LIB}." "" simgrid_version "${simgrid_version}")
23           string(REGEX MATCH "^[0-9]" SIMGRID_MAJOR_VERSION "${simgrid_version}")
24           string(REGEX MATCH "^[0-9].[0-9]" SIMGRID_MINOR_VERSION "${simgrid_version}")
25           string(REGEX MATCH "^[0-9].[0-9].[0-9]" SIMGRID_PATCH_VERSION "${simgrid_version}")
26           string(REGEX REPLACE "^${SIMGRID_MINOR_VERSION}." "" SIMGRID_PATCH_VERSION "${SIMGRID_PATCH_VERSION}") 
27           string(REGEX REPLACE "^${SIMGRID_MAJOR_VERSION}." "" SIMGRID_MINOR_VERSION "${SIMGRID_MINOR_VERSION}")
28           message(STATUS "Simgrid version : ${SIMGRID_MAJOR_VERSION}.${SIMGRID_MINOR_VERSION}")
29   endif(CMAKE_CACHE_MAJOR_VERSION EQUAL "2" AND CMAKE_CACHE_MINOR_VERSION GREATER "7")
30 else(HAVE_SIMGRID_LIB)
31   message(STATUS "Looking for lib SimGrid - not found")
32 endif(HAVE_SIMGRID_LIB)
33
34 message(STATUS "Looking for gras.h")
35 if(HAVE_GRAS_H)
36 message(STATUS "Looking for gras.h - found")
37 else(HAVE_GRAS_H)
38 message(STATUS "Looking for gras.h - not found")
39 endif(HAVE_GRAS_H)
40
41 if(HAVE_SIMGRID_LIB AND HAVE_GRAS_H)
42 else(HAVE_SIMGRID_LIB AND HAVE_GRAS_H)
43     message(FATAL_ERROR "You need to install simgrid and set environment variable SIMGRID_ROOT!")
44 endif(HAVE_SIMGRID_LIB AND HAVE_GRAS_H)