[CMake] ExternalProjectDependency (artichoke) and ctest

jmerkow jmerkow at gmail.com
Mon Nov 3 17:46:01 EST 2014


Hello,

My project is using ExternalProjectDependency from [1]. I know that is not a
kitware/cmake project, but I thought Id ask here anyway....
I have been using testing (ctest) with it by adding tests in the top level
build with hard-coded directories and names (these targets aren't built
until the non-superbuild project is built).  I wanted to move the tests to
the non-superbuild portion of the code so I can use generator expressions,
but I am having some trouble.

Basically, what I am doing is to include ctest in the non-superbuild portion
then add a custom target.  This works for 'make test' but does not work with
ctest. 

add_custom_target(test)
add_custom_command(TARGET test POST_BUILD
COMMAND ${CMAKE_COMMAND} --build ${${PROJECT_NAME}_BINARY_DIR}/build
--target test)

ExternalProjectDependency added a function to add install:
'ExternalProject_Install_CMake' I don't see a similar function for testing.
Is there another good way to do this?  Im not sure what ctest calls to
initiate testing, using that info, I might be able to get a good work
around.

-Jameson

[1] https://github.com/commontk/Artichoke



--
View this message in context: http://cmake.3232098.n2.nabble.com/ExternalProjectDependency-artichoke-and-ctest-tp7588929.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list