On 02/14/2017 10:54 AM, Giel van Schijndel wrote:
> I think it may be easier to do this inside CMake by generating the "new"
> form of the add_test() command in the produced CTestTestfile.cmake. From
> some experiments I've got the impression that that's always executed
> with paths relative to the directory containing the CTestTestfile.cmake.
> Although I only tested without setting the WORKING_DIRECTORY test
> property, I'm not sure how or if that property could work in this
> context.
IIRC add_test just runs the command as specified so a relative path
will be relative to the working directory. That will break when using
the WORKING_DIRECTORY property.
Instead of generating a relative path for this use case, we could generate
an absolute path that is constructed with a variable like a literal
`${CMAKE_CURRENT_LIST_DIR}` in the CTestTestfile.cmake. You'll have to
dig in a bit to figure out what the right placeholder is. That way
CTest can construct the absolute path for the command line on the
CI system.
-Brad
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers