Commit 2fd7f66b authored by Millian Poquet's avatar Millian Poquet
Browse files

CMake update to match the new SimGrid version

parent 0ee41e1e
...@@ -81,7 +81,7 @@ file(GLOB batsim_SRC ...@@ -81,7 +81,7 @@ file(GLOB batsim_SRC
add_executable(batsim ${batsim_SRC}) add_executable(batsim ${batsim_SRC})
# Libraries to link # Libraries to link
target_link_libraries(batsim ${SIMGRID_LIBRARIES} target_link_libraries(batsim ${SIMGRID_LIBRARY}
${Boost_FILESYSTEM_LIBRARY_DEBUG} ${Boost_FILESYSTEM_LIBRARY_DEBUG}
${Boost_LOCALE_LIBRARY_DEBUG} ${Boost_LOCALE_LIBRARY_DEBUG}
${Boost_REGEX_LIBRARY_DEBUG} ${Boost_REGEX_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()
Supports Markdown
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