From: Martin Quinson Date: Fri, 27 Jan 2012 20:53:17 +0000 (+0100) Subject: properly look for the SimGrid header files; stop relying on the SIMGRID_ROOT X-Git-Tag: v3_9_90~569^2~19^2~152 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fa73197ac740922fc74b7940d5516b4b3e49ee55?ds=sidebyside properly look for the SimGrid header files; stop relying on the SIMGRID_ROOT 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. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index df7d0c1b29..2b631904f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ") -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") diff --git a/FindJavaSG.cmake b/FindJavaSG.cmake index 11e6323007..92d254dfaf 100644 --- a/FindJavaSG.cmake +++ b/FindJavaSG.cmake @@ -3,9 +3,9 @@ include(FindJNI) 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) -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} ") diff --git a/FindSimGrid.cmake b/FindSimGrid.cmake index f92b12db5d..220d690eb1 100644 --- a/FindSimGrid.cmake +++ b/FindSimGrid.cmake @@ -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