1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
cmake_minimum_required(VERSION 3.16)
project(wsserver LANGUAGES CXX)
set(CMAKE_AUTOMOC ON)
if(NOT DEFINED INSTALL_EXAMPLESDIR)
set(INSTALL_EXAMPLESDIR "examples")
endif()
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/remoteobjects/websockets/wsserver")
find_package(Qt6 REQUIRED COMPONENTS Core Gui RemoteObjects WebSockets Widgets)
qt_add_executable(wsserver
../common/websocketiodevice.cpp ../common/websocketiodevice.h
main.cpp
)
set_target_properties(wsserver PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE FALSE
)
target_include_directories(wsserver PUBLIC
../common
)
target_link_libraries(wsserver PUBLIC
Qt::Core
Qt::Gui
Qt::RemoteObjects
Qt::WebSockets
Qt::Widgets
)
# Resources:
set(cert_resource_files
"../common/cert/client.crt"
"../common/cert/client.key"
"../common/cert/rootCA.key"
"../common/cert/rootCA.pem"
"../common/cert/rootCA.srl"
"../common/cert/server.crt"
"../common/cert/server.key"
)
qt6_add_resources(wsserver "cert"
PREFIX
"/sslcert"
BASE
"../common/cert"
FILES
${cert_resource_files}
)
install(TARGETS wsserver
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
|