2

I have a batch file which is calling CMake which also does some functionality

I want to call this batch file for Build.

If for some reason, CMake fails and throws error the same is not reported as failure in RTC. If my understanding is correct RTC is calling the Batch file and the Batch file calls CMake. The execution of batch file is successful and hence it is reported as success.

But I want the RTC to report CMake is failed which is called via Batch files

How can i achieve this?

I was looking at creating Ant tasks but don't have one proper example

thank you

Karthik

KK99
  • 1,971
  • 7
  • 31
  • 64
  • What version of RTC and of CMake are you using? Is the issue similar to http://permalink.gmane.org/gmane.comp.programming.tools.cmake.devel/410 (is there a `make -i` for the compilation step?) – VonC Jul 15 '11 at 15:08
  • Ok, no direct clue at the moment except to advise first debugging the issue at the script level (without worrying about RTC at the moment) and see if the batch can properly detect the error status of CMake. – VonC Jul 15 '11 at 15:15
  • I expect that the build engines detect failure by looking at the `%ERRORLEVEL%` of the executable. If you can pass that along from your batch file (ie, returning %ERRORLEVEL% after CMake runs), then I assume that the failure would be detected. – Erigami Jul 18 '11 at 14:43

1 Answers1

0

You will want to use the ANT exec task. http://ant.apache.org/manual/Tasks/exec.html There is an example in the documentation of calling a .bat file. You will also want to use the failonerror ="true" attribute to ensure you fail the RTC build if the bat file fails. Additionally you need to ensure that your bat file is indeed failing (returning a non-zero return code) if the CMake command fails.

rooftop
  • 3,031
  • 1
  • 22
  • 33