diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 160eb7d..bfb555f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -2,10 +2,5 @@ find_package(Qt5Widgets 5.1) set(EXAMPLES_INSTALL_DIR lib/qhttpengine/examples) -add_subdirectory(chat) - -if(Qt5Widgets_FOUND) - add_subdirectory(fileserver) -else() - message(WARNING "Qt5Widgets not found, GUI examples will not be built") -endif() +add_subdirectory(chatserver) +add_subdirectory(fileserver) diff --git a/examples/chat/CMakeLists.txt b/examples/chat/CMakeLists.txt deleted file mode 100644 index 4cfcd50..0000000 --- a/examples/chat/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -set(SRC - apihandler.cpp - main.cpp -) - -qt5_add_resources(QRC resources.qrc) - -add_executable(chat ${SRC} ${QRC}) -target_link_libraries(chat qhttpengine) - -set_target_properties(chat PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}" -) - -install(TARGETS chat - RUNTIME DESTINATION ${EXAMPLES_INSTALL_DIR}/chat -) - -install(FILES ${SRC} - DESTINATION ${EXAMPLES_INSTALL_DIR}/chat -) diff --git a/examples/chatserver/CMakeLists.txt b/examples/chatserver/CMakeLists.txt new file mode 100644 index 0000000..3868266 --- /dev/null +++ b/examples/chatserver/CMakeLists.txt @@ -0,0 +1,21 @@ +set(SRC + apihandler.cpp + main.cpp +) + +qt5_add_resources(QRC resources.qrc) + +add_executable(chatserver ${SRC} ${QRC}) +target_link_libraries(chatserver qhttpengine) + +set_target_properties(chatserver PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}" +) + +install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DESTINATION "${EXAMPLES_INSTALL_DIR}" +) + +install(TARGETS chatserver + RUNTIME DESTINATION "${EXAMPLES_INSTALL_DIR}/chatserver" +) diff --git a/examples/chat/apihandler.cpp b/examples/chatserver/apihandler.cpp similarity index 100% rename from examples/chat/apihandler.cpp rename to examples/chatserver/apihandler.cpp diff --git a/examples/chat/apihandler.h b/examples/chatserver/apihandler.h similarity index 100% rename from examples/chat/apihandler.h rename to examples/chatserver/apihandler.h diff --git a/examples/chat/main.cpp b/examples/chatserver/main.cpp similarity index 100% rename from examples/chat/main.cpp rename to examples/chatserver/main.cpp diff --git a/examples/chat/resources.qrc b/examples/chatserver/resources.qrc similarity index 100% rename from examples/chat/resources.qrc rename to examples/chatserver/resources.qrc diff --git a/examples/chat/static/css/style.css b/examples/chatserver/static/css/style.css similarity index 100% rename from examples/chat/static/css/style.css rename to examples/chatserver/static/css/style.css diff --git a/examples/chat/static/index.html b/examples/chatserver/static/index.html similarity index 100% rename from examples/chat/static/index.html rename to examples/chatserver/static/index.html diff --git a/examples/chat/static/js/chat.js b/examples/chatserver/static/js/chat.js similarity index 100% rename from examples/chat/static/js/chat.js rename to examples/chatserver/static/js/chat.js diff --git a/examples/chat/static/js/jquery.min.js b/examples/chatserver/static/js/jquery.min.js similarity index 100% rename from examples/chat/static/js/jquery.min.js rename to examples/chatserver/static/js/jquery.min.js