Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
batsim
batsim
Commits
125d64ed
Commit
125d64ed
authored
Sep 22, 2016
by
Millian Poquet
Browse files
CMakeLists + FindSimGrid update
parent
12d5c389
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
125d64ed
...
@@ -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_LIB
RARIES
}
${
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_LIB
RARIES
}
${
Boost_SYSTEM_LIBRARY_DEBUG
}
target_link_libraries
(
batexec
${
HAVE_
SIMGRID_LIB
}
${
Boost_SYSTEM_LIBRARY_DEBUG
}
${
Boost_FILESYSTEM_LIBRARY_DEBUG
}
)
${
Boost_FILESYSTEM_LIBRARY_DEBUG
}
)
...
...
cmake/Modules/FindSimGrid.cmake
View file @
125d64ed
# 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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment