From 89e683f2f28ff6e41dfde2470d1ed0d5f0cb8c78 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 26 Jul 2021 15:18:15 +0300 Subject: Depends: Trying a different tracking method The external project install targets are not being executed in time, maybe this helps? --- CMakeLists.txt | 1 + Depends.cmake | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c5d5f610..7095173e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,6 +275,7 @@ endif () # Target. add_executable (app ${SOURCES} ${RESOURCES}) +add_dependencies (app ext-deps) set_target_properties (app PROPERTIES OUTPUT_NAME lagrange) target_include_directories (app PUBLIC src diff --git a/Depends.cmake b/Depends.cmake index 886efc1b..21c91fda 100644 --- a/Depends.cmake +++ b/Depends.cmake @@ -8,6 +8,8 @@ find_program (MESON_EXECUTABLE meson DOC "Meson build system") find_program (NINJA_EXECUTABLE ninja DOC "Ninja build tool") include (ExternalProject) +set (_dependsToBuild) + 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) @@ -29,10 +31,9 @@ if (ENABLE_HARFBUZZ AND EXISTS ${CMAKE_SOURCE_DIR}/lib/harfbuzz/CMakeLists.txt) --prefix ${_dst} BUILD_COMMAND ${NINJA_EXECUTABLE} INSTALL_COMMAND ${NINJA_EXECUTABLE} install - STEP_TARGETS install ) + list (APPEND _dependsToBuild harfbuzz-ext) add_library (harfbuzz-lib INTERFACE) - add_dependencies (harfbuzz-lib harfbuzz-ext-install harfbuzz-ext) target_include_directories (harfbuzz-lib INTERFACE ${_dst}/include/harfbuzz) if (MSYS) # Link dynamically. @@ -96,21 +97,22 @@ if (ENABLE_FRIBIDI AND EXISTS ${CMAKE_SOURCE_DIR}/lib/fribidi) --prefix ${_dst} BUILD_COMMAND ${NINJA_EXECUTABLE} INSTALL_COMMAND ${NINJA_EXECUTABLE} install - STEP_TARGETS install BUILD_BYPRODUCTS ${_dst}/lib/libfribidi.a ) + list (APPEND _dependsToBuild fribidi-ext) else () message (FATAL_ERROR "GNU FriBidi must be built with Meson. Please install Meson and Ninja and try again, or provide FriBidi via pkg-config.") endif () add_library (fribidi-lib INTERFACE) - add_dependencies (fribidi-lib fribidi-ext-install fribidi-ext) target_include_directories (fribidi-lib INTERFACE ${_dst}/include) target_link_libraries (fribidi-lib INTERFACE ${_dst}/lib/libfribidi.a) set (FRIBIDI_FOUND YES) endif () 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 REQUIRED) -- cgit v1.2.3