# 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")
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} ")
PATH_SUFFIXES lib
)
-find_path(HAVE_MSG_H msg.h
+find_path(SIMGRID_INCLUDES msg.h
HINTS
$ENV{SIMGRID_ROOT}
PATH_SUFFIXES include
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