On Sun, Jan 11, 2009 at 10:00 AM, Wilfried Holzke <span dir="ltr"><<a href="mailto:cmake@holzke.net">cmake@holzke.net</a>></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;">
<div class="Ih2E3d">Hi,<br>
<br>
> cmake -DWITH_DEMO=ON srcdir<br>
><br>
> in CMakeLists.txt:<br>
><br>
> if(WITH_DEMO)<br>
> install( demo ....)<br>
> endif(WITH_DEMO)<br>
<br>
</div>If nothing else depends on the demo code I could do<br>
<br>
if(WITH_DEMO)<br>
add_subdirectory(example)<br>
endif(WITH_DEMO)<br>
<br>
to avoid building the whole source, right?</blockquote><div><br>Yes. The above code will stop CMake from building any targets in the "example" subdirectory.<br><br>You can also use the option() command to specify a default for boolean variables like WITH_DEMO and have it appear as an configurable cache variable when using "ccmake" or "cmake-gui".<br>
<br>option(WITH_DEMO "Build the examples" OFF)<br>if(WITH_DEMO)<br>
add_subdirectory(example)<br>
endif(WITH_DEMO)<br><br><br></div></div>-- <br>Philip Lowman<br>