[CMake] Is HEADER_FILE_ONLY not working in Visual Studio 2010?

Aaron_Wright at selinc.com Aaron_Wright at selinc.com
Fri Jan 14 18:34:19 EST 2011


I have a project with custom resource files in it, and unfortunately they 
have the same extension as real resource files, so Visual Studio tries to 
compile them. This obviously doesn't work.

So I set the HEADER_FILE_ONLY property on these files and that fixed it.

Now we're moving to Visual Studio 2010 on Windows 7 32-bit and the problem 
is back. The files are still marked HEADER_FILE_ONLY, but that doesn't 
exclude them from the build anymore. Is there something I can do to get 
the same behavior back I was seeing in Visual Studio 2008? Is there an 
EXCLUDE_FROM_BUILD property? I noticed a bug report on excluding files 
from the build, http://www.itk.org/Bug/view.php?id=6314, but that is 
pretty old.

I'm using CMake 2.8.3

Line from the project:

<ClInclude Include="resources\logging.en.res" />

How can I get it to:

<None Include="resources\logging.en.res">
   <ExcludedFromBuild 
Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</None>

Or something similar with the excluded from build set to true.
---
Aaron Wright


More information about the CMake mailing list