[CMake] Inherited AdditionalIncludeDirectories wrong for VS 2010 IDE build
Karl Wallner
cmake at karlwallner.de
Thu Sep 30 20:49:19 EDT 2010
Hi All,
using cmake for a quite big project (with several sub-projects, some macros, find modules etc.) sometimes .vcxproj
contains output like this:
> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
> <ClCompile>
> <AdditionalOptions> /Zm1000 /bigobj %(AdditionalOptions)</AdditionalOptions>
> <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
> <AdditionalIncludeDirectories>... LOTS OF INCLUDES ... /include</AdditionalIncludeDirectories>
> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
The problem is the second AdditionalIncludeDirectories not containing the final "%(AdditionalIncludeDirectories)".
Inside VS (Properties -> Configuration Properties -> C/C++ -> Additional Include Directories) this results
in the checkbox for "Inherit from parent of project defaults" being unchecked and so the includes are not
used. If you would check this checkbox, everything would work - but is a dissatisfying solution.
I tried hard to reproduce this error in a smaller example, but failed. I couldn't reproduce it, but I could fix it:
------------ SNIP ---------------------
diff -r -c \
cmake-2.8.2.orig/Source/cmVisualStudioGeneratorOptions.cxx cmake-2.8.2/Source/cmVisualStudioGeneratorOptions.cxx
*** cmake-2.8.2.orig/Source//cmVisualStudioGeneratorOptions.cxx 2010-06-28 17:15:59.000000000 +0200
--- cmake-2.8.2/Source//cmVisualStudioGeneratorOptions.cxx 2010-10-01 02:46:57.677851800 +0200
***************
*** 251,257 ****
{
fout << "<" << m->first << ">";
}
! fout << m->second << "</" << m->first << ">\n";
}
}
else
--- 251,261 ----
{
fout << "<" << m->first << ">";
}
! fout << m->second;
! if (m->first == "AdditionalIncludeDirectories") {
! fout << ";%(AdditionalIncludeDirectories)";
! }
! fout << "</" << m->first << ">\n";
}
}
else
------------ SNIP ---------------------
I guess this is a bad fix (ugly hack, wrong place). Maybe somebody is able to explain/guess what might be wrong with my
CMake-Files or to correctly fix this issue.
Regards,
Karl
More information about the CMake
mailing list