summaryrefslogtreecommitdiffstats
path: root/Modules/ExternalProject.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-01-23 18:28:49 (GMT)
committerBrad King <brad.king@kitware.com>2015-01-23 18:38:59 (GMT)
commita4605973ff116d11ca96c7b06aa6516bd638429a (patch)
treef8987235a085c6e65bbaf590fc12399b44d4e7e1 /Modules/ExternalProject.cmake
parent154bf8da991a6cbc82e5ef89979549b10d19f561 (diff)
downloadCMake-a4605973ff116d11ca96c7b06aa6516bd638429a.zip
CMake-a4605973ff116d11ca96c7b06aa6516bd638429a.tar.gz
CMake-a4605973ff116d11ca96c7b06aa6516bd638429a.tar.bz2
ExternalProject: Allow ALWAYS step property to be switched (#15368)
Within an existing build tree, if the stamp for a step already exists when one activates the ALWAYS option, we still want it to always build. Remove the step stamp file during CMake configuration to ensure it does not exist when the ALWAYS option is enabled.
Diffstat (limited to 'Modules/ExternalProject.cmake')
-rw-r--r--Modules/ExternalProject.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 52d41eb..74e8ae2 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -1456,6 +1456,15 @@ function(ExternalProject_Add_Step name step)
if(always)
set_property(SOURCE ${stamp_file} PROPERTY SYMBOLIC 1)
set(touch)
+ # Remove any existing stamp in case the option changed in an existing tree.
+ if(CMAKE_CONFIGURATION_TYPES)
+ foreach(cfg ${CMAKE_CONFIGURATION_TYPES})
+ string(REPLACE "/${CMAKE_CFG_INTDIR}" "/${cfg}" stamp_file_config "${stamp_file}")
+ file(REMOVE ${stamp_file_config})
+ endforeach()
+ else()
+ file(REMOVE ${stamp_file})
+ endif()
else()
set(touch ${CMAKE_COMMAND} -E touch ${stamp_file})
endif()