diff options
| author | Andrew Stitcher <astitcher@apache.org> | 2011-11-03 14:32:01 +0000 |
|---|---|---|
| committer | Andrew Stitcher <astitcher@apache.org> | 2011-11-03 14:32:01 +0000 |
| commit | 063f1124a86299ac774b11cbcfe455fbe9ec0d55 (patch) | |
| tree | 5e122f976359ed492f84b2b87369633595bcd797 /qpid/cpp/bindings | |
| parent | 85b266fe8875fd8750f0f7808f2ad840ad249821 (diff) | |
| download | qpid-python-063f1124a86299ac774b11cbcfe455fbe9ec0d55.tar.gz | |
QPID-3464: Build Improvements (CMake) [from Jan-Marek Glogowski]
- Improved CMake build significantly bringing it closer in parity to
autotools build
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1197146 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/bindings')
| -rw-r--r-- | qpid/cpp/bindings/qmf/CMakeLists.txt | 37 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qmf/python/CMakeLists.txt | 58 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qmf/ruby/CMakeLists.txt | 38 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qmf2/CMakeLists.txt | 37 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qmf2/python/CMakeLists.txt | 58 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt | 39 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qpid/perl/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qpid/python/CMakeLists.txt | 11 | ||||
| -rw-r--r-- | qpid/cpp/bindings/qpid/ruby/CMakeLists.txt | 8 |
9 files changed, 280 insertions, 8 deletions
diff --git a/qpid/cpp/bindings/qmf/CMakeLists.txt b/qpid/cpp/bindings/qmf/CMakeLists.txt new file mode 100644 index 0000000000..5e40539e80 --- /dev/null +++ b/qpid/cpp/bindings/qmf/CMakeLists.txt @@ -0,0 +1,37 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + +include(FindSWIG) +include(UseSWIG) +include(FindRuby) +include(FindPythonLibs) +include(FindPerlLibs) + +if (SWIG_FOUND) + set(CMAKE_SWIG_FLAGS "-w362,401") + + if (PYTHONLIBS_FOUND) + add_subdirectory(python) + endif (PYTHONLIBS_FOUND) + + if (RUBY_FOUND) + add_subdirectory(ruby) + endif (RUBY_FOUND) +endif (SWIG_FOUND) diff --git a/qpid/cpp/bindings/qmf/python/CMakeLists.txt b/qpid/cpp/bindings/qmf/python/CMakeLists.txt new file mode 100644 index 0000000000..9bc6b2e878 --- /dev/null +++ b/qpid/cpp/bindings/qmf/python/CMakeLists.txt @@ -0,0 +1,58 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +##------------------------------------------------------ +## Use Swig to generate a literal binding to the C++ API +##------------------------------------------------------ +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES CPLUSPLUS ON) +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include") + +swig_add_module(qmfengine_python python ${CMAKE_CURRENT_SOURCE_DIR}/python.i) +swig_link_libraries(qmfengine_python qmf qmfconsole ${PYTHON_LIBRARIES}) + +set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I${PYTHON_INCLUDE_PATH} -I${qpid-cpp_SOURCE_DIR}/include") + +##------------------------------------ +## Install the complete Python binding +##------------------------------------ +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE) +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})") +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/qmf.py DESTINATION ${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_SITE_PACKAGES} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_qmfengine_python.so + RENAME _qmfengine.so + DESTINATION ${PYTHON_SITE_PACKAGES} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) + diff --git a/qpid/cpp/bindings/qmf/ruby/CMakeLists.txt b/qpid/cpp/bindings/qmf/ruby/CMakeLists.txt new file mode 100644 index 0000000000..4b6ba2c1c3 --- /dev/null +++ b/qpid/cpp/bindings/qmf/ruby/CMakeLists.txt @@ -0,0 +1,38 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +##------------------------------------------------------ +## Use Swig to generate a literal binding to the C++ API +##------------------------------------------------------ +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON) +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include") + +swig_add_module(qmfengine_ruby ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i) +swig_link_libraries(qmfengine_ruby qmf qmfconsole ${RUBY_LIBRARY}) + +set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-I${RUBY_INCLUDE_DIR} -I${qpid-cpp_SOURCE_DIR}/include") + +##---------------------------------- +## Install the complete Ruby binding +##---------------------------------- +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libqmfengine_ruby.so + RENAME qmfengine.so + DESTINATION ${RUBY_ARCH_DIR} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) diff --git a/qpid/cpp/bindings/qmf2/CMakeLists.txt b/qpid/cpp/bindings/qmf2/CMakeLists.txt new file mode 100644 index 0000000000..5e40539e80 --- /dev/null +++ b/qpid/cpp/bindings/qmf2/CMakeLists.txt @@ -0,0 +1,37 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + + +include(FindSWIG) +include(UseSWIG) +include(FindRuby) +include(FindPythonLibs) +include(FindPerlLibs) + +if (SWIG_FOUND) + set(CMAKE_SWIG_FLAGS "-w362,401") + + if (PYTHONLIBS_FOUND) + add_subdirectory(python) + endif (PYTHONLIBS_FOUND) + + if (RUBY_FOUND) + add_subdirectory(ruby) + endif (RUBY_FOUND) +endif (SWIG_FOUND) diff --git a/qpid/cpp/bindings/qmf2/python/CMakeLists.txt b/qpid/cpp/bindings/qmf2/python/CMakeLists.txt new file mode 100644 index 0000000000..2e71ca34e7 --- /dev/null +++ b/qpid/cpp/bindings/qmf2/python/CMakeLists.txt @@ -0,0 +1,58 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +##------------------------------------------------------ +## Use Swig to generate a literal binding to the C++ API +##------------------------------------------------------ +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES CPLUSPLUS ON) +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include") + +swig_add_module(cqmf2_python python ${CMAKE_CURRENT_SOURCE_DIR}/python.i) +swig_link_libraries(cqmf2_python qmf2 ${PYTHON_LIBRARIES}) + +set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I${PYTHON_INCLUDE_PATH} -I${qpid-cpp_SOURCE_DIR}/include") + +##------------------------------------ +## Install the complete Python binding +##------------------------------------ +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE) +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})") +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/qmf2.py DESTINATION ${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(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.py + ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.pyc + ${CMAKE_CURRENT_BINARY_DIR}/cqmf2.pyo + ${CMAKE_CURRENT_BINARY_DIR}/qmf2.py + ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pyc + ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pyo + DESTINATION ${PYTHON_SITE_PACKAGES} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_cqmf2_python.so + RENAME _cqmf2.so + DESTINATION ${PYTHON_SITE_PACKAGES} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) + diff --git a/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt b/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt new file mode 100644 index 0000000000..3bc97cf35f --- /dev/null +++ b/qpid/cpp/bindings/qmf2/ruby/CMakeLists.txt @@ -0,0 +1,39 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +##------------------------------------------------------ +## Use Swig to generate a literal binding to the C++ API +##------------------------------------------------------ +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON) +set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include") + +swig_add_module(cqmf2_ruby ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i) +swig_link_libraries(cqmf2_ruby qmf2 ${RUBY_LIBRARY}) + +set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-I${RUBY_INCLUDE_DIR} -I${qpid-cpp_SOURCE_DIR}/include") + +##---------------------------------- +## Install the complete Ruby binding +##---------------------------------- +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqmf2_ruby.so + RENAME cqmf2.so + DESTINATION ${RUBY_ARCH_DIR} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) + diff --git a/qpid/cpp/bindings/qpid/perl/CMakeLists.txt b/qpid/cpp/bindings/qpid/perl/CMakeLists.txt index 6edaf284b1..0d66c144db 100644 --- a/qpid/cpp/bindings/qpid/perl/CMakeLists.txt +++ b/qpid/cpp/bindings/qpid/perl/CMakeLists.txt @@ -33,6 +33,6 @@ set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_F ##---------------------------------- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqpid_perl.so ${CMAKE_CURRENT_BINARY_DIR}/cqpid_perl.pm - DESTINATION ${PERL_VENDORARCH} + DESTINATION ${PERL_ARCHLIB} COMPONENT ${QPID_COMPONENT_CLIENT} ) diff --git a/qpid/cpp/bindings/qpid/python/CMakeLists.txt b/qpid/cpp/bindings/qpid/python/CMakeLists.txt index 5e4649cd7c..9cb40162a5 100644 --- a/qpid/cpp/bindings/qpid/python/CMakeLists.txt +++ b/qpid/cpp/bindings/qpid/python/CMakeLists.txt @@ -23,8 +23,8 @@ set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES CPLUSPLUS ON) set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/python.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include") -swig_add_module(cqpid python ${CMAKE_CURRENT_SOURCE_DIR}/python.i) -swig_link_libraries(cqpid qpidmessaging qpidtypes qmf2 ${PYTHON_LIBRARIES}) +swig_add_module(cqpid_python python ${CMAKE_CURRENT_SOURCE_DIR}/python.i) +swig_link_libraries(cqpid_python qpidmessaging qpidtypes qmf2 ${PYTHON_LIBRARIES}) set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I${PYTHON_INCLUDE_PATH} -I${qpid-cpp_SOURCE_DIR}/include") @@ -39,7 +39,12 @@ install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cqpi install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cqpid.py ${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyc ${CMAKE_CURRENT_BINARY_DIR}/cqpid.pyo - ${CMAKE_CURRENT_BINARY_DIR}/_cqpid.so DESTINATION ${PYTHON_SITE_PACKAGES} COMPONENT ${QPID_COMPONENT_CLIENT} ) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_cqpid_python.so + RENAME _cqpid.so + DESTINATION ${PYTHON_SITE_PACKAGES} + COMPONENT ${QPID_COMPONENT_CLIENT} + ) + diff --git a/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt b/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt index 25258cfc6a..8a8c88b595 100644 --- a/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt +++ b/qpid/cpp/bindings/qpid/ruby/CMakeLists.txt @@ -32,17 +32,17 @@ set(GEM_OUTPUT_FILE ${GEM_OUTPUT_PATH}/pkg/qpid-${qpidc_version}.0.gem) set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES CPLUSPLUS ON) set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ruby.i PROPERTIES SWIG_FLAGS "-I${qpid-cpp_SOURCE_DIR}/include") -swig_add_module(cqpid ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i) -swig_link_libraries(cqpid qpidmessaging qpidtypes qmf2 ${RUBY_LIBRARY}) +swig_add_module(cqpid_ruby ruby ${CMAKE_CURRENT_SOURCE_DIR}/ruby.i) +swig_link_libraries(cqpid_ruby qpidmessaging qpidtypes qmf2 ${RUBY_LIBRARY}) set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -I${RUBY_INCLUDE_DIR} -I${qpid-cpp_SOURCE_DIR}/include") ##---------------------------------- ## Install the complete Ruby binding ##---------------------------------- -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqpid.so +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libcqpid_ruby.so RENAME cqpid.so - DESTINATION ${RUBY_SITEARCH_DIR} + DESTINATION ${RUBY_ARCH_DIR} COMPONENT ${QPID_COMPONENT_CLIENT} ) |
