Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix make dist.
[simgrid.git] / examples / gras / synchro / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 set_source_files_properties(
4   ${CMAKE_CURRENT_BINARY_DIR}/_synchro_simulator.c
5   ${CMAKE_CURRENT_BINARY_DIR}/_synchro_philosopher.c
6   PROPERTIES GENERATED true)
7
8 set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
9 add_executable(synchro_simulator   ${CMAKE_CURRENT_BINARY_DIR}/_synchro_simulator.c ${CMAKE_CURRENT_SOURCE_DIR}/philosopher.c)
10 add_executable(synchro_philosopher ${CMAKE_CURRENT_BINARY_DIR}/_synchro_philosopher.c ${CMAKE_CURRENT_SOURCE_DIR}/philosopher.c)
11
12 add_custom_command(
13   OUTPUT
14   ${CMAKE_CURRENT_BINARY_DIR}/_synchro_simulator.c
15   ${CMAKE_CURRENT_BINARY_DIR}/_synchro_philosopher.c
16   DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/synchro.xml
17   COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator synchro ${CMAKE_CURRENT_SOURCE_DIR}/synchro.xml
18   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
19   )
20
21 ### Add definitions for compile
22 if(NOT WIN32)
23   target_link_libraries(synchro_simulator simgrid pthread m )
24   target_link_libraries(synchro_philosopher gras pthread m )
25 else()
26   target_link_libraries(synchro_simulator simgrid)
27   target_link_libraries(synchro_philosopher gras)
28 endif()
29
30 set(tesh_files
31   ${tesh_files}
32   ${CMAKE_CURRENT_SOURCE_DIR}/test_rl.tesh
33   ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_32.tesh
34   ${CMAKE_CURRENT_SOURCE_DIR}/test_sg_64.tesh
35   PARENT_SCOPE
36   )
37 set(xml_files
38   ${xml_files}
39   ${CMAKE_CURRENT_SOURCE_DIR}/synchro.xml
40   PARENT_SCOPE
41   )
42 set(examples_src
43   ${examples_src}
44   ${CMAKE_CURRENT_SOURCE_DIR}/philosopher.c
45   PARENT_SCOPE
46   )
47 set(bin_files
48   ${bin_files}
49   PARENT_SCOPE
50   )