Commit 125d64ed authored by Millian Poquet's avatar Millian Poquet
Browse files

CMakeLists + FindSimGrid update

parent 12d5c389
...@@ -65,14 +65,14 @@ include_directories(${RAPIDJSON_INCLUDE_DIRS}) ...@@ -65,14 +65,14 @@ include_directories(${RAPIDJSON_INCLUDE_DIRS})
file(GLOB batsim_SRC file(GLOB batsim_SRC
"src/*.hpp" "src/*.hpp"
"src/*.cpp") "src/*.cpp")
list(REMOVE_ITEM batsim_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/batexec.cpp) list(REMOVE_ITEM batsim_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/batexec.cpp)
# Executables # Executables
add_executable(batsim ${batsim_SRC}) add_executable(batsim ${batsim_SRC})
# Libraries to link # Libraries to link
target_link_libraries(batsim ${SIMGRID_LIBRARIES} ${Boost_SYSTEM_LIBRARY_DEBUG} target_link_libraries(batsim ${HAVE_SIMGRID_LIB} ${Boost_SYSTEM_LIBRARY_DEBUG}
${Boost_FILESYSTEM_LIBRARY_DEBUG}) ${Boost_FILESYSTEM_LIBRARY_DEBUG})
## Batexec ## Batexec
...@@ -80,12 +80,12 @@ file(GLOB batexec_SRC ...@@ -80,12 +80,12 @@ file(GLOB batexec_SRC
"src/*.hpp" "src/*.hpp"
"src/*.cpp") "src/*.cpp")
list(REMOVE_ITEM batexec_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/batsim.cpp) list(REMOVE_ITEM batexec_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/batsim.cpp)
# Executables # Executables
add_executable(batexec ${batexec_SRC}) add_executable(batexec ${batexec_SRC})
# Libraries to link # Libraries to link
target_link_libraries(batexec ${SIMGRID_LIBRARIES} ${Boost_SYSTEM_LIBRARY_DEBUG} target_link_libraries(batexec ${HAVE_SIMGRID_LIB} ${Boost_SYSTEM_LIBRARY_DEBUG}
${Boost_FILESYSTEM_LIBRARY_DEBUG}) ${Boost_FILESYSTEM_LIBRARY_DEBUG})
......
# Try fo find Simgrid: #IF YOU HAVE INSTALL SIMGRID IN A SPECIAL DIRECTORY
# SIMGRID_FOUND #YOU CAN SPECIFY SIMGRID_ROOT
# SIMGRID_INCLUDE_DIRS
# SIMGRID_LIBRARIES
# SIMGRID_DEFINITIONS
message("-- Looking for simgrid.h") # TO CALL THIS FILE USE
find_path(SIMGRID_INCLUDE_DIR #set(CMAKE_MODULE_PATH
NAMES simgrid.h #${CMAKE_MODULE_PATH}
HINTS ENV SIMGRID_PATH ENV INCLUDE ENV CPATH #${CMAKE_HOME_DIRECTORY}/tools/cmake/Modules
PATHS /opt/simgrid /opt/Simgrid #)
PATH_SUFFIXES include)
message("-- Looking for simgrid.h - ${SIMGRID_INCLUDE_DIR}")
message("-- Looking for libsimgrid") find_library(HAVE_SIMGRID_LIB
find_library(SIMGRID_LIBRARY NAME simgrid
NAMES simgrid HINTS
HINTS ENV SIMGRID_PATH ENV LIBRARY_PATH $ENV{LD_LIBRARY_PATH}
PATHS /opt/simgrid /opt/Simgrid $ENV{SIMGRID_ROOT}
PATH_SUFFIXES lib) PATH_SUFFIXES lib64 lib
message("-- Looking for libsimgrid -- ${SIMGRID_LIBRARY}") PATHS
/opt
/opt/local
/opt/csw
/sw
/usr
)
set(SIMGRID_LIBRARIES ${SIMGRID_LIBRARY} ) find_program(HAVE_TESH
set(SIMGRID_INCLUDE_DIRS ${SIMGRID_INCLUDE_DIR} ) NAMES tesh
HINTS
$ENV{SIMGRID_ROOT}
PATH_SUFFIXES bin
PATHS
/opt
/opt/local
/opt/csw
/sw
/usr
)
include(FindPackageHandleStandardArgs) message(STATUS "Looking for lib SimGrid")
find_package_handle_standard_args(SimGrid DEFAULT_MSG if(HAVE_SIMGRID_LIB)
SIMGRID_LIBRARY SIMGRID_INCLUDE_DIR) message(STATUS "Looking for lib SimGrid - found")
mark_as_advanced(SIMGRID_INCLUDE_DIR SIMGRID_LIBRARY) get_filename_component(simgrid_version ${HAVE_SIMGRID_LIB} REALPATH)
\ No newline at end of file string(REPLACE "${HAVE_SIMGRID_LIB}." "" simgrid_version "${simgrid_version}")
string(REGEX MATCH "^[0-9]" SIMGRID_MAJOR_VERSION "${simgrid_version}")
string(REGEX MATCH "^[0-9].[0-9]" SIMGRID_MINOR_VERSION "${simgrid_version}")
string(REGEX MATCH "^[0-9].[0-9].[0-9]" SIMGRID_PATCH_VERSION "${simgrid_version}")
string(REGEX REPLACE "^${SIMGRID_MINOR_VERSION}." "" SIMGRID_PATCH_VERSION "${SIMGRID_PATCH_VERSION}")
string(REGEX REPLACE "^${SIMGRID_MAJOR_VERSION}." "" SIMGRID_MINOR_VERSION "${SIMGRID_MINOR_VERSION}")
message(STATUS "Simgrid version : ${SIMGRID_MAJOR_VERSION}.${SIMGRID_MINOR_VERSION}")
else()
message(STATUS "Looking for lib SimGrid - not found")
endif()
if(HAVE_TESH)
message(STATUS "Found Tesh: ${HAVE_TESH}")
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment