Hi!

I just wanted to share my solution to <How to "install" then "test"?> problem.

As I alredy wrote: I have a big list of (say XML) files that executables expect
to be in strictly predetermined locations. Also we need to test executables 
after
install has been done. In other words, we need "gmake test" to depends on
"gmake install"

As Eric Noulard wrote, there is an open bug 
http://public.kitware.com/Bug/view.php?id=8438
and there is no direct way to do that. But there are some tricks. Here is my 
solution:

ADD_TEST(NAME "prepInstallDir"
           COMMAND "${CMAKE_CTEST_COMMAND}"
             --build-and-test "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}"
             --build-noclean
             --build-generator "${CMAKE_GENERATOR}"
             --build-makeprogram "${CMAKE_MAKE_PROGRAM}"
             --build-target install
             --build-options 
"-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}"
             --test-command "${CMAKE_COMMAND}" -E echo Install)

ADD_TEST(NAME "testFooExe" COMMAND FooExecutable)
SET_TESTS_PROPERTIES("testFooExe" PROPERTIES DEPENDS "prepInstallDir")

Denis
--

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

Reply via email to