On 05.01.2018 17:11, Saad Khattak wrote:
Hi,
Suppose I have something like this:
add_executable(MyTest main.cpp)
set_target_properties(MyTest
PROPERTIES
DEBUG_POSTFIX _d
RELEASE_POSTFIX _r
)
add_test(RunTests MyTest) # where MyTest is the <command>
I expect CMake to recognize that "MyTest" has executables that are
named "MyTest_d" and "MyTest_r" and NOT MyTest. I expect this because
in the CMake documentation the <command> can be an executable target
where CMake then replaces it with the location of the executable.
However, what I get is errors when running "ctest" where it complains
that it cannot find "MyTest" when it should really be searching for
"MyTest_d" and "MyTest_r".
Am I doing something wrong or is this a bug in CMake?
You are using the old signature (without NAME|COMMAND) for which the
documentation states [1]:
"Unlike the above |NAME| signature no transformation is performed
on the command-line to support target names or generator expressions."
Use the new signature instead e.g.:
add_test(NAME RunTests COMMAND MyTest)
Nils
[1] https://cmake.org/cmake/help/latest/command/add_test.html
--
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:
https://cmake.org/mailman/listinfo/cmake