Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
9d63f38ad88746c0881d29264e45d46d8cfa34ab
[simgrid.git] / teshsuite / gras / numerous_rpc / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_simulator.c
4                                                         ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_client.c
5                                                         ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_server.c
6                                                         PROPERTIES GENERATED true)
7
8 set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
9
10 add_executable(numerous_rpc_client    ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.c
11                                       ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_client.c)
12 add_executable(numerous_rpc_server    ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.c
13                                       ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_server.c)
14
15 add_custom_command(OUTPUT            ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_server.c
16                                      ${CMAKE_CURRENT_BINARY_DIR}/_numerous_rpc_client.c
17                    DEPENDS           gras_stub_generator ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.xml
18                    COMMAND           ${CMAKE_BINARY_DIR}/bin/gras_stub_generator numerous_rpc ${CMAKE_CURRENT_SOURCE_DIR}/numerous_rpc.xml
19                    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
20 )
21
22 ### Add definitions for compile
23 if(NOT WIN32)
24   target_link_libraries(numerous_rpc_client gras m pthread )
25   target_link_libraries(numerous_rpc_server gras m pthread )
26 else(NOT WIN32)
27   target_link_libraries(numerous_rpc_client gras)
28   target_link_libraries(numerous_rpc_server gras)
29 endif(NOT WIN32)