From 03e86eb4e4e93e989b692193ed8f3116e07695f2 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 5 Mar 2014 20:54:27 +0000 Subject: 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@1574656 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/CMakeLists.txt | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'qpid/cpp/src/tests') diff --git a/qpid/cpp/src/tests/CMakeLists.txt b/qpid/cpp/src/tests/CMakeLists.txt index b2ee10df15..3f39036185 100644 --- a/qpid/cpp/src/tests/CMakeLists.txt +++ b/qpid/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) -- cgit v1.2.1