IXWebSocket/test/CMakeLists.txt

48 lines
988 B
CMake
Raw Normal View History

2018-12-29 18:33:15 -08: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-04 17:28:13 -08:00
if (NOT WIN32)
option(USE_TLS "Add TLS support" ON)
endif()
2018-12-29 18:33:15 -08:00
add_subdirectory(${PROJECT_SOURCE_DIR}/.. ixwebsocket)
include_directories(
${PROJECT_SOURCE_DIR}/Catch2/single_include
)
2019-01-05 14:40:17 -08:00
# Shared sources
set (SOURCES
2018-12-29 18:33:15 -08:00
test_runner.cpp
IXTest.cpp
msgpack11.cpp
2019-01-05 17:02:39 -08:00
IXDNSLookupTest.cpp
IXSocketTest.cpp
2018-12-29 18:33:15 -08:00
)
2019-01-05 14:40:17 -08:00
# Some unittest don't work on windows yet
if (NOT WIN32)
list(APPEND SOURCES
IXWebSocketServerTest.cpp
cmd_websocket_chat.cpp
2019-01-06 15:14:13 -08:00
IXWebSocketTestConnectionDisconnection.cpp
2019-01-05 14:40:17 -08:00
)
endif()
add_executable(ixwebsocket_unittest ${SOURCES})
2018-12-29 18:33:15 -08: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)