aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Fetzer <fetzer.ch@gmail.com>2016-11-03 22:57:14 +0100
committerGitHub <noreply@github.com>2016-11-03 22:57:14 +0100
commit7f6abd1dd6d1aefcb4303083f34aaa90a8df9fce (patch)
tree5964566e5cfadf119cac7be460323f911aa5c07c
parentc85c62c34ab4d7335418a02099d569a789118f39 (diff)
parenta6633b547384cd1362ec4a8f9245771d44619a2c (diff)
Merge pull request #10837 from fetzerch/cmake_cleanup
[cmake/cleanup] file(REMOVE/REMOVE_RECURSE) ignores non existing files
-rw-r--r--project/cmake/addons/CMakeLists.txt8
-rw-r--r--project/cmake/scripts/common/HandleDepends.cmake4
2 files changed, 3 insertions, 9 deletions
diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt
index e2addaf784..d87051318b 100644
--- a/project/cmake/addons/CMakeLists.txt
+++ b/project/cmake/addons/CMakeLists.txt
@@ -254,9 +254,7 @@ foreach(addon ${addons})
if(${platform_found})
# make sure the output directory is clean
- if(EXISTS "${CMAKE_INSTALL_PREFIX}/${id}")
- file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/")
- endif()
+ file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/")
# get the URL and revision of the addon
list(LENGTH def deflength)
@@ -334,9 +332,7 @@ foreach(addon ${addons})
endif()
# remove any previously extracted version of the addon
- if(EXISTS "${BUILD_DIR}/${id}")
- file(REMOVE_RECURSE "${BUILD_DIR}/${id}")
- endif()
+ file(REMOVE_RECURSE "${BUILD_DIR}/${id}")
# extract the addon from the archive
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${BUILD_DIR}/download/${archive_name}.tar.gz
diff --git a/project/cmake/scripts/common/HandleDepends.cmake b/project/cmake/scripts/common/HandleDepends.cmake
index 32ae489a00..ad215c49e8 100644
--- a/project/cmake/scripts/common/HandleDepends.cmake
+++ b/project/cmake/scripts/common/HandleDepends.cmake
@@ -78,9 +78,7 @@ function(add_addon_depends addon searchpath)
# prepare patchfile. ensure we have a clean file after reconfiguring
set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake)
- if(EXISTS ${PATCH_FILE})
- file(REMOVE ${PATCH_FILE})
- endif()
+ file(REMOVE ${PATCH_FILE})
# if there's a CMakeLists.txt use it to prepare the build
if(EXISTS ${dir}/CMakeLists.txt)