MCPcopy Create free account
hub / github.com/Kitware/CMake / WriteMidlOptions

Method WriteMidlOptions

Source/cmVisualStudio10TargetGenerator.cxx:4899–4942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4897}
4898
4899void cmVisualStudio10TargetGenerator::WriteMidlOptions(
4900 Elem& e1, std::string const& configName)
4901{
4902 if (!this->MSTools) {
4903 return;
4904 }
4905 if (this->ProjectType == VsProjectType::csproj) {
4906 return;
4907 }
4908 if (this->GeneratorTarget->GetType() > cmStateEnums::UTILITY) {
4909 return;
4910 }
4911
4912 // This processes *any* of the .idl files specified in the project's file
4913 // list (and passed as the item metadata %(Filename) expressing the rule
4914 // input filename) into output files at the per-config *build* dir
4915 // ($(IntDir)) each.
4916 //
4917 // IOW, this MIDL section is intended to provide a fully generic syntax
4918 // content suitable for most cases (read: if you get errors, then it's quite
4919 // probable that the error is on your side of the .idl setup).
4920 //
4921 // Also, note that the marked-as-generated _i.c file in the Visual Studio
4922 // generator case needs to be referred to as $(IntDir)\foo_i.c at the
4923 // project's file list, otherwise the compiler-side processing won't pick it
4924 // up (for non-directory form, it ends up looking in project binary dir
4925 // only). Perhaps there's something to be done to make this more automatic
4926 // on the CMake side?
4927 std::vector<std::string> const includes =
4928 this->GetIncludes(configName, "MIDL");
4929 std::ostringstream oss;
4930 for (std::string const& i : includes) {
4931 oss << i << ";";
4932 }
4933 oss << "%(AdditionalIncludeDirectories)";
4934
4935 Elem e2(e1, "Midl");
4936 e2.Element("AdditionalIncludeDirectories", oss.str());
4937 e2.Element("OutputDirectory", "$(ProjectDir)/$(IntDir)");
4938 e2.Element("HeaderFileName", "%(Filename).h");
4939 e2.Element("TypeLibraryName", "%(Filename).tlb");
4940 e2.Element("InterfaceIdentifierFileName", "%(Filename)_i.c");
4941 e2.Element("ProxyFileName", "%(Filename)_p.c");
4942}
4943
4944void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0)
4945{

Callers 1

Calls 4

GetIncludesMethod · 0.95
strMethod · 0.80
GetTypeMethod · 0.45
ElementMethod · 0.45

Tested by

no test coverage detected