Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
properly look for the SimGrid header files; stop relying on the SIMGRID_ROOT
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 27 Jan 2012 20:53:17 +0000 (21:53 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 27 Jan 2012 20:53:17 +0000 (21:53 +0100)
This environment variable is used as an hint at configure time, the
first time you run ccmake. But the value provided to ccmake is only
what's needed to get the thing running.

CMakeLists.txt
FindJavaSG.cmake
FindSimGrid.cmake

index df7d0c1..2b63190 100644 (file)
@@ -174,7 +174,7 @@ string(REPLACE ".java" ".class" JAVA_EXAMPLES_CLASS "${JAVA_EXAMPLES_CLASS}")
 # FLAGS #
 #########
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ")
 # FLAGS #
 #########
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ")
-set(INCLUDE_PATH "-I${CMAKE_HOME_DIRECTORY}/src -I$ENV{SIMGRID_ROOT}/include -I$ENV{SIMGRID_ROOT}/src -I$ENV{SIMGRID_ROOT}/src/include")
+set(INCLUDE_PATH "-I${CMAKE_HOME_DIRECTORY}/src -I${SIMGRID_INCLUDES}")
 set(LIB_PATH "-L$ENV{SIMGRID_ROOT}/lib")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${INCLUDE_PATH} ${LIB_PATH} -DMSG_USE_DEPRECATED")
 
 set(LIB_PATH "-L$ENV{SIMGRID_ROOT}/lib")
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${INCLUDE_PATH} ${LIB_PATH} -DMSG_USE_DEPRECATED")
 
index 11e6323..92d254d 100644 (file)
@@ -3,9 +3,9 @@ include(FindJNI)
        
 message(STATUS "Looking for jni.h")
 if(JAVA_INCLUDE_PATH)
        
 message(STATUS "Looking for jni.h")
 if(JAVA_INCLUDE_PATH)
-message(STATUS "Looking for jni.h - found")
+ message(STATUS "Looking for jni.h - found")
 else(JAVA_INCLUDE_PATH)
 else(JAVA_INCLUDE_PATH)
-message(STATUS "Looking for jni.h - not found")
+ message(STATUS "Looking for jni.h - not found")
 endif(JAVA_INCLUDE_PATH)
 if(JAVA_INCLUDE_PATH)
        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${JAVA_INCLUDE_PATH} ")
 endif(JAVA_INCLUDE_PATH)
 if(JAVA_INCLUDE_PATH)
        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${JAVA_INCLUDE_PATH} ")
index f92b12d..220d690 100644 (file)
@@ -8,7 +8,7 @@ find_library(HAVE_SIMGRID_LIB
     PATH_SUFFIXES lib
 )
 
     PATH_SUFFIXES lib
 )
 
-find_path(HAVE_MSG_H msg.h
+find_path(SIMGRID_INCLUDES msg.h
     HINTS
        $ENV{SIMGRID_ROOT}
     PATH_SUFFIXES include
     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")
 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