If you want to exclude certain source files from certain targets you can use a list and then list(REMOVE_ITEM...)<br><br>set(FOO_SRCS foo.cc bar.cc)<br>list(REMOVE_ITEM FOO_SRCS bar.cc)<br>add_library(foo ${FOO_SRCS})<br><br>
Alternatively, only add the unusual source files to the targets you want.<br><br>set(FOO_SRCS foo.cc bar.cc)<br>if(WHATEVER)<br> list(FOO_SRCS APPEND whatever.cc)<br>endif()<br><br><div class="gmail_quote">On Tue, May 26, 2009 at 5:52 PM, Daniel Tavares <span dir="ltr"><<a href="mailto:daniel.tavares@slipg8.com">daniel.tavares@slipg8.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p>Is it possible to exclude a file from build for a specific build
target? As far as I could read on the documentation and discussion threads, setting
HEADER_FILE_ONLY to TRUE changes the file property for all targets.</p>
<p> </p>
<p>I’m converting a Visual Studio 2005 project to CMake and
this project excludes a couple of files from the build depending on the build
target.</p>
<p> </p>
<p> </p>
<p>Thanks,</p>
<p><span style="font-size: 10pt;">Daniel</span><span style="font-size: 12pt; font-family: "Times New Roman","serif";"></span></p>
<p> </p>
<p> </p>
</div>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><br>-- <br>Philip Lowman<br>