IXWebSocket/test/CMakeLists.txt

47 lines
941 B
CMake
Raw Normal View History

2018-12-30 03:33:15 +01:00
#
# Author: Benjamin Sergeant
# Copyright (c) 2018 Machine Zone, Inc. All rights reserved.
#
cmake_minimum_required (VERSION 3.4.1)
project (ixwebsocket_unittest)
set (CMAKE_CXX_STANDARD 11)
2019-01-05 02:28:13 +01:00
if (NOT WIN32)
option(USE_TLS "Add TLS support" ON)
endif()
2018-12-30 03:33:15 +01:00
add_subdirectory(${PROJECT_SOURCE_DIR}/.. ixwebsocket)
include_directories(
${PROJECT_SOURCE_DIR}/Catch2/single_include
)
2019-01-05 23:40:17 +01:00
# Shared sources
set (SOURCES
2018-12-30 03:33:15 +01:00
test_runner.cpp
IXTest.cpp
msgpack11.cpp
2019-01-06 02:02:39 +01:00
IXDNSLookupTest.cpp
IXSocketTest.cpp
2018-12-30 03:33:15 +01:00
)
2019-01-05 23:40:17 +01:00
# Some unittest don't work on windows yet
if (NOT WIN32)
list(APPEND SOURCES
IXWebSocketServerTest.cpp
cmd_websocket_chat.cpp
)
endif()
add_executable(ixwebsocket_unittest ${SOURCES})
2018-12-30 03:33:15 +01:00
if (APPLE AND USE_TLS)
target_link_libraries(ixwebsocket_unittest "-framework foundation" "-framework security")
endif()
target_link_libraries(ixwebsocket_unittest ixwebsocket)
install(TARGETS ixwebsocket_unittest DESTINATION bin)