[CMake] CTest not searching for the correct executable

Saad Khattak saadrustam at gmail.com
Fri Jan 5 11:11:56 EST 2018


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?

Regards,
Saad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180105/73b5566c/attachment.html>


More information about the CMake mailing list