File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change @@ -6,14 +6,8 @@ add_library(Core STATIC
66 httpserver.cpp
77 networkaccessmanager.cpp
88 settings.cpp
9-
10- # Show headers without .cpp in Qt Creator.
11- httplib.h
129)
1310
14- # Configure cpp-httplib.
15- add_definitions (-DCPPHTTPLIB_USE_POLL )
16-
1711target_link_libraries (Core Registry Ui )
1812
1913find_package (Qt${QT_VERSION_MAJOR} COMPONENTS Network WebEngineCore Widgets REQUIRED )
@@ -48,6 +42,18 @@ else()
4842 target_link_libraries (Core ${LibArchive_LIBRARIES} )
4943endif ()
5044
45+ # Configure cpp-httplib.
46+ add_definitions (-DCPPHTTPLIB_USE_POLL )
47+
48+ find_package (httplib CONFIG QUIET )
49+ if (httplib_FOUND)
50+ target_link_libraries (Core httplib::httplib )
51+ else ()
52+ # Use bundled version of cpp-httplib if not found.
53+ # TODO: Replace with QHttpServer once Qt 5 is dropped.
54+ include_directories ("${CMAKE_SOURCE_DIR} /src/contrib/cpp-httplib" )
55+ endif ()
56+
5157# Required by cpp-httplib.
5258if (NOT WIN32 )
5359 set (THREADS_PREFER_PTHREAD_FLAG ON )
Original file line number Diff line number Diff line change 2323#include " httpserver.h"
2424
2525#include " application.h"
26- #include " httplib.h"
26+
27+ #include < httplib.h>
2728
2829#include < QLoggingCategory>
2930#include < QRegularExpression>
Original file line number Diff line number Diff line change 11{
22 "$schema" : " https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json" ,
33 "dependencies" : [
4+ {
5+ "name" : " cpp-httplib" ,
6+ "default-features" : false
7+ },
48 {
59 "name" : " libarchive" ,
610 "default-features" : false
You can’t perform that action at this time.
0 commit comments