Compare commits

..

No commits in common. "f666903a8835cf29eaa8fcab9a6590f721ad283b" and "a5cacb38c2893b01275452f697592cc5e9d5f3c5" have entirely different histories.

4 changed files with 18 additions and 25 deletions

View file

@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD_REQUIRED ON)
# Dependencies # Dependencies
set(CMAKE_TLS_VERIFY FALSE) # Custom TLS/Proxy sometimes does not enable download
include(dependencies.cmake) include(dependencies.cmake)
# Game source files # Game source files

View file

@ -2,7 +2,7 @@
![Static Badge](https://img.shields.io/badge/license-CeCILL_C-lightgrey) ![Static Badge](https://img.shields.io/badge/license-CeCILL_C-lightgrey)
![Static Badge](https://img.shields.io/badge/builds_on-Linux-brightgreen) ![Static Badge](https://img.shields.io/badge/builds_on-Linux-brightgreen)
![Static Badge](https://img.shields.io/badge/builds_on-Windows-brightgreen) ![Static Badge](https://img.shields.io/badge/builds_on-Windows-red)
Here is an example of the cmake fetch if the `find_package()` cannot be used. Fetch is useful when building custom version of popular libraries. Here is an example of the cmake fetch if the `find_package()` cannot be used. Fetch is useful when building custom version of popular libraries.

View file

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

View file

@ -24,7 +24,7 @@ target_include_directories(${TARGET} PRIVATE "${Poco_INCLUDE_DIRS}")
# Libraries # Libraries
target_link_libraries( target_link_libraries(
${TARGET} PRIVATE ${TARGET} PRIVATE
LibXml2 ${LIBXML2_LIBRARY}
PocoFoundation PocoFoundation
PocoUtil PocoUtil
PocoNet PocoNet