CMakeLists.txt 875 Bytes
Newer Older
1
cmake_minimum_required(VERSION 3.0.2)
Olivier Richard's avatar
Olivier Richard committed
2

3
4
project("Batsim")

Olivier Richard's avatar
Olivier Richard committed
5
6
set(CMAKE_BUILD_TYPE Debug)

7
8
9
10
11
12
13
# 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)
14
	message(STATUS "The compiler ${CMAKE_C_COMPILER} has no C11 support. Using C99 instead.")
15
16
	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
else()
17
        message(STATUS "The compiler ${CMAKE_C_COMPILER} has no C11 nor C99 support. Please update your C compiler.")
18
19
20
21
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
22
23

### Add definitions for compile
24
25
target_link_libraries(batsim simgrid jansson m)
target_link_libraries(batexec simgrid jansson m)