qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1463202 - in /qpid/trunk/qpid/cpp: CMakeLists.txt bindings/qmf/python/CMakeLists.txt bindings/qmf2/python/CMakeLists.txt cmake_uninstall.cmake.in
Date Mon, 01 Apr 2013 16:47:11 GMT
Author: aconway
Date: Mon Apr  1 16:47:10 2013
New Revision: 1463202

URL: http://svn.apache.org/r1463202
Log:
QPID-4687: Add uninstall make target to cmake build

Added:
    qpid/trunk/qpid/cpp/cmake_uninstall.cmake.in
Modified:
    qpid/trunk/qpid/cpp/CMakeLists.txt
    qpid/trunk/qpid/cpp/bindings/qmf/python/CMakeLists.txt
    qpid/trunk/qpid/cpp/bindings/qmf2/python/CMakeLists.txt

Modified: qpid/trunk/qpid/cpp/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/CMakeLists.txt?rev=1463202&r1=1463201&r2=1463202&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/CMakeLists.txt Mon Apr  1 16:47:10 2013
@@ -101,6 +101,17 @@ else (OPTIONAL_ARG)
   add_custom_target(docs ALL)
 endif (OPTIONAL_ARG)
 
+# uninstall target
+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} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+
+
+# Subdirectories
 add_subdirectory(managementgen)
 add_subdirectory(src)
 add_subdirectory(etc)

Modified: qpid/trunk/qpid/cpp/bindings/qmf/python/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf/python/CMakeLists.txt?rev=1463202&r1=1463201&r2=1463202&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf/python/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf/python/CMakeLists.txt Mon Apr  1 16:47:10 2013
@@ -31,23 +31,37 @@ set_source_files_properties(${swig_gener
 ##------------------------------------
 ## Install the complete Python binding
 ##------------------------------------
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmfengine.py
-              ${CMAKE_CURRENT_SOURCE_DIR}/qmf.py
-        DESTINATION ${PYTHON_SITEARCH_PACKAGES}
-        COMPONENT ${QPID_COMPONENT_CLIENT}
-        )
+
+# Copy py source to binary dir so pyc/pyo will be generated in binary dir.
+file(COPY
+  "${CMAKE_CURRENT_SOURCE_DIR}/qmf.py"
+  DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
+
+# Python compile the modules
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmfengine.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmfengine.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmf.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmf.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+
+install(FILES
+  ${CMAKE_CURRENT_BINARY_DIR}/qmfengine.py
+  ${CMAKE_CURRENT_BINARY_DIR}/qmfengine.pyc
+  ${CMAKE_CURRENT_BINARY_DIR}/qmfengine.pyo
+  ${CMAKE_CURRENT_SOURCE_DIR}/qmf.py
+  ${CMAKE_CURRENT_BINARY_DIR}/qmf.pyc
+  ${CMAKE_CURRENT_BINARY_DIR}/qmf.pyo
+  DESTINATION ${PYTHON_SITEARCH_PACKAGES}
+  COMPONENT ${QPID_COMPONENT_CLIENT}
+  )
+
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_qmfengine_python.so
         RENAME _qmfengine.so
         DESTINATION ${PYTHON_SITEARCH_PACKAGES}
         COMPONENT ${QPID_COMPONENT_CLIENT}
         )
-# Python compile the installed modules
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmfengine.py
-                              WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmfengine.py
-                              WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmf.py
-                              WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmf.py
-                              WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
 

Modified: qpid/trunk/qpid/cpp/bindings/qmf2/python/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qmf2/python/CMakeLists.txt?rev=1463202&r1=1463201&r2=1463202&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qmf2/python/CMakeLists.txt (original)
+++ qpid/trunk/qpid/cpp/bindings/qmf2/python/CMakeLists.txt Mon Apr  1 16:47:10 2013
@@ -28,26 +28,36 @@ swig_link_libraries(cqmf2_python qmf2 ${
 
 set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing
-I${PYTHON_INCLUDE_PATH} -I${qpid-cpp_SOURCE_DIR}/include")
 
+# Move source into binary dir so compiled .pyc,pyo files will be in binary dir.
+file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/qmf2.py"
+  DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
+
+# Python compile the modules
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cqmf2.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cqmf2.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmf2.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmf2.py
+                              WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
 ##------------------------------------
 ## Install the complete Python binding
 ##------------------------------------
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.py
-              ${CMAKE_CURRENT_SOURCE_DIR}/qmf2.py
-        DESTINATION ${PYTHON_SITEARCH_PACKAGES}
-        COMPONENT ${QPID_COMPONENT_CLIENT}
-        )
+install(FILES
+  ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.py
+  ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.pyc
+  ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.pyo
+  ${CMAKE_CURRENT_SOURCE_DIR}/qmf2.py
+  ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pyc
+  ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pyo
+  DESTINATION ${PYTHON_SITEARCH_PACKAGES}
+  COMPONENT ${QPID_COMPONENT_CLIENT}
+  )
+
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_cqmf2_python.so
         RENAME _cqmf2.so
         DESTINATION ${PYTHON_SITEARCH_PACKAGES}
         COMPONENT ${QPID_COMPONENT_CLIENT}
         )
-# Python compile the installed modules
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cqmf2.py
-                              WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cqmf2.py
-                              WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile qmf2.py
-                              WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile qmf2.py
-                              WORKING_DIRECTORY ${PYTHON_SITEARCH_PACKAGES})")
 

Added: qpid/trunk/qpid/cpp/cmake_uninstall.cmake.in
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/cmake_uninstall.cmake.in?rev=1463202&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/cmake_uninstall.cmake.in (added)
+++ qpid/trunk/qpid/cpp/cmake_uninstall.cmake.in Mon Apr  1 16:47:10 2013
@@ -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}")
+list(REVERSE files)
+foreach (file ${files})
+    message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+    if (EXISTS "$ENV{DESTDIR}${file}")
+        execute_process(
+            COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
+            OUTPUT_VARIABLE rm_out
+            RESULT_VARIABLE rm_retval
+        )
+        if(NOT ${rm_retval} EQUAL 0)
+            message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+        endif (NOT ${rm_retval} EQUAL 0)
+    else (EXISTS "$ENV{DESTDIR}${file}")
+        message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+    endif (EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message