Switch over to more modern unix sharedmemory API (requested by fatbob)
[umurmur.git] / shm_utils / umurmurd-websocket / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2 project(uMurmurd-Websocket)
3
4         macro(create_test_app TEST_NAME MAIN_SRC)
5                 
6                 set(TEST_SRCS ${MAIN_SRC})
7                 set(TEST_HDR)
8
9                 source_group("Headers Private"   FILES ${TEST_HDR})
10                 source_group("Sources"   FILES ${TEST_SRCS})
11                 add_executable(${TEST_NAME} ${TEST_SRCS} ${TEST_HDR})
12                 
13                 if (LWS_LINK_TESTAPPS_DYNAMIC)
14                         target_link_libraries(${TEST_NAME} websockets_shared)
15                         add_dependencies(${TEST_NAME} websockets_shared)
16                 else(LWS_LINK_TESTAPPS_DYNAMIC)
17                         target_link_libraries(${TEST_NAME} websockets)
18                         add_dependencies(${TEST_NAME} websockets)
19                 endif(LWS_LINK_TESTAPPS_DYNAMIC)
20
21                 # Set test app specific defines.
22                 set_property(TARGET ${TEST_NAME}
23                                         PROPERTY COMPILE_DEFINITIONS 
24                                                 INSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/share"
25                                         )
26
27                 # Prefix the binary names with libwebsockets.
28                 #set_target_properties(${TEST_NAME} 
29                 #       PROPERTIES
30                         #OUTPUT_NAME libwebsockets-${TEST_NAME})
31
32                 # Add to the list of tests.
33                 list(APPEND TEST_APP_LIST ${TEST_NAME})
34         endmacro()
35
36
37
38 create_test_app(uMurmurd-Websocket "src/uMurmurd_Websocket.c")
39
40 FIND_LIBRARY(JANSSON_LIBRARY jansson)
41 TARGET_LINK_LIBRARIES(uMurmurd-Websocket ${JANSSON_LIBRARY})