Commit 0a95bdaa authored by Rashad Kanavath's avatar Rashad Kanavath

ENH: use simple del and rd command rather than cmake

parent 27c97652
......@@ -148,7 +148,6 @@ include(install_cmake_files)
include(install_mvd_files)
include(install_qtdev_files)
include(install_vstudio_files)
include(add_uninstall_otb_script)
include(installer_files)
include(create_package)
......@@ -225,7 +224,6 @@ installer_files()
create_package()
if(BUILD_TESTING)
message("adding testing")
enable_testing()
include(testing.cmake)
endif()
......
:: uninstall script for OTB
:: Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
::
:: This file is part of Orfeo Toolbox
::
:: https://www.orfeo-toolbox.org/
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
setlocal
set CUR_DIR=%~dp0
cmake -S OUT_DIR/tools/cmake_uninstall_otb.cmake -DMY_INSTALL_DIR=%CUR_DIR% -DCMAKE_COMMAND=cmake
del %CUR_DIR%mapla.bat
del %CUR_DIR%monteverdi.bat
echo "OTB is now uninstalled from %CUR_DIR%"
cd %CUR_DIR%..
set MY_INSTALL_DIR=%cd%
del /S /Q %MY_INSTALL_DIR%\include\OTB* || exit 1
del /S /Q %MY_INSTALL_DIR%\lib\cmake\OTB* || exit 1
del /S /Q %MY_INSTALL_DIR%\lib\otb* || exit 1
del /S /Q %MY_INSTALL_DIR%\lib\python\_otbApplication.* || exit 1
del /S /Q %MY_INSTALL_DIR%\bin\otb* || exit 1
del /S /Q %MY_INSTALL_DIR%\bin\monteverdi.exe || exit 1
del /S /Q %MY_INSTALL_DIR%\bin\mapla.exe || exit 1
del /S /Q %MY_INSTALL_DIR%\mapla.bat || exit 1
del /S /Q %MY_INSTALL_DIR%\monteverdi.bat || exit 1
del /S /Q %MY_INSTALL_DIR%\share\OTB* || exit 1
del /S /Q "%MY_INSTALL_DIR%\OTB Project.zip" || exit 1
endlocal
function(add_uninstall_otb_script)
file(READ "${OTB_BINARY_DIR}/install_manifest.txt" mfile_lines)
string(
REPLACE
"${CMAKE_INSTALL_PREFIX}"
"$\{MY_INSTALL_DIR}"
mfile_lines_NEW ${mfile_lines} )
file(WRITE "${CMAKE_BINARY_DIR}/install_manifest_otb.txt"
${mfile_lines_NEW})
#read cmake_uninstall.cmake.in
file(READ "${PACKAGE_OTB_SRC_DIR}/CMake/cmake_uninstall.cmake.in" cmake_uninstall_lines)
# Replace @CMAKE_INSTALL_PREFIX@ with ${MY_INSTALL_DIR}.
# The result is stored in cmake_uninstall_lines_1
string(
REPLACE
"@CMAKE_INSTALL_PREFIX@"
"$\{MY_INSTALL_DIR}"
cmake_uninstall_lines_1 ${cmake_uninstall_lines} )
# Replace @CMAKE_BINARY_DIR@ with ${MY_INSTALL_DIR}.
# The result is stored in cmake_uninstall_lines_2
# Input is 'cmake_uninstall_lines_1' created from string(REPLACE...
string(
REPLACE
"@CMAKE_BINARY_DIR@"
"$\{MY_INSTALL_DIR}"
cmake_uninstall_lines_2 ${cmake_uninstall_lines_1} )
# Replace @CMAKE_COMMAND@ with ${CMAKE_COMMAND}.
# The result is stored in cmake_uninstall_lines_NEW
# Input is 'cmake_uninstall_lines_2' created from string(REPLACE...
string(
REPLACE
"@CMAKE_COMMAND@"
"$\{CMAKE_COMMAND}"
cmake_uninstall_lines_NEW ${cmake_uninstall_lines_2} )
#write cmake_uninstall_otb.cmake
file(WRITE "${CMAKE_BINARY_DIR}/cmake_uninstall_otb.cmake"
${cmake_uninstall_lines_NEW})
#install all required files to perform uninstall
install(FILES
Files/uninstall_otb${SCRIPT_EXT}
${CMAKE_BINARY_DIR}/install_manifest_otb.txt
${CMAKE_BINARY_DIR}/cmake_uninstall_otb.cmake
DESTINATION ${PKG_STAGE_DIR}/tools)
endfunction()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment