Commit ed80d16b authored by Rashad Kanavath's avatar Rashad Kanavath

PKG: x-plaform uninstall script (uses cmake)

parent 34c27fd2
:: uninstall script for OTB
set CUR_DIR=%~dp0
cmake -S OUT_DIR/cmake_uninstall_otb.cmake -DMY_INSTALL_DIR=%CUR_DIR%
del %CUR_DIR%mapla.bat
del %CUR_DIR%monteverdi.bat
echo "OTB is now uninstalled from %CUR_DIR%"
......@@ -19,7 +19,7 @@
# limitations under the License.
#
xargs rm -frv OUT_DIR/install_manifest.txt
cmake -S OUT_DIR/cmake_uninstall_otb.cmake -DMY_INSTALL_DIR=OUT_DIR
rm -f OUT_DIR/mapla.sh
rm -f OUT_DIR/monteverdi.sh
echo "OTB is now uninstalled from OUT_DIR"
......@@ -68,23 +68,49 @@ macro(installer_files)
install( PROGRAMS "${PATCHELF_PROGRAM}"
DESTINATION ${PKG_STAGE_DIR})
endif()
file(READ "${OTB_BINARY_DIR}/install_manifest.txt" mfile_lines)
string(
REPLACE
"${CMAKE_INSTALL_PREFIX}"
"OUT_DIR"
"$\{MY_INSTALL_DIR}"
mfile_lines_NEW ${mfile_lines} )
file(WRITE "${CMAKE_BINARY_DIR}/install_manifest.txt"
file(WRITE "${CMAKE_BINARY_DIR}/install_manifest_otb.txt"
${mfile_lines_NEW})
install(FILES "${CMAKE_BINARY_DIR}/install_manifest.txt"
DESTINATION ${PKG_STAGE_DIR})
#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_NEW
# Input is 'cmake_uninstall_lines_1' created from string(REPLACE...
string(
REPLACE
"@CMAKE_BINARY_DIR@"
"$\{MY_INSTALL_DIR}"
cmake_uninstall_lines_NEW ${cmake_uninstall_lines_1} )
#write cmake_uninstall_otb.cmake
file(WRITE "${CMAKE_BINARY_DIR}/cmake_uninstall_otb.cmake"
${cmake_uninstall_lines_NEW})
install(FILES "Files/uninstall_otb.sh"
#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})
#add otb_loader
add_executable(otb_loader ${CMAKE_CURRENT_SOURCE_DIR}/Files/otb_loader.cxx)
target_link_libraries(otb_loader ${CMAKE_DL_LIBS})
install(TARGETS otb_loader DESTINATION ${PKG_STAGE_DIR}/bin)
......
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