certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi CMakeLists.txt cmake_uninstall.cmake.in


From: CERTI CVS commits
Subject: [certi-cvs] certi CMakeLists.txt cmake_uninstall.cmake.in
Date: Tue, 26 Jul 2011 10:12:07 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      11/07/26 10:12:07

Modified files:
        .              : CMakeLists.txt 
Added files:
        .              : cmake_uninstall.cmake.in 

Log message:
        Add Uninstall target.
        Contribution from Charles on the ML.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/CMakeLists.txt?cvsroot=certi&r1=1.103&r2=1.104
http://cvs.savannah.gnu.org/viewcvs/certi/cmake_uninstall.cmake.in?cvsroot=certi&rev=1.1

Patches:
Index: CMakeLists.txt
===================================================================
RCS file: /sources/certi/certi/CMakeLists.txt,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -b -r1.103 -r1.104
--- CMakeLists.txt      26 Jul 2011 09:27:18 -0000      1.103
+++ CMakeLists.txt      26 Jul 2011 10:12:07 -0000      1.104
@@ -533,3 +533,7 @@
 ELSE (WIN32)
   MESSAGE(STATUS "*** CERTI has been successfully configured ********")
 ENDIF (WIN32)
+
+### Uninstall ###
+configure_file("${CMAKE_HOME_DIRECTORY}/cmake_uninstall.cmake.in" 
"cmake_uninstall.cmake" IMMEDIATE @ONLY)
+add_custom_target(uninstall "${CMAKE_COMMAND}" -P "cmake_uninstall.cmake")

Index: cmake_uninstall.cmake.in
===================================================================
RCS file: cmake_uninstall.cmake.in
diff -N cmake_uninstall.cmake.in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ cmake_uninstall.cmake.in    26 Jul 2011 10:12:07 -0000      1.1
@@ -0,0 +1,22 @@
+IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+  MESSAGE(FATAL_ERROR "Cannot find install manifest: 
\"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+ENDIF(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 \"$ENV{DESTDIR}${file}\"")
+  IF(EXISTS "$ENV{DESTDIR}${file}")
+    EXEC_PROGRAM(
+      "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+      OUTPUT_VARIABLE rm_out
+      RETURN_VALUE rm_retval
+      )
+    IF("${rm_retval}" STREQUAL 0)
+    ELSE("${rm_retval}" STREQUAL 0)
+      MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+    ENDIF("${rm_retval}" STREQUAL 0)
+  ELSE(EXISTS "$ENV{DESTDIR}${file}")
+    MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+  ENDIF(EXISTS "$ENV{DESTDIR}${file}")
+ENDFOREACH(file)
\ No newline at end of file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]