Replace socket_handler::fill_buffer() recursion with loop (#8389)
[libt2n] / examples / CMakeLists.txt
1 # Sources
2 set(libminimalistic_client_SOURCES
3     minimalistic-stub.hxx
4     minimalistic-stub-once.hxx
5     minimalistic-client-stub.hxx
6     minimalistic-client-stub.cpp
7 )
8 set(minimalistic_client_SOURCES
9     minimalistic-client.cpp
10 )
11 set(minimalistic_server_SOURCES
12     minimalistic-server.cpp
13     minimalistic-server-stub.cpp
14 )
15 include_directories(
16     BEFORE
17     ${CMAKE_SOURCE_DIR}/src
18     ${CMAKE_CURRENT_SOURCE_DIR}
19 )
20
21 # Libraries
22 add_library(libminimalistic_client STATIC ${libminimalistic_client_SOURCES})
23 set_target_properties(libminimalistic_client PROPERTIES OUTPUT_NAME minimalistic_client)
24
25 # Executables
26 add_executable(minimalistic_client ${minimalistic_client_SOURCES})
27 add_executable(minimalistic_server ${minimalistic_server_SOURCES})
28
29 # Dependencies
30 target_link_libraries(minimalistic_client libt2n ${Boost_SERIALIZATION_LIBRARIES} libminimalistic_client)
31 target_link_libraries(minimalistic_server libt2n ${Boost_SERIALIZATION_LIBRARIES})
32
33 # Generation of minimalistic-server.xml
34 get_property(gcc_include_dirs
35     DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
36     PROPERTY INCLUDE_DIRECTORIES
37 )
38 foreach(gcc_include_dir ${gcc_include_dirs})
39     set(gccxml_include_dirs "${gccxml_include_dirs} -I${gcc_include_dir}")
40 endforeach()
41 add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.xml
42     COMMAND ${CMAKE_SOURCE_DIR}/libt2n-gccxml.sh ${gccxml_include_dirs} ${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.cpp -fxml=${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.xml
43     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/minimalistic-server.cpp
44 )