From 4b1aaf78d8d9748c0f3d0e0cc4ccb30601f7358e Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 6 Jan 2014 19:33:10 +0000 Subject: NO-JIRA: Install python code as part of cmake make phase Previosly the qpid/python code was being installed only during cmake configuration phase and was not updated if the python code changed later. Added a custom target to run setup.py whenever make is run. setup.py is smart enough not to do un-necessary work if the python files have not changed. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1555989 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/CMakeLists.txt | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/tests/CMakeLists.txt b/qpid/cpp/src/tests/CMakeLists.txt index 125982a26e..252babff91 100644 --- a/qpid/cpp/src/tests/CMakeLists.txt +++ b/qpid/cpp/src/tests/CMakeLists.txt @@ -300,16 +300,12 @@ if (BUILD_SASL) remember_location(sasl_version) endif (BUILD_SASL) -# This should ideally be done as part of the test run, but I don't know a way -# to get these arguments and the working directory set like Makefile.am does, -# and have that run during the test pass. -# -# Need to check to see that the python tools are included as part of the source -# tree first and don't install them or run dependent tests if they are not there -# +# Always run the python install, setup.py is smart enough to do only what is needed. set (python_bld ${CMAKE_CURRENT_BINARY_DIR}/python) -execute_process(COMMAND ${PYTHON_EXECUTABLE} setup.py install --prefix=${pythoon_bld} --install-lib=${python_bld} --install-scripts=${python_bld}/commands - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../python) +set (python_src ${CMAKE_SOURCE_DIR}/../python) +add_custom_target(python_bld ALL + COMMAND ${PYTHON_EXECUTABLE} setup.py install --prefix=${python_bld} --install-lib=${python_bld} --install-scripts=${python_bld}/commands + WORKING_DIRECTORY ${python_src}) if (BUILD_SASL) add_test (sasl_fed ${test_wrap} -- ${CMAKE_CURRENT_SOURCE_DIR}/sasl_fed${test_script_suffix}) -- cgit v1.2.1