Fixing Poco not building as static when first cmake configuration called.
This commit is contained in:
parent
a5cacb38c2
commit
1d75b2ac0f
1 changed files with 22 additions and 16 deletions
|
@ -1,16 +1,15 @@
|
|||
cmake_minimum_required(VERSION 3.11)
|
||||
|
||||
# Poco
|
||||
set(ENABLE_MONGODB OFF)
|
||||
set(ENABLE_REDIS OFF)
|
||||
set(ENABLE_DATA_SQLITE OFF)
|
||||
set(ENABLE_DATA_MYSQL OFF)
|
||||
set(ENABLE_DATA_ODBC OFF)
|
||||
set(ENABLE_ZIP OFF)
|
||||
set(ENABLE_PAGECOMPILER OFF) # Disable PageCompiler (unused binary)
|
||||
set(ENABLE_PAGECOMPILER_FILE2PAGE OFF) # Disable File2Page (unused binary)
|
||||
# Will maybe change later, for now we want the lib to be static.
|
||||
set(POCO_STATIC ON)
|
||||
set(ENABLE_MONGODB OFF CACHE BOOL "Disable MongoDB support" FORCE)
|
||||
set(ENABLE_REDIS OFF CACHE BOOL "Disable Redis support" FORCE)
|
||||
set(ENABLE_DATA_SQLITE OFF CACHE BOOL "Disable SQLite support" FORCE)
|
||||
set(ENABLE_DATA_MYSQL OFF CACHE BOOL "Disable MySQL support" FORCE)
|
||||
set(ENABLE_DATA_ODBC OFF CACHE BOOL "Disable ODBC support" FORCE)
|
||||
set(ENABLE_ZIP OFF CACHE BOOL "Disable Zip support" FORCE)
|
||||
set(ENABLE_PAGECOMPILER OFF CACHE BOOL "Disable PageCompiler support" FORCE)
|
||||
set(ENABLE_PAGECOMPILER_FILE2PAGE OFF CACHE BOOL "Disable File2Page support" FORCE)
|
||||
set(POCO_STATIC ON CACHE BOOL "Build Poco as static libraries" FORCE)
|
||||
|
||||
find_package(Poco QUIET)
|
||||
if (NOT Poco_FOUND)
|
||||
|
@ -21,7 +20,11 @@ if (NOT Poco_FOUND)
|
|||
URL https://github.com/pocoproject/poco/archive/refs/tags/poco-1.9.4-release.tar.gz
|
||||
)
|
||||
FetchContent_GetProperties(Poco)
|
||||
FetchContent_MakeAvailable(Poco)
|
||||
if (NOT Poco_POPULATED)
|
||||
set(FETCHCONTENT_QUIET NO)
|
||||
FetchContent_MakeAvailable(Poco)
|
||||
endif()
|
||||
|
||||
set(Poco_INCLUDE_DIRS
|
||||
"${poco_SOURCE_DIR}/Foundation/include"
|
||||
"${poco_SOURCE_DIR}/Encodings/include"
|
||||
|
@ -34,8 +37,8 @@ if (NOT Poco_FOUND)
|
|||
endif()
|
||||
|
||||
# LibXML2
|
||||
set(LIBXML2_WITH_PROGRAMS OFF) # Disable programs
|
||||
set(LIBXML2_WITH_TESTS OFF) # Disable tests
|
||||
set(LIBXML2_WITH_PROGRAMS OFF)
|
||||
set(LIBXML2_WITH_TESTS OFF)
|
||||
# Disabling every dependencies to build libxml2
|
||||
set(LIBXML2_WITH_PYTHON OFF)
|
||||
set(LIBXML2_WITH_ICONV OFF)
|
||||
|
@ -45,7 +48,7 @@ set(LIBXML2_WITH_ZLIB OFF)
|
|||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
find_package(libxml2 QUIET)
|
||||
if (NOT (libxml2_FOUND OR LIBXML2_FOUND))
|
||||
if (NOT libxml2_FOUND)
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
libxml2
|
||||
|
@ -53,10 +56,13 @@ if (NOT (libxml2_FOUND OR LIBXML2_FOUND))
|
|||
GIT_TAG v2.12.6
|
||||
)
|
||||
FetchContent_GetProperties(libxml2)
|
||||
FetchContent_MakeAvailable(libxml2)
|
||||
if (NOT libxml2_POPULATED)
|
||||
set(FETCHCONTENT_QUIET NO)
|
||||
FetchContent_MakeAvailable(libxml2)
|
||||
endif()
|
||||
|
||||
set(LIBXML2_INCLUDE_DIR
|
||||
"${libxml2_SOURCE_DIR}/include"
|
||||
"${libxml2_BINARY_DIR}"
|
||||
)
|
||||
set(LIBXML2_LIBRARY "${libxml2_BINARY_DIR}/libxml2.a")
|
||||
endif()
|
||||
|
|
Loading…
Add table
Reference in a new issue