aboutsummaryrefslogtreecommitdiff
path: root/cmake/InstallHelpers.cmake
diff options
context:
space:
mode:
authorJakub Łuczyński <doubleloop@o2.pl>2021-10-17 14:46:44 +0200
committerJakub Łuczyński <doubleloop@o2.pl>2021-10-18 11:44:15 +0200
commit6b0a2e6996748916c8bd69175f81cfc161a2f180 (patch)
tree5a9e074f2fb805a841491baa983115ab994eed10 /cmake/InstallHelpers.cmake
parent389a898586c1ed2c6cd50f3099ff50fe0645f86f (diff)
downloadrneovim-6b0a2e6996748916c8bd69175f81cfc161a2f180.tar.gz
rneovim-6b0a2e6996748916c8bd69175f81cfc161a2f180.tar.bz2
rneovim-6b0a2e6996748916c8bd69175f81cfc161a2f180.zip
build(install): rescan GLOB files on rebuild
Diffstat (limited to 'cmake/InstallHelpers.cmake')
-rw-r--r--cmake/InstallHelpers.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/cmake/InstallHelpers.cmake b/cmake/InstallHelpers.cmake
index bebc0d0d17..9d997260cd 100644
--- a/cmake/InstallHelpers.cmake
+++ b/cmake/InstallHelpers.cmake
@@ -154,3 +154,25 @@ function(install_helper)
${RENAME})
endif()
endfunction()
+
+# Without CONFIGURE_DEPENDS globbing reuses cached file tree on rebuild.
+# For example it will ignore new files.
+# CONFIGURE_DEPENDS was introduced in 3.12
+
+function(glob_wrapper outvar)
+ if(${CMAKE_VERSION} VERSION_LESS 3.12)
+ file(GLOB ${outvar} ${ARGN})
+ else()
+ file(GLOB ${outvar} CONFIGURE_DEPENDS ${ARGN})
+ endif()
+ set(${outvar} ${${outvar}} PARENT_SCOPE)
+endfunction()
+
+function(globrecurse_wrapper outvar root)
+ if(${CMAKE_VERSION} VERSION_LESS 3.12)
+ file(GLOB_RECURSE ${outvar} RELATIVE ${root} ${ARGN})
+ else()
+ file(GLOB_RECURSE ${outvar} CONFIGURE_DEPENDS RELATIVE ${root} ${ARGN})
+ endif()
+ set(${outvar} ${${outvar}} PARENT_SCOPE)
+endfunction()