[CMake] ADD_TEST and EXECUTABLE_OUTPUT_PATH

j.bedouet@infonie.fr j.bedouet at infonie.fr
Fri Mar 28 17:50:05 EDT 2008


Hello,

First, I'm new on this mailing-list and I would like to
thank you for your fantastic product. I have used it for
less a year and I love it.

In one of my projects, I need to run a test from a specific
working directory (to read data files). I made
GET_TARGET_PROPERTY (TARGET_LOCATION target LOCATION)
ADD_TEST (test ${CMAKE_COMMAND} -E chdir ${DATA_DIR}
${TARGET_LOCATION})

But now, I would like to generate Visual Studio projects and
run tests from Visual. Unfortunately, ${TARGET_LOCATION} is
valued at .../$(OutDir)/target.exe (with Visual Studio .NET
2003 and CMake 2.4.8). I know it's wanted.

If I use
ADD_TEST (test ${EXECUTABLE_OUTPUT_PATH}/target)
$(OutDir) is replaced by debug or release but the working
directory is incorrect.
If I write
ADD_TEST (test ${CMAKE_COMMAND} -E chdir ${DATA_DIR}
${EXECUTABLE_OUTPUT_PATH}/target)
$(OutDir) is not replaced.

So, my questions are:
1) If the test command line doesn't begin with
${EXECUTABLE_OUTPUT_PATH}, this variable is not replaced. I
suppose it's the specified behaviour. Am I right ?
2) Have I to pass the data directory as an argument of the
test executable ? Can I run a test from a specific working
directory ?
3) I have downloaded the last CMake 2.5. I read that
EXECUTABLE_OUTPUT_PATH is deprecated and
RUNTIME_OUTPUT_DIRECTORY is preferred but which is the
better way to run test from CMake ?

Thanks in advance,

J.B.


---------------------- ALICE C'EST ENCORE MIEUX AVEC LA MUSIQUE ! --------------------
Découvrez vite l'offre exclusive ALICE BOX avec ALICE MUSIC, le téléchargement légal et illimité
de plus de 300 000 titres ! En cliquant ici http://alicemusic.aliceadsl.fr
Offre soumise à conditions




More information about the CMake mailing list