2020-11-30 10:36:22 -08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2024-12-19 18:14:19 +00:00
|
|
|
index 861c27c..d2701ce 100644
|
2020-11-30 10:36:22 -08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2024-12-19 18:14:19 +00:00
|
|
|
@@ -80,8 +80,6 @@ option(ENABLE_NETSSL_WIN "Enable NetSSL Windows" OFF)
|
2020-11-30 10:36:22 -08:00
|
|
|
|
|
|
|
if(ENABLE_CRYPTO OR ENABLE_NETSSL OR ENABLE_JWT)
|
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
-else()
|
|
|
|
- find_package(OpenSSL)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(OPENSSL_FOUND)
|
2024-12-19 18:14:19 +00:00
|
|
|
@@ -111,24 +109,19 @@ else()
|
2022-11-30 04:08:08 +08:00
|
|
|
option(ENABLE_APACHECONNECTOR "Enable ApacheConnector" OFF)
|
|
|
|
endif()
|
2020-11-30 10:36:22 -08:00
|
|
|
|
2022-11-30 04:08:08 +08:00
|
|
|
-if(ENABLE_DATA_MYSQL)
|
|
|
|
- find_package(MySQL REQUIRED)
|
2020-11-30 10:36:22 -08:00
|
|
|
-else()
|
|
|
|
- find_package(MySQL)
|
2022-11-30 04:08:08 +08:00
|
|
|
-endif()
|
2020-11-30 10:36:22 -08:00
|
|
|
+option(ENABLE_DATA "Enable Data" OFF)
|
|
|
|
+option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" OFF)
|
|
|
|
|
|
|
|
-if(MYSQL_FOUND)
|
|
|
|
- option(ENABLE_DATA "Enable Data" ON)
|
|
|
|
- option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" ON)
|
|
|
|
-else()
|
|
|
|
- option(ENABLE_DATA "Enable Data" OFF)
|
|
|
|
- option(ENABLE_DATA_MYSQL "Enable Data MySQL or MariaDB" OFF)
|
|
|
|
+if(ENABLE_DATA_MYSQL)
|
|
|
|
+ find_package(libmysql)
|
|
|
|
+ if (NOT libmysql_FOUND)
|
|
|
|
+ find_package(unofficial-libmariadb CONFIG REQUIRED)
|
2021-11-18 00:33:26 +01:00
|
|
|
+ set(MYSQL_LIBRARIES unofficial::libmariadb)
|
2020-11-30 10:36:22 -08:00
|
|
|
+ endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_DATA_POSTGRESQL)
|
|
|
|
find_package(PostgreSQL REQUIRED)
|
|
|
|
-else()
|
|
|
|
- find_package(PostgreSQL)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(PostgreSQL_FOUND)
|
2024-12-19 18:14:19 +00:00
|
|
|
@@ -260,6 +253,9 @@ include(DefinePlatformSpecific)
|
2020-11-30 10:36:22 -08:00
|
|
|
# Collect the built libraries and include dirs, the will be used to create the PocoConfig.cmake file
|
|
|
|
set(Poco_COMPONENTS "")
|
|
|
|
|
|
|
|
+# Do not declare the link library in the code!
|
|
|
|
+add_definitions(-DPOCO_NO_AUTOMATIC_LIBS)
|
|
|
|
+
|
|
|
|
if(ENABLE_TESTS)
|
|
|
|
add_subdirectory(CppUnit)
|
|
|
|
set(ENABLE_XML ON CACHE BOOL "Enable XML" FORCE)
|
2024-12-19 18:14:19 +00:00
|
|
|
@@ -392,8 +388,11 @@ if(EXISTS ${PROJECT_SOURCE_DIR}/Prometheus AND ENABLE_PROMETHEUS)
|
2022-10-31 14:13:06 -06:00
|
|
|
list(APPEND Poco_COMPONENTS "Prometheus")
|
2020-11-30 10:36:22 -08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
-if(EXISTS ${PROJECT_SOURCE_DIR}/PDF AND ENABLE_PDF)
|
|
|
|
- add_subdirectory(PDF)
|
|
|
|
+if(ENABLE_PDF)
|
|
|
|
+ include(SelectLibraryConfigurations)
|
|
|
|
+ find_library(PocoPDF_LIBRARY_RELEASE NAMES libhpdf)
|
|
|
|
+ find_library(PocoPDF_LIBRARY_DEBUG NAMES libhpdfd)
|
|
|
|
+ select_library_configurations(PocoPDF)
|
|
|
|
list(APPEND Poco_COMPONENTS "PDF")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
diff --git a/Data/CMakeLists.txt b/Data/CMakeLists.txt
|
2024-12-19 18:14:19 +00:00
|
|
|
index 95e5019..d7bd537 100644
|
2020-11-30 10:36:22 -08:00
|
|
|
--- a/Data/CMakeLists.txt
|
|
|
|
+++ b/Data/CMakeLists.txt
|
2024-12-19 18:14:19 +00:00
|
|
|
@@ -73,7 +73,7 @@ else(ENABLE_DATA_SQLITE)
|
2020-11-30 10:36:22 -08:00
|
|
|
message(STATUS "SQLite Support Disabled")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
-if(MYSQL_FOUND AND ENABLE_DATA_MYSQL)
|
2022-11-30 04:08:08 +08:00
|
|
|
+if((unofficial-libmysql_FOUND OR unofficial-libmariadb_FOUND) AND ENABLE_DATA_MYSQL)
|
2020-11-30 10:36:22 -08:00
|
|
|
message(STATUS "MySQL Support Enabled")
|
|
|
|
add_subdirectory(MySQL)
|
|
|
|
else()
|
|
|
|
diff --git a/Data/MySQL/CMakeLists.txt b/Data/MySQL/CMakeLists.txt
|
2024-12-19 18:14:19 +00:00
|
|
|
index 0ea8701..3c8a426 100644
|
2020-11-30 10:36:22 -08:00
|
|
|
--- a/Data/MySQL/CMakeLists.txt
|
|
|
|
+++ b/Data/MySQL/CMakeLists.txt
|
2022-11-30 04:08:08 +08:00
|
|
|
@@ -21,7 +21,7 @@ set_target_properties(DataMySQL
|
2020-11-30 10:36:22 -08:00
|
|
|
DEFINE_SYMBOL MySQL_EXPORTS
|
|
|
|
)
|
|
|
|
|
|
|
|
-target_link_libraries(DataMySQL PUBLIC Poco::Data MySQL::client)
|
|
|
|
+target_link_libraries(DataMySQL PUBLIC Poco::Data ${MYSQL_LIBRARIES})
|
|
|
|
target_include_directories(DataMySQL
|
|
|
|
PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
2021-08-03 07:57:14 +08:00
|
|
|
diff --git a/Data/MySQL/include/Poco/Data/MySQL/MySQL.h b/Data/MySQL/include/Poco/Data/MySQL/MySQL.h
|
2022-10-31 14:13:06 -06:00
|
|
|
index 2386590..81b2c8e 100644
|
2021-08-03 07:57:14 +08:00
|
|
|
--- a/Data/MySQL/include/Poco/Data/MySQL/MySQL.h
|
|
|
|
+++ b/Data/MySQL/include/Poco/Data/MySQL/MySQL.h
|
|
|
|
@@ -57,8 +57,6 @@
|
|
|
|
#endif
|
|
|
|
#if defined(LIBMARIADB)
|
|
|
|
#pragma comment(lib, "libmariadb")
|
|
|
|
- #else
|
|
|
|
- #pragma comment(lib, "libmysql")
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2020-11-30 10:36:22 -08:00
|
|
|
diff --git a/Data/SQLite/CMakeLists.txt b/Data/SQLite/CMakeLists.txt
|
2024-12-19 18:14:19 +00:00
|
|
|
index 7141112..0c73beb 100644
|
2020-11-30 10:36:22 -08:00
|
|
|
--- a/Data/SQLite/CMakeLists.txt
|
|
|
|
+++ b/Data/SQLite/CMakeLists.txt
|
|
|
|
@@ -7,7 +7,7 @@ file(GLOB_RECURSE HDRS_G "include/*.h")
|
|
|
|
POCO_HEADERS_AUTO(SQLITE_SRCS ${HDRS_G})
|
|
|
|
|
|
|
|
if(POCO_UNBUNDLED)
|
|
|
|
- find_package(SQLite3 REQUIRED)
|
|
|
|
+ find_package(unofficial-sqlite3 CONFIG REQUIRED)
|
|
|
|
else()
|
|
|
|
# sqlite3
|
|
|
|
POCO_SOURCES(SQLITE_SRCS sqlite3
|
2024-12-19 18:14:19 +00:00
|
|
|
@@ -39,7 +39,7 @@ target_include_directories(DataSQLite
|
2020-11-30 10:36:22 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
if(POCO_UNBUNDLED)
|
|
|
|
- target_link_libraries(DataSQLite PUBLIC SQLite::SQLite3)
|
2022-10-31 14:13:06 -06:00
|
|
|
+ target_link_libraries(DataSQLite PUBLIC unofficial::sqlite3::sqlite3)
|
2020-11-30 10:36:22 -08:00
|
|
|
target_compile_definitions(DataSQLite PUBLIC
|
|
|
|
POCO_UNBUNDLED
|
|
|
|
SQLITE_THREADSAFE=1
|
2022-11-09 11:03:26 -08:00
|
|
|
diff --git a/XML/CMakeLists.txt b/XML/CMakeLists.txt
|
2024-12-19 18:14:19 +00:00
|
|
|
index cf66250..89e6c8f 100644
|
2022-11-09 11:03:26 -08:00
|
|
|
--- a/XML/CMakeLists.txt
|
|
|
|
+++ b/XML/CMakeLists.txt
|
|
|
|
@@ -20,7 +20,7 @@ endif()
|
|
|
|
# If POCO_UNBUNDLED is enabled we try to find the required packages
|
|
|
|
# The configuration will fail if the packages are not found
|
|
|
|
if(POCO_UNBUNDLED)
|
|
|
|
- find_package(EXPAT REQUIRED)
|
|
|
|
+ find_package(expat CONFIG REQUIRED)
|
|
|
|
else()
|
|
|
|
POCO_SOURCES(SRCS expat
|
|
|
|
src/xmlparse.cpp
|
|
|
|
@@ -50,7 +50,7 @@ target_include_directories(XML
|
|
|
|
)
|
|
|
|
|
|
|
|
if(POCO_UNBUNDLED)
|
|
|
|
- target_link_libraries(XML PUBLIC EXPAT::EXPAT)
|
|
|
|
+ target_link_libraries(XML PUBLIC expat::expat)
|
|
|
|
target_compile_definitions(XML PUBLIC POCO_UNBUNDLED)
|
|
|
|
else()
|
|
|
|
if(WIN32)
|
2020-11-30 10:36:22 -08:00
|
|
|
diff --git a/XML/cmake/PocoXMLConfig.cmake b/XML/cmake/PocoXMLConfig.cmake
|
|
|
|
index ef58207..4ed94ec 100644
|
|
|
|
--- a/XML/cmake/PocoXMLConfig.cmake
|
|
|
|
+++ b/XML/cmake/PocoXMLConfig.cmake
|
|
|
|
@@ -4,7 +4,7 @@ if(@POCO_UNBUNDLED@)
|
|
|
|
if(CMAKE_VERSION VERSION_LESS "3.10")
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/V39")
|
|
|
|
endif()
|
|
|
|
- find_dependency(EXPAT REQUIRED)
|
|
|
|
+ find_dependency(expat CONFIG REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/PocoXMLTargets.cmake")
|
|
|
|
diff --git a/cmake/PocoConfig.cmake.in b/cmake/PocoConfig.cmake.in
|
2022-11-30 04:08:08 +08:00
|
|
|
index 173eacd..90f68fc 100644
|
2020-11-30 10:36:22 -08:00
|
|
|
--- a/cmake/PocoConfig.cmake.in
|
|
|
|
+++ b/cmake/PocoConfig.cmake.in
|
2022-11-30 04:08:08 +08:00
|
|
|
@@ -8,6 +8,12 @@ if (NOT Poco_FIND_COMPONENTS)
|
2020-11-30 10:36:22 -08:00
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
+include(CMakeFindDependencyMacro)
|
|
|
|
+find_dependency(ZLIB REQUIRED)
|
|
|
|
+if(Poco_FIND_REQUIRED_XML)
|
|
|
|
+ find_dependency(expat CONFIG REQUIRED)
|
|
|
|
+endif()
|
|
|
|
+
|
|
|
|
set(_Poco_FIND_PARTS_REQUIRED)
|
|
|
|
if (Poco_FIND_REQUIRED)
|
|
|
|
set(_Poco_FIND_PARTS_REQUIRED REQUIRED)
|
2022-11-30 04:08:08 +08:00
|
|
|
@@ -23,7 +29,7 @@ set(_Poco_NOTFOUND_MESSAGE)
|
2020-11-30 10:36:22 -08:00
|
|
|
|
|
|
|
# Let components find each other, but don't overwrite CMAKE_PREFIX_PATH
|
|
|
|
set(_Poco_CMAKE_PREFIX_PATH_old ${CMAKE_PREFIX_PATH})
|
|
|
|
-set(CMAKE_PREFIX_PATH ${_Poco_install_prefix})
|
|
|
|
+set(CMAKE_PREFIX_PATH ${_Poco_install_prefix} ${CMAKE_PREFIX_PATH})
|
|
|
|
|
|
|
|
foreach(module ${Poco_FIND_COMPONENTS})
|
|
|
|
find_package(Poco${module}
|