On Wed, Nov 5, 2008 at 9:25 AM,  <span dir="ltr">&lt;<a href="mailto:Alexander.Camek@elektrobit.com">Alexander.Camek@elektrobit.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi folks,<br>
<br>
I have got a project split up into a lot of single project.<br>
So in my ROOR dir I have got a CMakeLists.txt which defines a &quot;master&quot; PROJECT().<br>
Each subdirectory added by the master project adds in its CMakeLists.txt its own PROJECT() in order to build alone.<br>
<br>
Now I add a new command ADD_CUSTOM_TARGET(lint ) in my master project in order to do a make lint.<br>
This works fine if everybody uses the whole project. But if he uses only a subproject as standalone this doesn&#39;t work.<br>
It doesn&#39;t know the custom target. But if I add this to the subprojects cmake warns me about &quot;CMP0002&quot;.<br>
<br>
What I want to do is now to check if my custom target was set and if not I want to set it in the subproject.<br>
<br>
Something like that:<br>
GET_TARGET_EXISTS(LINT_SET lint)<br>
<br>
IF(NOT LINT_SET)<br>
 &nbsp; ADD_CUSTOM_TARGET(lint )<br>
ENDIF(NOT LINT_SET)<br>
<br>
How can I do that?</blockquote><div><br>I&#39;m not completely sure what you&#39;re asking for, but the IF() command does support checking for targets if that&#39;s what you&#39;re looking for:<br><br>if(TARGET target-name)<br>
<a href="http://www.cmake.org/cmake/help/cmake2.6docs.html">http://www.cmake.org/cmake/help/cmake2.6docs.html</a><br><br></div></div>-- <br>Philip Lowman<br>