diff options
author | James McCoy <jamessan@jamessan.com> | 2021-11-03 08:24:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-03 08:24:39 -0400 |
commit | 2481b18a53e2c395431c1b8f0a8089d3a2fe4c05 (patch) | |
tree | 5fa898804b49176540e960035938593f98306ae3 /cmake | |
parent | 7899c4099b38f2198c86b08138f813c530fdc20f (diff) | |
parent | 6b0a2e6996748916c8bd69175f81cfc161a2f180 (diff) | |
download | rneovim-2481b18a53e2c395431c1b8f0a8089d3a2fe4c05.tar.gz rneovim-2481b18a53e2c395431c1b8f0a8089d3a2fe4c05.tar.bz2 rneovim-2481b18a53e2c395431c1b8f0a8089d3a2fe4c05.zip |
Merge pull request #16055 from doubleloop/config_depends
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/InstallHelpers.cmake | 22 |
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() |