summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2014-03-05 20:54:27 +0000
committerAlan Conway <aconway@apache.org>2014-03-05 20:54:27 +0000
commit9666fb8bb2a5b5a10d2ba57dfc7ef7d820684fe4 (patch)
tree0307afb7f093c21376b36e01dec52ce70cee045e /cpp
parent2e647754d0a0360346375f8a812bfd765df1409d (diff)
downloadqpid-python-9666fb8bb2a5b5a10d2ba57dfc7ef7d820684fe4.tar.gz
Revert "NO-JIRA: CMakelists.txt check that ../python exists before building it."
This reverts most of commit r1574138. The changes were intended to simplify handling of setup.py by letting it detect when things were out of date, but even when there are no changes setup.py does touch some files: changing mode of /home/andrew/Work/qpid/bld-ninja/src/tests/python/commands/qpid-python-trunning install_egg_info removing /home/andrew/Work/qpid/bld-ninja/src/tests/python/qpid_python-0.27-py2.7.egg-info writing /home/andrew/Work/qpid/bld-ninja/src/tests/python/qpid_python-0.27-py2.7.egg-info This commit restores the previous logic that avoids running setup.py if not needed but retains the if (EXISTS ${python_src}) check to avoid all this logic if there is no python source directory available. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1574656 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/tests/CMakeLists.txt22
1 files changed, 16 insertions, 6 deletions
diff --git a/cpp/src/tests/CMakeLists.txt b/cpp/src/tests/CMakeLists.txt
index b2ee10df15..3f39036185 100644
--- a/cpp/src/tests/CMakeLists.txt
+++ b/cpp/src/tests/CMakeLists.txt
@@ -311,14 +311,24 @@ endif (BUILD_SASL)
set (python_src ${CMAKE_SOURCE_DIR}/../python)
if (EXISTS ${python_src})
set (python_bld ${CMAKE_CURRENT_BINARY_DIR}/python)
- add_custom_target(
- build_python ALL
- COMMAND ${PYTHON_EXECUTABLE} setup.py
+ # This will not pick up added or deleted python files
+ # In that case you need to rerun CMake
+ file(GLOB_RECURSE python_files ${python_src}/*.py)
+
+ add_custom_command(
+ OUTPUT ${python_bld}
+ DEPENDS ${python_files}
+ COMMAND ${PYTHON_EXECUTABLE}
+ setup.py
build --build-base=${python_bld}/build
- install --prefix=${python_bld} --install-lib=${python_bld}
- --install-scripts=${python_bld}/commands
+ install --prefix=${python_bld} --install-lib=${python_bld} --install-scripts=${python_bld}/commands
WORKING_DIRECTORY ${python_src}
- )
+ )
+
+ add_custom_target(
+ python_bld ALL
+ DEPENDS ${python_bld}
+ )
endif (EXISTS ${python_src})
if (BUILD_SASL)