Re: [CMake] CMakeLists.txt: How to print a message if ctest fails?

2016-04-19 Thread Muhammad Osama
Hi Miroslav, That makes sense, is there a way I can make ctest -S CTestScript.cmake command replace the regular ctest? I don't want users who run ctest type the whole thing. Thank you, On Tue, Apr 19, 2016 at 1:18 AM, Matějů Miroslav, Ing. < mateju.miros...@azd.cz> wrote: > Hi Muhammad, > > >

Re: [CMake] CMakeLists.txt: How to print a message if ctest fails?

2016-04-19 Thread Matějů Miroslav , Ing .
Hi Muhammad, You need to add this code to a separate CTest script (CTestScript.cmake, for example) and then run it using ctest -S CTestScript.cmake. Since the wiki page I linked yesterday provides only some complex examples, I am sending the key part of my CTest script. As you can see, its

Re: [CMake] CMakeLists.txt: How to print a message if ctest fails?

2016-04-18 Thread Muhammad Osama
Hi Miroslav, Thank you for replying! I added this in my root CMakeLists.txt, purposely made the ctest's test fail but didn't get the output message. Is this script suppose to be added inside CMakeLists.txt? Or am I doing this incorrectly? Thanks again, On Mon, Apr 18, 2016 at 6:30 AM, Matějů

Re: [CMake] CMakeLists.txt: How to print a message if ctest fails?

2016-04-18 Thread Matějů Miroslav , Ing .
Hi Muhammad, you can use a CTest script, see https://cmake.org/Wiki/CMake_Scripting_Of_CTest for details. I use the following code in my CTest script: if(configure_failed OR build_failed OR test_failed) message(FATAL_ERROR "Test ${CTEST_BUILD_NAME} failed.") endif() Best regards, Miroslav

[CMake] CMakeLists.txt: How to print a message if ctest fails?

2016-04-15 Thread Muhammad Osama
Is there a way I can setup CMakeLists.txt to print a message if ctest tests fail? For example: cmake .. make ctest // fails message output: Please contact x...@mail.com to resolve testing problems. ​Note the message output is not for cmake but for ctest.​ --​​ Muhammad -- Powered by