Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
properly look for the SimGrid header files; stop relying on the SIMGRID_ROOT
[simgrid.git] / FindSimGrid.cmake
index f92b12d..220d690 100644 (file)
@@ -8,7 +8,7 @@ find_library(HAVE_SIMGRID_LIB
     PATH_SUFFIXES lib
 )
 
-find_path(HAVE_MSG_H msg.h
+find_path(SIMGRID_INCLUDES msg.h
     HINTS
        $ENV{SIMGRID_ROOT}
     PATH_SUFFIXES include
@@ -32,13 +32,13 @@ else(HAVE_SIMGRID_LIB)
 endif(HAVE_SIMGRID_LIB)
 
 message(STATUS "Looking for msg.h")
-if(HAVE_MSG_H)
-message(STATUS "Looking for msg.h - found")
-else(HAVE_MSG_H)
-message(STATUS "Looking for msg.h - not found")
-endif(HAVE_MSG_H)
+if(SIMGRID_INCLUDES)
+  message(STATUS "Looking for msg.h - found")
+else(SIMGRID_INCLUDES)
+  message(STATUS "Looking for msg.h - not found")
+endif(SIMGRID_INCLUDES)
 
-if(HAVE_SIMGRID_LIB AND HAVE_MSG_H)
-else(HAVE_SIMGRID_LIB AND HAVE_MSG_H)
-    message(FATAL_ERROR "You need to install simgrid and set environment variable SIMGRID_ROOT!")
-endif(HAVE_SIMGRID_LIB AND HAVE_MSG_H)
\ No newline at end of file
+if(HAVE_SIMGRID_LIB AND SIMGRID_INCLUDES)
+else(HAVE_SIMGRID_LIB AND SIMGRID_INCLUDES)
+    message(FATAL_ERROR "Unable to find both the library and the include files. Setting the environment variable SIMGRID_ROOT may help.")
+endif(HAVE_SIMGRID_LIB AND SIMGRID_INCLUDES)
\ No newline at end of file