]> git.mxchange.org Git - simgear.git/blob - simgear/io/CMakeLists.txt
cmake: add option to disable building tests
[simgear.git] / simgear / io / CMakeLists.txt
1
2
3 include (SimGearComponent)
4
5 set(HEADERS
6     iochannel.hxx
7     lowlevel.hxx
8     raw_socket.hxx
9     sg_binobj.hxx
10     sg_file.hxx
11     sg_netBuffer.hxx
12     sg_netChannel.hxx
13     sg_netChat.hxx
14     sg_serial.hxx
15     sg_socket.hxx
16     sg_socket_udp.hxx
17     HTTPClient.hxx
18     HTTPRequest.hxx
19     )
20
21 set(SOURCES
22     iochannel.cxx
23     lowlevel.cxx
24     raw_socket.cxx
25     sg_binobj.cxx
26     sg_file.cxx
27     sg_netBuffer.cxx
28     sg_netChannel.cxx
29     sg_netChat.cxx
30     sg_serial.cxx
31     sg_socket.cxx
32     sg_socket_udp.cxx
33     HTTPClient.cxx
34     HTTPRequest.cxx
35     )
36
37 simgear_component(io io "${SOURCES}" "${HEADERS}")
38
39 if(ENABLE_TESTS)
40 add_executable(test_sock socktest.cxx)
41 target_link_libraries(test_sock sgio sgstructure sgthreads sgdebug
42     ${CMAKE_THREAD_LIBS_INIT}
43     ${WINSOCK_LIBRARY}
44     ${RT_LIBRARY})
45
46 add_executable(test_http test_HTTP.cxx)
47 target_link_libraries(test_http
48     sgio sgstructure sgthreads sgtiming sgmisc sgdebug
49     ${CMAKE_THREAD_LIBS_INIT}
50     ${WINSOCK_LIBRARY}
51     ${RT_LIBRARY})
52
53 add_test(http ${EXECUTABLE_OUTPUT_PATH}/test_http)
54
55 add_executable(httpget httpget.cxx)
56 target_link_libraries(httpget
57     sgio sgstructure sgthreads sgtiming sgmisc sgdebug
58     ${CMAKE_THREAD_LIBS_INIT}
59     ${WINSOCK_LIBRARY}
60     ${RT_LIBRARY})
61
62 add_executable(decode_binobj decode_binobj.cxx)
63 target_link_libraries(decode_binobj
64     sgio sgbucket sgstructure sgthreads sgtiming sgmisc sgdebug
65     ${CMAKE_THREAD_LIBS_INIT}
66     ${WINSOCK_LIBRARY}
67     ${ZLIB_LIBRARY}
68     ${RT_LIBRARY})
69
70 add_executable(test_binobj test_binobj.cxx)
71 target_link_libraries(test_binobj
72     sgio sgbucket sgstructure sgthreads sgtiming sgmisc sgdebug
73     ${CMAKE_THREAD_LIBS_INIT}
74     ${WINSOCK_LIBRARY}
75     ${ZLIB_LIBRARY}
76     ${RT_LIBRARY}) 
77     
78 add_test(binobj ${EXECUTABLE_OUTPUT_PATH}/test_binobj)
79 endif(ENABLE_TESTS)