Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge back master branch
[simgrid.git] / examples / gras / ping / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_ping_simulator.c
4                                                         ${CMAKE_CURRENT_BINARY_DIR}/_ping_client.c 
5                                                         ${CMAKE_CURRENT_BINARY_DIR}/_ping_server.c
6                             PROPERTIES GENERATED true)
7
8 set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
9
10 add_executable(ping_simulator   ${CMAKE_CURRENT_BINARY_DIR}/_ping_simulator.c
11                                                                 ${CMAKE_CURRENT_SOURCE_DIR}/ping_server.c
12                                                                 ${CMAKE_CURRENT_SOURCE_DIR}/ping_client.c
13                                                                 ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c)
14 add_executable(ping_client      ${CMAKE_CURRENT_BINARY_DIR}/_ping_client.c
15                                                                 ${CMAKE_CURRENT_SOURCE_DIR}/ping_client.c
16                                                                 ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c)
17 add_executable(ping_server      ${CMAKE_CURRENT_BINARY_DIR}/_ping_server.c
18                                                                 ${CMAKE_CURRENT_SOURCE_DIR}/ping_server.c
19                                                                 ${CMAKE_CURRENT_SOURCE_DIR}/ping_common.c)
20 add_custom_command(
21                                         OUTPUT  ${CMAKE_CURRENT_BINARY_DIR}/_ping_simulator.c 
22                                                 ${CMAKE_CURRENT_BINARY_DIR}/_ping_client.c 
23                                                         ${CMAKE_CURRENT_BINARY_DIR}/_ping_server.c
24                                         DEPENDS gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/ping.xml
25                                         COMMAND ${CMAKE_BINARY_DIR}/bin/gras_stub_generator ping ${CMAKE_CURRENT_SOURCE_DIR}/ping.xml
26                     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
27                                         )
28
29 ### Add definitions for compile
30 if(NOT WIN32)
31 target_link_libraries(ping_simulator simgrid pthread m )
32 target_link_libraries(ping_client gras pthread m )
33 target_link_libraries(ping_server gras pthread m )
34 else(NOT WIN32)
35 target_link_libraries(ping_simulator simgrid)
36 target_link_libraries(ping_client gras)
37 target_link_libraries(ping_server gras)
38 endif(NOT WIN32)