aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-05-28 11:03:49 +0200
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-05-28 20:58:07 +0200
commitf09f5c45facc597bb3f70b7821412641bf31a592 (patch)
tree0058628a2bd35b1d8722b8d6c21f5470777062b7 /cmake
parent1c6d9200521acb2329be55ab8bec3056deade66a (diff)
downloadrneovim-f09f5c45facc597bb3f70b7821412641bf31a592.tar.gz
rneovim-f09f5c45facc597bb3f70b7821412641bf31a592.tar.bz2
rneovim-f09f5c45facc597bb3f70b7821412641bf31a592.zip
build: reuse code for deps.txt for both deps and main build
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Deps.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/Deps.cmake b/cmake/Deps.cmake
index 413e3a08a9..398d9564cd 100644
--- a/cmake/Deps.cmake
+++ b/cmake/Deps.cmake
@@ -58,6 +58,32 @@ if(CMAKE_OSX_SYSROOT)
set(DEPS_C_COMPILER "${DEPS_C_COMPILER} -isysroot${CMAKE_OSX_SYSROOT}")
endif()
+get_filename_component(rootdir ${PROJECT_SOURCE_DIR} NAME)
+if(${rootdir} MATCHES "cmake.deps")
+ set(depsfile ${PROJECT_SOURCE_DIR}/deps.txt)
+else()
+ set(depsfile ${PROJECT_SOURCE_DIR}/cmake.deps/deps.txt)
+endif()
+
+set_directory_properties(PROPERTIES
+ EP_PREFIX "${DEPS_BUILD_DIR}"
+ CMAKE_CONFIGURE_DEPENDS ${depsfile})
+
+file(READ ${depsfile} DEPENDENCIES)
+STRING(REGEX REPLACE "\n" ";" DEPENDENCIES "${DEPENDENCIES}")
+foreach(dep ${DEPENDENCIES})
+ STRING(REGEX REPLACE " " ";" dep "${dep}")
+ list(GET dep 0 name)
+ list(GET dep 1 value)
+ if(NOT ${name})
+ # _URL variables must NOT be set when USE_EXISTING_SRC_DIR is set,
+ # otherwise ExternalProject will try to re-download the sources.
+ if(NOT USE_EXISTING_SRC_DIR)
+ set(${name} ${value})
+ endif()
+ endif()
+endforeach()
+
function(get_externalproject_options name DEPS_IGNORE_SHA)
string(TOUPPER ${name} name_allcaps)
set(url ${${name_allcaps}_URL})