Refactor/Create APT/DNF Repository (#1648)

This commit is contained in:
Paulchen-Panther
2023-11-16 21:05:56 +01:00
committed by GitHub
parent c9518db597
commit 91270966f9
165 changed files with 1918 additions and 2924 deletions

View File

@@ -1,29 +1,43 @@
# Define the current source locations
set(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/webserver)
set(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/webserver)
file(GLOB_RECURSE webFiles RELATIVE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/assets/webconfig/*)
file(RELATIVE_PATH webConfigPath ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/assets/webconfig)
FILE ( GLOB WebConfig_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
FILE ( GLOB_RECURSE webFiles RELATIVE ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/assets/webconfig/* )
FILE ( RELATIVE_PATH webConfigPath ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/assets/webconfig)
foreach(f ${webFiles})
string(REPLACE "${webConfigPath}/" "" fname ${f})
set(HYPERION_WEBCONFIG_RES "${HYPERION_WEBCONFIG_RES}\n\t\t<file alias=\"/webconfig/${fname}\">${f}</file>")
endforeach()
FOREACH( f ${webFiles} )
STRING ( REPLACE "${webConfigPath}/" "" fname ${f})
SET(HYPERION_WEBCONFIG_RES "${HYPERION_WEBCONFIG_RES}\n\t\t<file alias=\"/webconfig/${fname}\">${f}</file>")
ENDFOREACH()
CONFIGURE_FILE(${CURRENT_SOURCE_DIR}/WebConfig.qrc.in ${CMAKE_BINARY_DIR}/WebConfig.qrc )
SET(WebConfig_RESOURCES ${CMAKE_BINARY_DIR}/WebConfig.qrc)
configure_file(${CMAKE_SOURCE_DIR}/libsrc/webserver/WebConfig.qrc.in ${CMAKE_BINARY_DIR}/WebConfig.qrc)
add_library(webserver
${WebConfig_SOURCES}
${WebConfig_RESOURCES}
${CMAKE_SOURCE_DIR}/include/webserver/WebServer.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/WebServer.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/CgiHandler.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/CgiHandler.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpClientWrapper.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpClientWrapper.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpHeader.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpHeader.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpReply.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpReply.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpRequest.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpRequest.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpServer.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/QtHttpServer.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/StaticFileServing.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/StaticFileServing.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/WebJsonRpc.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/WebJsonRpc.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/WebSocketClient.h
${CMAKE_SOURCE_DIR}/libsrc/webserver/WebSocketClient.cpp
${CMAKE_SOURCE_DIR}/libsrc/webserver/WebSocketUtils.h
${CMAKE_BINARY_DIR}/WebConfig.qrc
)
target_link_libraries(webserver
hyperion
hyperion-utils
hyperion-api
Qt${QT_VERSION_MAJOR}::Network
)
if(ENABLE_MDNS)