CMakeLists.txt 950 Bytes
Newer Older
1
2
#cmake_minimum_required(VERSION 2.8)
#Do we really need of 3.0.2 version ?
3
cmake_minimum_required(VERSION 3.0.2)
Olivier Richard's avatar
Olivier Richard committed
4

5
6
project("Batsim")

Olivier Richard's avatar
Olivier Richard committed
7
8
set(CMAKE_BUILD_TYPE Debug)

9
10
11
12
13
14
15
# Enable C11 or at least C99
include(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG("-std=c11" COMPILER_SUPPORTS_C11)
CHECK_C_COMPILER_FLAG("-std=c99" COMPILER_SUPPORTS_C99)
if(COMPILER_SUPPORTS_C11)
	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
elseif(COMPILER_SUPPORTS_C99)
16
	message(STATUS "The compiler ${CMAKE_C_COMPILER} has no C11 support. Using C99 instead.")
17
18
	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
else()
19
        message(STATUS "The compiler ${CMAKE_C_COMPILER} has no C11 nor C99 support. Please update your C compiler.")
20
21
22
23
endif()

add_executable(batsim batsim.c job.c utils.c export.c)
add_executable(batexec batexec.c job.c utils.c export.c)
Olivier Richard's avatar
Olivier Richard committed
24
25

### Add definitions for compile
26
27
target_link_libraries(batsim simgrid jansson m)
target_link_libraries(batexec simgrid jansson m)