1 cmake_minimum_required(VERSION 2.6)
2 project(uMurmurd-Websocket)
4 macro(create_test_app TEST_NAME MAIN_SRC)
6 set(TEST_SRCS ${MAIN_SRC})
9 source_group("Headers Private" FILES ${TEST_HDR})
10 source_group("Sources" FILES ${TEST_SRCS})
11 add_executable(${TEST_NAME} ${TEST_SRCS} ${TEST_HDR})
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)
21 # Set test app specific defines.
22 set_property(TARGET ${TEST_NAME}
23 PROPERTY COMPILE_DEFINITIONS
24 INSTALL_DATADIR="${CMAKE_INSTALL_PREFIX}/share"
27 # Prefix the binary names with libwebsockets.
28 #set_target_properties(${TEST_NAME}
30 #OUTPUT_NAME libwebsockets-${TEST_NAME})
32 # Add to the list of tests.
33 list(APPEND TEST_APP_LIST ${TEST_NAME})
38 create_test_app(uMurmurd-Websocket "src/uMurmurd_Websocket.c")
40 FIND_LIBRARY(JANSSON_LIBRARY jansson)
41 TARGET_LINK_LIBRARIES(uMurmurd-Websocket ${JANSSON_LIBRARY})