CMakeLists.txt 1.66 KB
Newer Older
1 2
cmake_minimum_required(VERSION 2.8)
#cmake_minimum_required(VERSION 3.0.2)
Olivier Richard's avatar
Olivier Richard committed
3

4 5
project("Batsim")

6 7 8
# C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Olivier Richard's avatar
Olivier Richard committed
9

10 11
# Dependencies
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
12

13 14 15
## SimGrid dependency
find_package(SimGrid REQUIRED)
include_directories(${SIMGRID_INCLUDE_DIR})
Millian Poquet's avatar
Millian Poquet committed
16

17 18 19 20 21 22 23 24 25 26
## Boost dependency
find_package(Boost REQUIRED COMPONENTS system filesystem)
include_directories(${Boost_INCLUDE_DIR})

## Rapidjson dependency
find_package(rapidjson REQUIRED)
include_directories(${RAPIDJSON_INCLUDE_DIRS})


# Executables
27
add_executable(batsim batsim.cpp export.cpp ipp.cpp job_submitter.cpp jobs.cpp jobs_execution.cpp machines.cpp network.cpp profiles.cpp pstate.cpp server.cpp workload.cpp context.hpp export.hpp ipp.hpp job_submitter.hpp jobs.hpp jobs_execution.hpp machines.hpp network.hpp profiles.hpp pstate.hpp server.hpp workload.hpp)
28
#add_executable(batexec batexec.c job.c utils.c export.c)
Olivier Richard's avatar
Olivier Richard committed
29

30 31
# Libraries to link
target_link_libraries(batsim ${SIMGRID_LIBRARIES} ${Boost_SYSTEM_LIBRARY_DEBUG} ${Boost_FILESYSTEM_LIBRARY_DEBUG})
32
#target_link_libraries(batexec simgrid jansson m)
MERCIER Michael's avatar
MERCIER Michael committed
33

34 35

# Installation
MERCIER Michael's avatar
MERCIER Michael committed
36
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/batsim
37
    #${CMAKE_CURRENT_BINARY_DIR}/batexec
MERCIER Michael's avatar
MERCIER Michael committed
38
    DESTINATION bin)
39 40 41 42 43 44


# Extra compiler flags
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
    set_property(TARGET batsim APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -g")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
45
    set_property(TARGET batsim APPEND_STRING PROPERTY COMPILE_FLAGS "-Wall -Wextra -g -std=c++11")
46 47
else()
    message("Compiler is unknown, warnings will NOT be added to it")
48
endif()