1 ### This is a template for building targets with simgrid
2 cmake_minimum_required(VERSION 2.8)
4 ### Need to set rc ccompiler before enable language
6 SET(CMAKE_RC_COMPILER "windres")
10 set(CMAKE_C_FLAGS "" CACHE TYPE INTERNAL FORCE)
11 set(CMAKE_EXE_LINKER_FLAGS "" CACHE TYPE INTERNAL FORCE)
13 ###############################
14 # Test the build dependencies #
15 ###############################
16 include(FindPCRE.cmake)
17 message(STATUS "Looking for lib Simgrid")
18 if("$ENV{SIMGRID_ROOT}" STREQUAL "")
19 message(STATUS "Looking for lib Simgrid - Not found")
20 message(FATAL_ERROR "Simgrid not found, reinstall it or set SIMGRID_ROOT")
21 else("$ENV{SIMGRID_ROOT}" STREQUAL "")
22 link_directories($ENV{SIMGRID_ROOT}/lib)
23 include_directories($ENV{SIMGRID_ROOT}/include)
24 include_directories($ENV{SIMGRID_ROOT}/src)
25 include_directories($ENV{SIMGRID_ROOT}/src/include)
26 add_library(libsimgrid STATIC IMPORTED)
27 message(STATUS "Looking for lib Simgrid - found")
28 endif("$ENV{SIMGRID_ROOT}" STREQUAL "")
34 #########################
38 #########################
39 add_executable(HelloWorld HelloWorld.c)
40 # Any targets need to be linked with simgrid and pcre
41 target_link_libraries(HelloWorld simgrid pcre)