From 47d2b3122ea18147c0661b0158ccf1daef2d9c2b Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 6 Nov 2021 12:29:13 +0200 Subject: Depends: Require the_Foundation v1.0.1 --- Depends.cmake | 69 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/Depends.cmake b/Depends.cmake index 3af9102d..c3decd7a 100644 --- a/Depends.cmake +++ b/Depends.cmake @@ -7,9 +7,42 @@ find_package (PkgConfig) find_program (MESON_EXECUTABLE meson DOC "Meson build system") find_program (NINJA_EXECUTABLE ninja DOC "Ninja build tool") include (ExternalProject) - set (_dependsToBuild) +if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt) + set (INSTALL_THE_FOUNDATION YES) + find_package (the_Foundation 1.0.1 REQUIRED) +else () + if (EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/.git) + # the_Foundation is checked out as a submodule, make sure it's up to date. + find_package (Git) + if (GIT_FOUND) + execute_process ( + COMMAND ${GIT_EXECUTABLE} submodule update + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE subout + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (subout) + message (FATAL_ERROR "'lib/the_Foundation' Git submodule has been updated, please re-run CMake.\n") + endif () + endif () + endif () + set (INSTALL_THE_FOUNDATION OFF) + set (TFDN_STATIC_LIBRARY ON CACHE BOOL "") + set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "") + set (TFDN_ENABLE_TESTS OFF CACHE BOOL "") + set (TFDN_ENABLE_WEBREQUEST OFF CACHE BOOL "") + add_subdirectory (lib/the_Foundation) + add_library (the_Foundation::the_Foundation ALIAS the_Foundation) + if (NOT OPENSSL_FOUND) + message (FATAL_ERROR "Lagrange requires OpenSSL for TLS. Please check if pkg-config can find 'openssl'.") + endif () + if (NOT ZLIB_FOUND) + message (FATAL_ERROR "Lagrange requires zlib for reading compressed archives. Please check if pkg-config can find 'zlib'.") + endif () +endif () + if (ENABLE_HARFBUZZ AND EXISTS ${CMAKE_SOURCE_DIR}/lib/harfbuzz/CMakeLists.txt) # Find HarfBuzz with pkg-config. if (NOT ENABLE_HARFBUZZ_MINIMAL AND PKG_CONFIG_FOUND) @@ -112,40 +145,6 @@ endif () add_custom_target (ext-deps DEPENDS ${_dependsToBuild}) -if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt) - set (INSTALL_THE_FOUNDATION YES) - find_package (the_Foundation 1.0.0 REQUIRED) -else () - if (EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/.git) - # the_Foundation is checked out as a submodule, make sure it's up to date. - find_package (Git) - if (GIT_FOUND) - execute_process ( - COMMAND ${GIT_EXECUTABLE} submodule update - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE subout - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if (subout) - message (FATAL_ERROR "'lib/the_Foundation' Git submodule has been updated, please re-run CMake.\n") - endif () - endif () - endif () - set (INSTALL_THE_FOUNDATION OFF) - set (TFDN_STATIC_LIBRARY ON CACHE BOOL "") - set (TFDN_ENABLE_INSTALL OFF CACHE BOOL "") - set (TFDN_ENABLE_TESTS OFF CACHE BOOL "") - set (TFDN_ENABLE_WEBREQUEST OFF CACHE BOOL "") - add_subdirectory (lib/the_Foundation) - add_library (the_Foundation::the_Foundation ALIAS the_Foundation) - if (NOT OPENSSL_FOUND) - message (FATAL_ERROR "Lagrange requires OpenSSL for TLS. Please check if pkg-config can find 'openssl'.") - endif () - if (NOT ZLIB_FOUND) - message (FATAL_ERROR "Lagrange requires zlib for reading compressed archives. Please check if pkg-config can find 'zlib'.") - endif () -endif () - find_package (PkgConfig REQUIRED) pkg_check_modules (SDL2 REQUIRED sdl2) pkg_check_modules (MPG123 IMPORTED_TARGET libmpg123) -- cgit v1.2.3