Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The HelloWorld works on windows.
[simgrid.git] / doc / HelloWorld / CMakeLists.txt
1 ### This is a template for building targets with simgrid
2 cmake_minimum_required(VERSION 2.8)
3
4 ### Need to set rc ccompiler before enable language
5 if(WIN32)
6     SET(CMAKE_RC_COMPILER "windres")
7 endif(WIN32)
8
9 project(HelloWorld C)
10 set(CMAKE_C_FLAGS "" CACHE TYPE INTERNAL FORCE)
11 set(CMAKE_EXE_LINKER_FLAGS "" CACHE TYPE INTERNAL FORCE)
12
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 "")
29
30 ###########
31 # TARGETS #
32 ###########
33
34 #########################
35 # add_executable        #
36 #    args1 target name  #
37 #    args2 sources      #
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)