Mathieu Malaterre wrote:
Hi there,
I'd like to know if this is possible to execute a cmake custom
target from my nightly ctest script.
Eg. In cmake
...
ADD_CUSTOM_COMMAND(
OUTPUT bla.txt
COMMAND echo "bla" > bla.txt
VERBATIM
)
ADD_CUSTOM_TARGET(BLA DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bla.txt)
...
For now I am copy/pasting this as an execute_process:
...
CTEST_START(Nightly)
CTEST_UPDATE(SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
# duplicated code:
EXECUTE_PROCESS(COMMAND echo "bla" > bla.txt
OUTPUT_FILE bla.txt
RESULT_VARIABLE RES)
CTEST_SUBMIT(RETURN_VALUE res)
...
This should do what you want:
SET( CTEST_BUILD_TARGET BLA)
CTEST_BUILD (
BUILD "${CTEST_BINARY_DIRECTORY}"
APPEND
)
-Bill
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake