<div class="gmail_quote">On Thu, Oct 13, 2011 at 3:16 PM, David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Thu, Oct 13, 2011 at 3:37 PM, Robert Dailey &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt; wrote:<br>
&gt; In visual studio, there is a way to exclude a source file from the build on<br>
&gt; a per-configuration basis (debug vs release). The actual VCPROJ looks like<br>
&gt; this when you exclude a CPP file from the build for only DEBUG<br>
&gt; configuration:<br>
&gt;<br>
&gt; &lt;File<br>
&gt; RelativePath=&quot;C:\Code\work\rdailey-t510-sandbox\n2\gpr\security\gtisecprovcleartext.cpp&quot;&gt;<br>
&gt; &lt;FileConfiguration<br>
&gt; Name=&quot;Debug|Win32&quot;<br>
&gt; ExcludedFromBuild=&quot;TRUE&quot;&gt;<br>
&gt; &lt;Tool<br>
&gt; Name=&quot;VCCLCompilerTool&quot;/&gt;<br>
&gt; &lt;/FileConfiguration&gt;<br>
&gt; &lt;/File&gt;<br>
&gt;<br>
&gt; Is there a way in CMake to make it generate this? There has to be some sort<br>
&gt; of platform agnostic feature for this, and for other platforms it will<br>
&gt; implement it accordingly<br>
&gt; ---------<br>
&gt; Robert Dailey<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Oct 5, 2011 at 3:47 PM, Robert Dailey &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; In my particular CMake project, I have three CPP files:<br>
&gt;&gt;     a.cpp<br>
&gt;&gt;     b.cpp<br>
&gt;&gt;     c.cpp<br>
&gt;&gt; I want &#39;a.cpp&#39; to be compiled in all configurations (release &amp; debug).&lt;br&gt;<br>
&gt;&gt; I only want &#39;b.cpp&#39; to be compiled in DEBUG configuration.&lt;br&gt;<br>
&gt;&gt; I only want &#39;c.cpp&#39; to be compiled in RELEASE configuration.<br>
&gt;&gt; How can I do this? I need something similar to the `debug` and `optimized`<br>
&gt;&gt; keywords that are accepted by the `target_link_libraries()` CMake operation.<br>
&gt;&gt; ---------<br>
&gt;&gt; Robert Dailey<br>
&gt;<br>
&gt;<br>
</div></div>&gt; --<br>
&gt;<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
<br>
At present, the only time we generate ExcludedFromBuild=&quot;true&quot; is when<br>
the source file property HEADER_FILE_ONLY is set to a non-false value.<br>
That is on a per-source-file basis, though, not on a per-configuration<br>
basis.<br>
<br>
What you want is a new feature request for CMake. It does not exist yet.</blockquote><div><br></div><div>I was able to find this existing feature request for what seems to be the same thing I want:</div><div><a href="http://www.itk.org/Bug/view.php?id=11902">http://www.itk.org/Bug/view.php?id=11902</a></div>
<div><br></div><div>I&#39;ve voiced my vote for it. I hope it will be implemented. </div></div>