You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2014/11/26 21:06:12 UTC
[25/35] qpid-proton git commit: restructured cmake file to support
multiple sources
restructured cmake file to support multiple sources
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/19130401
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/19130401
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/19130401
Branch: refs/heads/examples
Commit: 1913040155414f7fb037a0584a9dafa4a14533f0
Parents: f5cbab5
Author: Rafael Schloming <rh...@alum.mit.edu>
Authored: Sat Nov 22 05:25:57 2014 -0500
Committer: Rafael Schloming <rh...@alum.mit.edu>
Committed: Sat Nov 22 06:03:01 2014 -0500
----------------------------------------------------------------------
proton-c/bindings/python/CMakeLists.txt | 32 ++++++++++++++++------------
1 file changed, 18 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/19130401/proton-c/bindings/python/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/CMakeLists.txt b/proton-c/bindings/python/CMakeLists.txt
index c7eb4aa..6ab1e67 100644
--- a/proton-c/bindings/python/CMakeLists.txt
+++ b/proton-c/bindings/python/CMakeLists.txt
@@ -52,14 +52,23 @@ if (NOT PYTHON_SITEARCH_PACKAGES)
set (PYTHON_SITEARCH_PACKAGES ${PYTHON_SITEARCH_PACKAGES_DEFAULT})
endif()
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile cproton.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile cproton.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile proton.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})")
-install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile proton.py
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})")
+set (pysrc-generated cproton.py)
+set (pysrc proton.py)
+
+macro (py_compile directory files)
+ foreach (src_file ${files})
+ install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m py_compile ${src_file}
+ WORKING_DIRECTORY ${directory})")
+ install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -O -m py_compile ${src_file}
+ WORKING_DIRECTORY ${directory})")
+ list(APPEND PYTHON_ARTIFACTS ${directory}/${src_file}
+ ${directory}/${src_file}c
+ ${directory}/${src_file}o)
+ endforeach (src_file)
+endmacro(py_compile)
+
+py_compile(${CMAKE_CURRENT_BINARY_DIR} ${pysrc-generated})
+py_compile(${CMAKE_CURRENT_SOURCE_DIR} ${pysrc})
find_program(EPYDOC_EXE epydoc)
mark_as_advanced (EPYDOC_EXE)
@@ -75,12 +84,7 @@ if (EPYDOC_EXE)
${OPTIONAL_ARG})
endif (EPYDOC_EXE)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cproton.py
- ${CMAKE_CURRENT_BINARY_DIR}/cproton.pyc
- ${CMAKE_CURRENT_BINARY_DIR}/cproton.pyo
- ${CMAKE_CURRENT_SOURCE_DIR}/proton.py
- ${CMAKE_CURRENT_SOURCE_DIR}/proton.pyc
- ${CMAKE_CURRENT_SOURCE_DIR}/proton.pyo
+install(FILES ${PYTHON_ARTIFACTS}
DESTINATION ${PYTHON_SITEARCH_PACKAGES}
COMPONENT Python)
install(TARGETS ${SWIG_MODULE_cproton_REAL_NAME}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org