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

CMakeLists + FindSimGrid update

parent 12d5c389
......@@ -72,7 +72,7 @@ list(REMOVE_ITEM batsim_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/batexec.cpp)
add_executable(batsim ${batsim_SRC})
# 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})
## Batexec
......@@ -85,7 +85,7 @@ list(REMOVE_ITEM batexec_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/batsim.cpp)
add_executable(batexec ${batexec_SRC})
# 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})
......
# Try fo find Simgrid:
# SIMGRID_FOUND
# SIMGRID_INCLUDE_DIRS
# SIMGRID_LIBRARIES
# SIMGRID_DEFINITIONS
#IF YOU HAVE INSTALL SIMGRID IN A SPECIAL DIRECTORY
#YOU CAN SPECIFY SIMGRID_ROOT
message("-- Looking for simgrid.h")
find_path(SIMGRID_INCLUDE_DIR
NAMES simgrid.h
HINTS ENV SIMGRID_PATH ENV INCLUDE ENV CPATH
PATHS /opt/simgrid /opt/Simgrid
PATH_SUFFIXES include)
message("-- Looking for simgrid.h - ${SIMGRID_INCLUDE_DIR}")
# TO CALL THIS FILE USE
#set(CMAKE_MODULE_PATH
#${CMAKE_MODULE_PATH}
#${CMAKE_HOME_DIRECTORY}/tools/cmake/Modules
#)
message("-- Looking for libsimgrid")
find_library(SIMGRID_LIBRARY
NAMES simgrid
HINTS ENV SIMGRID_PATH ENV LIBRARY_PATH
PATHS /opt/simgrid /opt/Simgrid
PATH_SUFFIXES lib)
message("-- Looking for libsimgrid -- ${SIMGRID_LIBRARY}")
find_library(HAVE_SIMGRID_LIB
NAME simgrid
HINTS
$ENV{LD_LIBRARY_PATH}
$ENV{SIMGRID_ROOT}
PATH_SUFFIXES lib64 lib
PATHS
/opt
/opt/local
/opt/csw
/sw
/usr
)
set(SIMGRID_LIBRARIES ${SIMGRID_LIBRARY} )
set(SIMGRID_INCLUDE_DIRS ${SIMGRID_INCLUDE_DIR} )
find_program(HAVE_TESH
NAMES tesh
HINTS
$ENV{SIMGRID_ROOT}
PATH_SUFFIXES bin
PATHS
/opt
/opt/local
/opt/csw
/sw
/usr
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SimGrid DEFAULT_MSG
SIMGRID_LIBRARY SIMGRID_INCLUDE_DIR)
mark_as_advanced(SIMGRID_INCLUDE_DIR SIMGRID_LIBRARY)
\ No newline at end of file
message(STATUS "Looking for lib SimGrid")
if(HAVE_SIMGRID_LIB)
message(STATUS "Looking for lib SimGrid - found")
get_filename_component(simgrid_version ${HAVE_SIMGRID_LIB} REALPATH)
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