From 20c128d3fa2212fa937a6de7d6b4a5317526aa6e Mon Sep 17 00:00:00 2001 From: Yatao Li Date: Wed, 12 Sep 2018 01:28:42 +0800 Subject: [PATCH] replace LIST FILTER with handrolled implementation to cancel cmake v3.6+ dependency --- cmake/modules/FindDotnet.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindDotnet.cmake b/cmake/modules/FindDotnet.cmake index ed1186999..625317a41 100644 --- a/cmake/modules/FindDotnet.cmake +++ b/cmake/modules/FindDotnet.cmake @@ -125,7 +125,12 @@ FUNCTION(DOTNET_GET_DEPS _DN_PROJECT arguments) ${arguments}) LIST(APPEND DOTNET_deps ${_DN_SOURCES}) - LIST(FILTER DOTNET_deps EXCLUDE REGEX /obj/) + SET(_DN_deps "") + FOREACH(dep ${DOTNET_deps}) + IF(NOT dep MATCHES /obj/) + LIST(APPEND _DN_deps ${dep}) + ENDIF() + ENDFOREACH() GET_FILENAME_COMPONENT(_DN_abs_proj "${_DN_PROJECT}" ABSOLUTE) GET_FILENAME_COMPONENT(_DN_proj_dir "${_DN_PROJECT}" DIRECTORY) @@ -178,7 +183,7 @@ FUNCTION(DOTNET_GET_DEPS _DN_PROJECT arguments) SET(DOTNET_RUN_OUTPUT ${_DN_OUTPUT} PARENT_SCOPE) SET(DOTNET_PACKAGE_VERSION ${_DN_VERSION} PARENT_SCOPE) SET(DOTNET_OUTPUT_PATH ${_DN_OUTPUT_PATH} PARENT_SCOPE) - SET(DOTNET_deps ${DOTNET_deps} PARENT_SCOPE) + SET(DOTNET_deps ${_DN_deps} PARENT_SCOPE) IF(_DN_PLATFORM) SET(_DN_PLATFORM_PROP "/p:Platform=${_DN_PLATFORM}")