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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
diff --git i/CMakeLists.txt w/CMakeLists.txt
index 6afe703..85a089b 100644
--- i/CMakeLists.txt
+++ w/CMakeLists.txt
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.12)
cmake_policy(SET CMP0114 NEW)
cmake_policy(SET CMP0135 NEW)
+cmake_policy(SET CMP0167 NEW)
project(porla)
@@ -9,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_CXX_STANDARD 20)
-include(ExternalAntlr4Cpp)
+# include(ExternalAntlr4Cpp)
include(FetchContent)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static library" FORCE)
@@ -24,7 +25,7 @@ set(ENABLE_ZSTD OFF)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a .lib .so .dll)
set(LINK_WITH_STATIC_LIBRARIES ON CACHE BOOL "Link with static libs" FORCE)
-set(OPENSSL_USE_STATIC_LIBS TRUE)
+set(OPENSSL_USE_STATIC_LIBS FALSE)
# uriparser options
set(URIPARSER_BUILD_DOCS OFF CACHE BOOL "Build docs" FORCE)
@@ -36,22 +37,33 @@ set(URIPARSER_SHARED_LIBS OFF CACHE BOOL "Shared libs" FORCE)
find_package(Boost REQUIRED COMPONENTS log program_options system)
find_package(LibtorrentRasterbar REQUIRED)
find_package(Lua REQUIRED)
-find_package(OpenSSL REQUIRED)
+find_package(OpenSSL REQUIRED COMPONENTS SSL Crypto)
find_package(SQLite3 REQUIRED)
find_package(ZLIB REQUIRED)
-FetchContent_Declare(curl URL https://github.com/curl/curl/archive/refs/tags/curl-8_6_0.tar.gz)
-FetchContent_Declare(jwt-cpp URL https://github.com/Thalhammer/jwt-cpp/archive/refs/tags/v0.7.0.tar.gz)
-FetchContent_Declare(libzip URL https://github.com/nih-at/libzip/archive/refs/tags/v1.10.1.tar.gz)
-FetchContent_Declare(tomlplusplus URL https://github.com/marzer/tomlplusplus/archive/refs/tags/v3.4.0.tar.gz)
-FetchContent_Declare(uriparser URL https://github.com/uriparser/uriparser/archive/refs/tags/uriparser-0.9.7.tar.gz)
+find_package(libzip REQUIRED)
+find_package(tomlplusplus REQUIRED)
+find_package(uriparser REQUIRED)
+set(jwt-cpp_DIR /usr/lib/cmake/)
+find_package(jwt-cpp REQUIRED)
+set(nlohmann-json_DIR /usr/share/cmake/nlohmann_json)
+find_package(nlohmann_json REQUIRED)
+find_package(sol2 REQUIRED)
+find_package(antlr4-runtime REQUIRED)
+
+FetchContent_Declare(curl URL https://github.com/curl/curl/archive/refs/tags/curl-8_10_1.tar.gz)
+# FetchContent_Declare(jwt-cpp URL https://github.com/Thalhammer/jwt-cpp/archive/refs/tags/v0.7.0.tar.gz)
+# FetchContent_Declare(libzip URL https://github.com/nih-at/libzip/archive/refs/tags/v1.10.1.tar.gz)
+# FetchContent_Declare(tomlplusplus URL https://github.com/marzer/tomlplusplus/archive/refs/tags/v3.4.0.tar.gz)
+# FetchContent_Declare(uriparser URL https://github.com/uriparser/uriparser/archive/refs/tags/uriparser-0.9.7.tar.gz)
FetchContent_MakeAvailable(
curl
- jwt-cpp
- libzip
- tomlplusplus
- uriparser)
+ # jwt-cpp
+ # libzip
+ # tomlplusplus
+ # uriparser
+)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/version.cpp
@@ -237,8 +249,10 @@ target_include_directories(
${JWT_CPP_INCLUDE_DIRS}
${LUA_INCLUDE_DIR}
vendor/croncpp/include
- vendor/nlohmann-json/include
- vendor/sol2/include
+ # vendor/nlohmann-json/include
+ ${INTERFACE_INCLUDE_DIRECTORIES}
+ # vendor/sol2/include
+ ${SOL2_INCLUDE_DIRS}
)
target_link_libraries(
@@ -250,6 +264,8 @@ target_link_libraries(
Boost::boost Boost::log Boost::program_options
CURL::libcurl
jwt-cpp::jwt-cpp
+ # nlohmann_json::nlohmann_json
+ # sol2
libzip::zip
lua
sodium
|