From 50e72aebc388e4be4448eccf641dfcf91e838a8d Mon Sep 17 00:00:00 2001 From: Stephen Roderick Date: Sun, 12 Jun 2011 19:06:08 -0400 Subject: [PATCH 1/2] cmake: Copy test files to support running from build dir --- config/TestUsesFile.cmake | 8 ++++++++ deployment/tests/CMakeLists.txt | 6 +++++- 2 files changed, 13 insertions(+), 1 deletions(-) create mode 100644 config/TestUsesFile.cmake diff --git a/config/TestUsesFile.cmake b/config/TestUsesFile.cmake new file mode 100644 index 0000000..9e7e8bf --- /dev/null +++ b/config/TestUsesFile.cmake @@ -0,0 +1,8 @@ + +# This basically copies a file to the build directory. +MACRO( TEST_USES_FILE FILE ) + message("COMMAND copy ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} -> ${CMAKE_CURRENT_BINARY_DIR}/${FILE}") + CONFIGURE_FILE( + "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}" + "${CMAKE_CURRENT_BINARY_DIR}/${FILE}" COPYONLY) +ENDMACRO( TEST_USES_FILE FILE ) diff --git a/deployment/tests/CMakeLists.txt b/deployment/tests/CMakeLists.txt index 4343c2e..d5e3fc4 100644 --- a/deployment/tests/CMakeLists.txt +++ b/deployment/tests/CMakeLists.txt @@ -1,8 +1,9 @@ -DEPENDENT_OPTION( BUILD_DEPLOYMENT_TEST "Build Deployment Test" ON "BUILD_DEPLOYMENT;BUILD_TESTS" OFF) +DEPENDENT_OPTION( BUILD_DEPLOYMENT_TEST "Build Deployment Test" ON "BUILD_DEPLOYMENT;BUILD_TASKBROWSER;BUILD_TESTS" OFF) IF ( BUILD_DEPLOYMENT_TEST ) + INCLUDE(TestUsesFile) # This gathers all the .cpp files into the variable 'SRCS' FILE( GLOB SRCS [^.]*.cpp ) @@ -10,4 +11,7 @@ IF ( BUILD_DEPLOYMENT_TEST ) # Use TARGET_LINK_LIBRARIES( report libs... ) to add library deps. PROGRAM_ADD_DEPS( deploy orocos-taskbrowser orocos-deployment ) + # Copy this file to build dir. + TEST_USES_FILE( deployment.cpf ) + ENDIF ( BUILD_DEPLOYMENT_TEST ) -- 1.7.4.4