Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add working directory to command line for generating files with gras_stub_generator
[simgrid.git] / examples / gras / synchro / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_synchro_simulator.c
4                                                         ${CMAKE_CURRENT_BINARY_DIR}/_synchro_philosopher.c
5                                                         PROPERTIES GENERATED true)
6
7 set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
8
9 add_executable(synchro_simulator        ${CMAKE_CURRENT_BINARY_DIR}/_synchro_simulator.c
10                                                                         ${CMAKE_CURRENT_SOURCE_DIR}/philosopher.c)
11 add_executable(synchro_philosopher      ${CMAKE_CURRENT_BINARY_DIR}/_synchro_philosopher.c 
12                                                                         ${CMAKE_CURRENT_SOURCE_DIR}/philosopher.c)
13
14 add_custom_command(
15                                         OUTPUT  ${CMAKE_CURRENT_BINARY_DIR}/_synchro_simulator.c
16                                                         ${CMAKE_CURRENT_BINARY_DIR}/_synchro_philosopher.c
17                                         DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/synchro.xml
18                                         COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator synchro ${CMAKE_CURRENT_SOURCE_DIR}/synchro.xml
19                     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
20                                         )
21
22 ### Add definitions for compile
23 if(NOT WIN32)
24 target_link_libraries(synchro_simulator simgrid pthread m )
25 target_link_libraries(synchro_philosopher gras pthread m )
26 else(NOT WIN32)
27 target_link_libraries(synchro_simulator simgrid)
28 target_link_libraries(synchro_philosopher gras)
29 endif(NOT WIN32)
30