<div class="gmail_quote">On Thu, Oct 13, 2011 at 3:16 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>></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 <<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>> wrote:<br>
> In visual studio, there is a way to exclude a source file from the build on<br>
> a per-configuration basis (debug vs release). The actual VCPROJ looks like<br>
> this when you exclude a CPP file from the build for only DEBUG<br>
> configuration:<br>
><br>
> <File<br>
> RelativePath="C:\Code\work\rdailey-t510-sandbox\n2\gpr\security\gtisecprovcleartext.cpp"><br>
> <FileConfiguration<br>
> Name="Debug|Win32"<br>
> ExcludedFromBuild="TRUE"><br>
> <Tool<br>
> Name="VCCLCompilerTool"/><br>
> </FileConfiguration><br>
> </File><br>
><br>
> Is there a way in CMake to make it generate this? There has to be some sort<br>
> of platform agnostic feature for this, and for other platforms it will<br>
> implement it accordingly<br>
> ---------<br>
> Robert Dailey<br>
><br>
><br>
> On Wed, Oct 5, 2011 at 3:47 PM, Robert Dailey <<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>> wrote:<br>
>><br>
>> In my particular CMake project, I have three CPP files:<br>
>> a.cpp<br>
>> b.cpp<br>
>> c.cpp<br>
>> I want 'a.cpp' to be compiled in all configurations (release & debug).<br><br>
>> I only want 'b.cpp' to be compiled in DEBUG configuration.<br><br>
>> I only want 'c.cpp' to be compiled in RELEASE configuration.<br>
>> How can I do this? I need something similar to the `debug` and `optimized`<br>
>> keywords that are accepted by the `target_link_libraries()` CMake operation.<br>
>> ---------<br>
>> Robert Dailey<br>
><br>
><br>
</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<br>
> <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:<br>
> <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>
><br>
<br>
At present, the only time we generate ExcludedFromBuild="true" 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've voiced my vote for it. I hope it will be implemented. </div></div>