You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by mc...@apache.org on 2013/04/29 17:11:54 UTC

svn commit: r1477135 - in /qpid/branches/0.22/qpid/cpp/bindings: CMakeLists.txt qmf/ruby/CMakeLists.txt qmf2/ruby/CMakeLists.txt qpid/ruby/CMakeLists.txt

Author: mcpierce
Date: Mon Apr 29 15:11:54 2013
New Revision: 1477135

URL: http://svn.apache.org/r1477135
Log:
QPID-4776: Fixes building Ruby bindings on Cmake < 2.8

This patch fixes issues regarding finding the Ruby install and building
the bindings for it.

Contributed by Irina Boverman <ib...@redhat.com>

Modified:
    qpid/branches/0.22/qpid/cpp/bindings/CMakeLists.txt
    qpid/branches/0.22/qpid/cpp/bindings/qmf/ruby/CMakeLists.txt
    qpid/branches/0.22/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt
    qpid/branches/0.22/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt

Modified: qpid/branches/0.22/qpid/cpp/bindings/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/bindings/CMakeLists.txt?rev=1477135&r1=1477134&r2=1477135&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/bindings/CMakeLists.txt (original)
+++ qpid/branches/0.22/qpid/cpp/bindings/CMakeLists.txt Mon Apr 29 15:11:54 2013
@@ -24,6 +24,14 @@ include(FindRuby)
 include(FindPythonLibs)
 include(FindPerlLibs)
 
+if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+  if (RUBY_INCLUDE_PATH)
+    set(RUBY_FOUND "TRUE")
+  else()
+    set(RUBY_FOUND "FALSE")
+  endif (RUBY_INCLUDE_PATH)
+endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+
 set (SWIG_MINIMUM_VERSION "1.3.32")
 
 if (SWIG_FOUND)
@@ -33,6 +41,7 @@ if (SWIG_FOUND)
     set(CMAKE_SWIG_FLAGS "-w361,362,401,467,503")
 
     if (PYTHONLIBS_FOUND)
+        message("Building Python bindings")
         execute_process(COMMAND ${PYTHON_EXECUTABLE}
                         -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True, prefix='${CMAKE_INSTALL_PREFIX}')"
                         OUTPUT_VARIABLE PYTHON_SITEARCH_PACKAGES
@@ -44,17 +53,19 @@ if (SWIG_FOUND)
     endif (PYTHONLIBS_FOUND)
 
     if (RUBY_FOUND)
+        message("Building Ruby bindings")
         execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG['prefix']"
                         OUTPUT_VARIABLE RUBY_PREFIX
                         OUTPUT_STRIP_TRAILING_WHITESPACE)
-        string(REPLACE ${RUBY_PREFIX} ${CMAKE_INSTALL_PREFIX} RUBY_PFX_ARCH_DIR ${RUBY_ARCH_DIR})
-
+        string(REPLACE ${RUBY_PREFIX} ${CMAKE_INSTALL_PREFIX} RUBY_PFX_ARCH_DIR ${RUBY_SITEARCH_DIR})
+#       string(REPLACE ${RUBY_PREFIX} ${CMAKE_INSTALL_PREFIX} RUBY_PFX_ARCH_DIR ${RUBY_ARCH_DIR})
         add_subdirectory(qpid/ruby)
         add_subdirectory(qmf2/ruby)
         add_subdirectory(qmf/ruby)
     endif (RUBY_FOUND)
 
     if (PERLLIBS_FOUND)
+        message("Building Perl bindings")
         execute_process(COMMAND ${PERL_EXECUTABLE} "-V::prefix:"
                         OUTPUT_VARIABLE QPERL_PREFIX
                         OUTPUT_STRIP_TRAILING_WHITESPACE)

Modified: qpid/branches/0.22/qpid/cpp/bindings/qmf/ruby/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/bindings/qmf/ruby/CMakeLists.txt?rev=1477135&r1=1477134&r2=1477135&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/bindings/qmf/ruby/CMakeLists.txt (original)
+++ qpid/branches/0.22/qpid/cpp/bindings/qmf/ruby/CMakeLists.txt Mon Apr 29 15:11:54 2013
@@ -22,6 +22,10 @@
 ##------------------------------------------------------
 set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON)
 
+if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+  set (RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_PATH})
+endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+
 include_directories(${RUBY_INCLUDE_DIRS}
                     ${qpid-cpp_SOURCE_DIR}/include
                     ${qpid-cpp_SOURCE_DIR}/bindings)
@@ -32,8 +36,16 @@ swig_link_libraries(qmfengine_ruby qmf q
 ##----------------------------------
 ## Install the complete Ruby binding
 ##----------------------------------
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libqmfengine_ruby.so
+if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmfengine_ruby.so
+        RENAME qmfengine.so
+        DESTINATION ${RUBY_PFX_ARCH_DIR}
+        COMPONENT ${QPID_COMPONENT_CLIENT}
+        )
+else()
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libqmfengine_ruby.so
         RENAME qmfengine.so
         DESTINATION ${RUBY_PFX_ARCH_DIR}
         COMPONENT ${QPID_COMPONENT_CLIENT}
         )
+endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))

Modified: qpid/branches/0.22/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt?rev=1477135&r1=1477134&r2=1477135&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt (original)
+++ qpid/branches/0.22/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt Mon Apr 29 15:11:54 2013
@@ -22,6 +22,10 @@
 ##------------------------------------------------------
 set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON)
 
+if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+  set (RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_PATH})
+endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+
 include_directories(${RUBY_INCLUDE_DIRS}
                     ${qpid-cpp_SOURCE_DIR}/include
                     ${qpid-cpp_SOURCE_DIR}/bindings)
@@ -32,9 +36,17 @@ swig_link_libraries(cqmf2_ruby qmf2 ${RU
 ##----------------------------------
 ## Install the complete Ruby binding
 ##----------------------------------
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqmf2_ruby.so
+if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqmf2_ruby.so
+        RENAME cqmf2.so
+        DESTINATION ${RUBY_PFX_ARCH_DIR}
+        COMPONENT ${QPID_COMPONENT_CLIENT}
+        )
+else()
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqmf2_ruby.so
         RENAME cqmf2.so
         DESTINATION ${RUBY_PFX_ARCH_DIR}
         COMPONENT ${QPID_COMPONENT_CLIENT}
         )
+endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
 

Modified: qpid/branches/0.22/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/0.22/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt?rev=1477135&r1=1477134&r2=1477135&view=diff
==============================================================================
--- qpid/branches/0.22/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt (original)
+++ qpid/branches/0.22/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt Mon Apr 29 15:11:54 2013
@@ -31,6 +31,10 @@ set(GEM_OUTPUT_FILE ${GEM_OUTPUT_PATH}/p
 ##------------------------------------------------------
 set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON)
 
+if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+  set (RUBY_INCLUDE_DIRS ${RUBY_INCLUDE_PATH})
+endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+
 include_directories(${RUBY_INCLUDE_DIRS}
                     ${qpid-cpp_SOURCE_DIR}/include
                     ${qpid-cpp_SOURCE_DIR}/bindings)
@@ -43,11 +47,19 @@ set_source_files_properties(${swig_gener
 ##----------------------------------
 ## Install the complete Ruby binding
 ##----------------------------------
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqpid_ruby.so
+if ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqpid_ruby.so
+        RENAME cqpid.so
+        DESTINATION ${RUBY_PFX_ARCH_DIR}
+        COMPONENT ${QPID_COMPONENT_CLIENT}
+        )
+else()
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqpid_ruby.so
         RENAME cqpid.so
         DESTINATION ${RUBY_PFX_ARCH_DIR}
         COMPONENT ${QPID_COMPONENT_CLIENT}
         )
+endif ((${CMAKE_MAJOR_VERSION} EQUAL 2) AND (${CMAKE_MINOR_VERSION} LESS 8))
 
 add_custom_command(OUTPUT ${GEM_BINDINGS_SOURCE_FILE}
                    COMMAND cp ${swig_generated_file_fullname} ${GEM_BINDINGS_SOURCE_FILE}



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