Ninja generator does not respect HEADER_FILE_ONLY property
A lot of projects use the HEADER_FILE_ONLY
source file PROPERTY
to exclude otherwise compilable files from the build (such as sources for other platforms, so that they show up in e.g. an IDE).
I found a patch submitted to your mailing list April 2015 which should solve this issue, but apparently this was never merged: http://public.kitware.com/pipermail/cmake-developers/2015-April/024923.html
Source/cmNinjaNormalTargetGenerator.cxx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index c352c1a..b5c0985 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -119,6 +119,9 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
for(std::vector<cmSourceFile*>::const_iterator
i = sourceFiles.begin(); i != sourceFiles.end(); ++i)
{
+ if((*i)->GetPropertyAsBool("HEADER_FILE_ONLY"))
+ continue;
+
const std::string& lang = (*i)->GetLanguage();
if(!lang.empty())
{