[brlcad-commits] SF.net SVN: brlcad:[69396] brlcad/trunk/src/external/CREO
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2017-02-02 23:10:55
|
Revision: 69396 http://sourceforge.net/p/brlcad/code/69396 Author: starseeker Date: 2017-02-02 23:10:52 +0000 (Thu, 02 Feb 2017) Log Message: ----------- Use a slight variation on the CMake recommended approach to an uninstall command. Untested. Modified Paths: -------------- brlcad/trunk/src/external/CREO/CMakeLists.txt Added Paths: ----------- brlcad/trunk/src/external/CREO/cmake_uninstall.cmake.in Modified: brlcad/trunk/src/external/CREO/CMakeLists.txt =================================================================== --- brlcad/trunk/src/external/CREO/CMakeLists.txt 2017-02-02 22:02:43 UTC (rev 69395) +++ brlcad/trunk/src/external/CREO/CMakeLists.txt 2017-02-02 23:10:52 UTC (rev 69396) @@ -271,18 +271,14 @@ COMMENT "Unlocking CREO-G dll..." ) -# TODO - Need a more flexibly way to generate this target... +# Since we need to run "INSTALL" as part of normal development, it is +# worthwhile to provide an "UNINSTALL" target to automate the cleanup. +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) add_custom_target(UNINSTALL - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_MSG_DIR}/creo-brl-msg.txt" - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_RESOURCE_DIR}/creo_brl.res" - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_RESOURCE_DIR}/creo_brl_error.res" - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_RESOURCE_DIR}/creo_brl_gen_error.res" - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_DAT_DIR}/creo-brl.dat" - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_OBJ_DIR}/libbu.dll" - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_OBJ_DIR}/libbn.dll" - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_OBJ_DIR}/regex.dll" - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_OBJ_DIR}/y2038.dll" - COMMAND "${CMAKE_COMMAND}" -E remove "${CMAKE_INSTALL_PREFIX}/${MDIR}/${CREO_OBJ_DIR}/creo-brl.dll" + COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" COMMENT "Removing installed CREO-BRL components..." ) Added: brlcad/trunk/src/external/CREO/cmake_uninstall.cmake.in =================================================================== --- brlcad/trunk/src/external/CREO/cmake_uninstall.cmake.in (rev 0) +++ brlcad/trunk/src/external/CREO/cmake_uninstall.cmake.in 2017-02-02 23:10:52 UTC (rev 69396) @@ -0,0 +1,31 @@ +# Per https://cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F + +if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + message(WARNING "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt. Note: uninstall only works after install has been run.") +else(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) + string(REGEX REPLACE "\n" ";" files "${files}") + foreach(file ${files}) + message(STATUS "Uninstalling ${file}") + if(IS_SYMLINK "${file}" OR EXISTS "${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing ${file}") + endif(NOT "${rm_retval}" STREQUAL 0) + else(IS_SYMLINK "${file}" OR EXISTS "${file}") + message(STATUS "File ${file} does not exist.") + endif(IS_SYMLINK "${file}" OR EXISTS "${file}") + endforeach(file) +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +# Local Variables: +# tab-width: 8 +# mode: cmake +# indent-tabs-mode: t +# End: +# ex: shiftwidth=2 tabstop=8 + Property changes on: brlcad/trunk/src/external/CREO/cmake_uninstall.cmake.in ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |