1b877906bSopenharmony_ci
2b877906bSopenharmony_ciif (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
3b877906bSopenharmony_ci  message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
4b877906bSopenharmony_ciendif()
5b877906bSopenharmony_ci
6b877906bSopenharmony_cifile(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
7b877906bSopenharmony_cistring(REGEX REPLACE "\n" ";" files "${files}")
8b877906bSopenharmony_ci
9b877906bSopenharmony_ciforeach (file ${files})
10b877906bSopenharmony_ci  message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
11b877906bSopenharmony_ci  if (EXISTS "$ENV{DESTDIR}${file}")
12b877906bSopenharmony_ci    exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
13b877906bSopenharmony_ci                 OUTPUT_VARIABLE rm_out
14b877906bSopenharmony_ci                 RETURN_VALUE rm_retval)
15b877906bSopenharmony_ci    if (NOT "${rm_retval}" STREQUAL 0)
16b877906bSopenharmony_ci      MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
17b877906bSopenharmony_ci    endif()
18b877906bSopenharmony_ci  elseif (IS_SYMLINK "$ENV{DESTDIR}${file}")
19b877906bSopenharmony_ci    EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
20b877906bSopenharmony_ci                 OUTPUT_VARIABLE rm_out
21b877906bSopenharmony_ci                 RETURN_VALUE rm_retval)
22b877906bSopenharmony_ci    if (NOT "${rm_retval}" STREQUAL 0)
23b877906bSopenharmony_ci      message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"")
24b877906bSopenharmony_ci    endif()
25b877906bSopenharmony_ci  else()
26b877906bSopenharmony_ci    message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
27b877906bSopenharmony_ci  endif()
28b877906bSopenharmony_ciendforeach()
29b877906bSopenharmony_ci
30