From a3c87a0e44bb67cc3f726dd915178f9f307480e8 Mon Sep 17 00:00:00 2001 From: Maurice Kalinowski Date: Mon, 16 Sep 2019 14:22:07 +0200 Subject: Add initial-support for cmake Task-number: QTBUG-78180 Change-Id: If6cf82c61d605332402feffca9bde2ea0dd6e313 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- examples/CMakeLists.txt | 7 ++++ examples/websockets/CMakeLists.txt | 13 ++++++ examples/websockets/echoclient/CMakeLists.txt | 30 ++++++++++++++ examples/websockets/echoserver/CMakeLists.txt | 28 +++++++++++++ .../websockets/qmlwebsocketclient/CMakeLists.txt | 46 ++++++++++++++++++++++ .../websockets/qmlwebsocketserver/CMakeLists.txt | 46 ++++++++++++++++++++++ examples/websockets/simplechat/CMakeLists.txt | 28 +++++++++++++ examples/websockets/sslechoclient/CMakeLists.txt | 28 +++++++++++++ examples/websockets/sslechoserver/CMakeLists.txt | 42 ++++++++++++++++++++ 9 files changed, 268 insertions(+) create mode 100644 examples/CMakeLists.txt create mode 100644 examples/websockets/CMakeLists.txt create mode 100644 examples/websockets/echoclient/CMakeLists.txt create mode 100644 examples/websockets/echoserver/CMakeLists.txt create mode 100644 examples/websockets/qmlwebsocketclient/CMakeLists.txt create mode 100644 examples/websockets/qmlwebsocketserver/CMakeLists.txt create mode 100644 examples/websockets/simplechat/CMakeLists.txt create mode 100644 examples/websockets/sslechoclient/CMakeLists.txt create mode 100644 examples/websockets/sslechoserver/CMakeLists.txt (limited to 'examples') diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..cc356de --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from examples.pro. + +qt_examples_build_begin() + +add_subdirectory(websockets) + +qt_examples_build_end() diff --git a/examples/websockets/CMakeLists.txt b/examples/websockets/CMakeLists.txt new file mode 100644 index 0000000..196d6a1 --- /dev/null +++ b/examples/websockets/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from websockets.pro. + +add_subdirectory(echoclient) +add_subdirectory(echoserver) +add_subdirectory(simplechat) +if(TARGET Qt::Quick) + add_subdirectory(qmlwebsocketclient) + add_subdirectory(qmlwebsocketserver) +endif() +if(QT_FEATURE_ssl) + add_subdirectory(sslechoserver) + add_subdirectory(sslechoclient) +endif() diff --git a/examples/websockets/echoclient/CMakeLists.txt b/examples/websockets/echoclient/CMakeLists.txt new file mode 100644 index 0000000..ae0df62 --- /dev/null +++ b/examples/websockets/echoclient/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from echoclient.pro. + +cmake_minimum_required(VERSION 3.14) +project(echoclient LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS WebSockets) + +add_executable(echoclient + echoclient.cpp echoclient.h + main.cpp +) +target_link_libraries(echoclient PUBLIC + Qt::Core + Qt::WebSockets +) + +install(TARGETS echoclient + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/websockets/echoserver/CMakeLists.txt b/examples/websockets/echoserver/CMakeLists.txt new file mode 100644 index 0000000..3b7e3ce --- /dev/null +++ b/examples/websockets/echoserver/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from echoserver.pro. + +cmake_minimum_required(VERSION 3.14) +project(echoserver LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS WebSockets) + +add_executable(echoserver + echoserver.cpp echoserver.h + main.cpp +) +target_link_libraries(echoserver PUBLIC + Qt::WebSockets +) + +install(TARGETS echoserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/websockets/qmlwebsocketclient/CMakeLists.txt b/examples/websockets/qmlwebsocketclient/CMakeLists.txt new file mode 100644 index 0000000..bad5143 --- /dev/null +++ b/examples/websockets/qmlwebsocketclient/CMakeLists.txt @@ -0,0 +1,46 @@ +# Generated from qmlwebsocketclient.pro. + +cmake_minimum_required(VERSION 3.14) +project(qmlwebsocketclient LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS WebSockets) + +add_qt_gui_executable(qmlwebsocketclient + main.cpp +) +target_link_libraries(qmlwebsocketclient PUBLIC + Qt::Core + Qt::Gui + Qt::Quick + Qt::WebSockets +) + +# Resources: +set(data_resource_files + "qml/qmlwebsocketclient/main.qml" +) + +QT6_ADD_RESOURCES(qmlwebsocketclient "data" + PREFIX + "/" + FILES + ${data_resource_files} +) + + +install(TARGETS qmlwebsocketclient + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/websockets/qmlwebsocketserver/CMakeLists.txt b/examples/websockets/qmlwebsocketserver/CMakeLists.txt new file mode 100644 index 0000000..f7a196b --- /dev/null +++ b/examples/websockets/qmlwebsocketserver/CMakeLists.txt @@ -0,0 +1,46 @@ +# Generated from qmlwebsocketserver.pro. + +cmake_minimum_required(VERSION 3.14) +project(qmlwebsocketserver LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS WebSockets) + +add_qt_gui_executable(qmlwebsocketserver + main.cpp +) +target_link_libraries(qmlwebsocketserver PUBLIC + Qt::Core + Qt::Gui + Qt::Quick + Qt::WebSockets +) + +# Resources: +set(data_resource_files + "qml/qmlwebsocketserver/main.qml" +) + +QT6_ADD_RESOURCES(qmlwebsocketserver "data" + PREFIX + "/" + FILES + ${data_resource_files} +) + + +install(TARGETS qmlwebsocketserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/websockets/simplechat/CMakeLists.txt b/examples/websockets/simplechat/CMakeLists.txt new file mode 100644 index 0000000..367913f --- /dev/null +++ b/examples/websockets/simplechat/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from simplechat.pro. + +cmake_minimum_required(VERSION 3.14) +project(chatserver LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS WebSockets) + +add_executable(chatserver + chatserver.cpp chatserver.h + main.cpp +) +target_link_libraries(chatserver PUBLIC + Qt::WebSockets +) + +install(TARGETS chatserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/websockets/sslechoclient/CMakeLists.txt b/examples/websockets/sslechoclient/CMakeLists.txt new file mode 100644 index 0000000..039619c --- /dev/null +++ b/examples/websockets/sslechoclient/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from sslechoclient.pro. + +cmake_minimum_required(VERSION 3.14) +project(sslechoclient LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS WebSockets) + +add_executable(sslechoclient + main.cpp + sslechoclient.cpp sslechoclient.h +) +target_link_libraries(sslechoclient PUBLIC + Qt::WebSockets +) + +install(TARGETS sslechoclient + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/websockets/sslechoserver/CMakeLists.txt b/examples/websockets/sslechoserver/CMakeLists.txt new file mode 100644 index 0000000..788aa6d --- /dev/null +++ b/examples/websockets/sslechoserver/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from sslechoserver.pro. + +cmake_minimum_required(VERSION 3.14) +project(sslechoserver LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS WebSockets) + +add_executable(sslechoserver + main.cpp + sslechoserver.cpp sslechoserver.h +) +target_link_libraries(sslechoserver PUBLIC + Qt::WebSockets +) + +# Resources: +set(securesocketclient_resource_files + "localhost.cert" + "localhost.key" +) + +QT6_ADD_RESOURCES(sslechoserver "securesocketclient" + PREFIX + "/" + FILES + ${securesocketclient_resource_files} +) + + +install(TARGETS sslechoserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) -- cgit v1.2.1