diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | 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 () | |||
275 | 275 | ||
276 | # Target. | 276 | # Target. |
277 | add_executable (app ${SOURCES} ${RESOURCES}) | 277 | add_executable (app ${SOURCES} ${RESOURCES}) |
278 | add_dependencies (app ext-deps) | ||
278 | set_target_properties (app PROPERTIES OUTPUT_NAME lagrange) | 279 | set_target_properties (app PROPERTIES OUTPUT_NAME lagrange) |
279 | target_include_directories (app PUBLIC | 280 | target_include_directories (app PUBLIC |
280 | src | 281 | 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") | |||
8 | find_program (NINJA_EXECUTABLE ninja DOC "Ninja build tool") | 8 | find_program (NINJA_EXECUTABLE ninja DOC "Ninja build tool") |
9 | include (ExternalProject) | 9 | include (ExternalProject) |
10 | 10 | ||
11 | set (_dependsToBuild) | ||
12 | |||
11 | if (ENABLE_HARFBUZZ AND EXISTS ${CMAKE_SOURCE_DIR}/lib/harfbuzz/CMakeLists.txt) | 13 | if (ENABLE_HARFBUZZ AND EXISTS ${CMAKE_SOURCE_DIR}/lib/harfbuzz/CMakeLists.txt) |
12 | # Find HarfBuzz with pkg-config. | 14 | # Find HarfBuzz with pkg-config. |
13 | if (NOT ENABLE_HARFBUZZ_MINIMAL AND PKG_CONFIG_FOUND) | 15 | 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) | |||
29 | --prefix ${_dst} | 31 | --prefix ${_dst} |
30 | BUILD_COMMAND ${NINJA_EXECUTABLE} | 32 | BUILD_COMMAND ${NINJA_EXECUTABLE} |
31 | INSTALL_COMMAND ${NINJA_EXECUTABLE} install | 33 | INSTALL_COMMAND ${NINJA_EXECUTABLE} install |
32 | STEP_TARGETS install | ||
33 | ) | 34 | ) |
35 | list (APPEND _dependsToBuild harfbuzz-ext) | ||
34 | add_library (harfbuzz-lib INTERFACE) | 36 | add_library (harfbuzz-lib INTERFACE) |
35 | add_dependencies (harfbuzz-lib harfbuzz-ext-install harfbuzz-ext) | ||
36 | target_include_directories (harfbuzz-lib INTERFACE ${_dst}/include/harfbuzz) | 37 | target_include_directories (harfbuzz-lib INTERFACE ${_dst}/include/harfbuzz) |
37 | if (MSYS) | 38 | if (MSYS) |
38 | # Link dynamically. | 39 | # Link dynamically. |
@@ -96,21 +97,22 @@ if (ENABLE_FRIBIDI AND EXISTS ${CMAKE_SOURCE_DIR}/lib/fribidi) | |||
96 | --prefix ${_dst} | 97 | --prefix ${_dst} |
97 | BUILD_COMMAND ${NINJA_EXECUTABLE} | 98 | BUILD_COMMAND ${NINJA_EXECUTABLE} |
98 | INSTALL_COMMAND ${NINJA_EXECUTABLE} install | 99 | INSTALL_COMMAND ${NINJA_EXECUTABLE} install |
99 | STEP_TARGETS install | ||
100 | BUILD_BYPRODUCTS ${_dst}/lib/libfribidi.a | 100 | BUILD_BYPRODUCTS ${_dst}/lib/libfribidi.a |
101 | ) | 101 | ) |
102 | list (APPEND _dependsToBuild fribidi-ext) | ||
102 | else () | 103 | else () |
103 | message (FATAL_ERROR | 104 | message (FATAL_ERROR |
104 | "GNU FriBidi must be built with Meson. Please install Meson and Ninja and try again, or provide FriBidi via pkg-config.") | 105 | "GNU FriBidi must be built with Meson. Please install Meson and Ninja and try again, or provide FriBidi via pkg-config.") |
105 | endif () | 106 | endif () |
106 | add_library (fribidi-lib INTERFACE) | 107 | add_library (fribidi-lib INTERFACE) |
107 | add_dependencies (fribidi-lib fribidi-ext-install fribidi-ext) | ||
108 | target_include_directories (fribidi-lib INTERFACE ${_dst}/include) | 108 | target_include_directories (fribidi-lib INTERFACE ${_dst}/include) |
109 | target_link_libraries (fribidi-lib INTERFACE ${_dst}/lib/libfribidi.a) | 109 | target_link_libraries (fribidi-lib INTERFACE ${_dst}/lib/libfribidi.a) |
110 | set (FRIBIDI_FOUND YES) | 110 | set (FRIBIDI_FOUND YES) |
111 | endif () | 111 | endif () |
112 | endif () | 112 | endif () |
113 | 113 | ||
114 | add_custom_target (ext-deps DEPENDS ${_dependsToBuild}) | ||
115 | |||
114 | if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt) | 116 | if (NOT EXISTS ${CMAKE_SOURCE_DIR}/lib/the_Foundation/CMakeLists.txt) |
115 | set (INSTALL_THE_FOUNDATION YES) | 117 | set (INSTALL_THE_FOUNDATION YES) |
116 | find_package (the_Foundation REQUIRED) | 118 | find_package (the_Foundation REQUIRED) |