Skip to content

Commit cb36c43

Browse files
committed
Fix uninstallation random failures on Windows
On Windows, the 'uninstall' target failed randomly. The CMake command used for deleting files, 'cmake -E remove' seems to be not reliable. Changing the command used for files deletion to 'FILE(REMOVE ...)'.
1 parent e17a0ad commit cb36c43

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

cmake/cmake_uninstall.cmake.in

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,7 @@ string(REGEX REPLACE "\n" ";" files "${files}")
99
foreach(file ${files})
1010
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
1111
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
12-
execute_process(
13-
COMMAND @CMAKE_COMMAND@ -E remove $ENV{DESTDIR}${file}
14-
OUTPUT_VARIABLE rm_out
15-
RESULT_VARIABLE rm_retval
16-
)
17-
if(NOT "${rm_retval}" STREQUAL 0)
18-
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
19-
endif(NOT "${rm_retval}" STREQUAL 0)
12+
FILE(REMOVE $ENV{DESTDIR}${file})
2013
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
2114
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
2215
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")

0 commit comments

Comments
 (0)