diff options
-rw-r--r-- | Help/manual/cmake.1.rst | 2 | ||||
-rw-r--r-- | Help/release/dev/macos-hidpi-qt-dialog.rst | 5 | ||||
-rw-r--r-- | Modules/MacOSXBundleInfo.plist.in | 4 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 6 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 9 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 78 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.h | 5 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 163 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.h | 2 | ||||
-rw-r--r-- | Utilities/KWIML/test/CMakeLists.txt | 2 |
12 files changed, 154 insertions, 126 deletions
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index b2e2828..ba925e8 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -227,7 +227,7 @@ Available commands are: ``copy <file>... <destination>`` Copy files to ``<destination>`` (either file or directory). If multiple files are specified, the ``<destination>`` must be - directory and it must exist. + directory and it must exist. Wildcards are not supported. ``copy_directory <dir>... <destination>`` Copy directories to ``<destination>`` directory. diff --git a/Help/release/dev/macos-hidpi-qt-dialog.rst b/Help/release/dev/macos-hidpi-qt-dialog.rst new file mode 100644 index 0000000..263d405 --- /dev/null +++ b/Help/release/dev/macos-hidpi-qt-dialog.rst @@ -0,0 +1,5 @@ +macos-hidpi-qt-dialog +--------------------- + +* On macOS the default application bundle ``Info.plist`` file now enables + Hi-DPI support. diff --git a/Modules/MacOSXBundleInfo.plist.in b/Modules/MacOSXBundleInfo.plist.in index a4009bc..e06b17e 100644 --- a/Modules/MacOSXBundleInfo.plist.in +++ b/Modules/MacOSXBundleInfo.plist.in @@ -30,5 +30,9 @@ <true/> <key>NSHumanReadableCopyright</key> <string>${MACOSX_BUNDLE_COPYRIGHT}</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> + <key>NSHighResolutionCapable</key> + <string>True</string> </dict> </plist> diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 145114f..7b621f2 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 8) -set(CMake_VERSION_PATCH 20170411) +set(CMake_VERSION_PATCH 20170413) #set(CMake_VERSION_RC 1) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index c59648f..b3be1b9 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -547,12 +547,6 @@ void cmGeneratorTarget::GetModuleDefinitionSources( IMPLEMENT_VISIT(SourceKindModuleDefinition); } -void cmGeneratorTarget::GetIDLSources(std::vector<cmSourceFile const*>& data, - const std::string& config) const -{ - IMPLEMENT_VISIT(SourceKindIDL); -} - void cmGeneratorTarget::GetHeaderSources( std::vector<cmSourceFile const*>& data, const std::string& config) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index d21a765..ab80f59 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -118,8 +118,6 @@ public: const std::string& config) const; void GetResxSources(std::vector<cmSourceFile const*>&, const std::string& config) const; - void GetIDLSources(std::vector<cmSourceFile const*>&, - const std::string& config) const; void GetExternalObjects(std::vector<cmSourceFile const*>&, const std::string& config) const; void GetHeaderSources(std::vector<cmSourceFile const*>&, diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 33daef9..50ad1a8 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1347,10 +1347,11 @@ void cmGlobalGenerator::Generate() for (std::map<std::string, cmExportBuildFileGenerator*>::iterator it = this->BuildExportSets.begin(); it != this->BuildExportSets.end(); ++it) { - if (!it->second->GenerateImportFile() && - !cmSystemTools::GetErrorOccuredFlag()) { - this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, - "Could not write export file."); + if (!it->second->GenerateImportFile()) { + if (!cmSystemTools::GetErrorOccuredFlag()) { + this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, + "Could not write export file."); + } return; } } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e81f047..ebc874a 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -152,6 +152,9 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(cmake* cm, this->CurrentLocalGenerator = 0; this->XcodeBuildCommandInitialized = false; + this->ObjectDirArchDefault = "$(CURRENT_ARCH)"; + this->ComputeObjectDirArch(); + cm->GetState()->SetIsGeneratorMultiConfig(true); } @@ -282,13 +285,7 @@ void cmGlobalXCodeGenerator::EnableLanguage( } mf->AddDefinition("CMAKE_GENERATOR_NO_COMPILER_ENV", "1"); this->cmGlobalGenerator::EnableLanguage(lang, mf, optional); - const char* osxArch = mf->GetDefinition("CMAKE_OSX_ARCHITECTURES"); - const char* sysroot = mf->GetDefinition("CMAKE_OSX_SYSROOT"); - if (osxArch && sysroot) { - this->Architectures.clear(); - cmSystemTools::ExpandListArgument(std::string(osxArch), - this->Architectures); - } + this->ComputeArchitectures(mf); } void cmGlobalXCodeGenerator::GenerateBuildCommand( @@ -3089,23 +3086,16 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects( this->CreateString(defaultConfigName)); cmXCodeObject* buildSettings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP); - const char* osxArch = - this->CurrentMakefile->GetDefinition("CMAKE_OSX_ARCHITECTURES"); const char* sysroot = this->CurrentMakefile->GetDefinition("CMAKE_OSX_SYSROOT"); const char* deploymentTarget = this->CurrentMakefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); - std::string archs; if (sysroot) { - if (osxArch) { - // recompute this as it may have been changed since enable language - this->Architectures.clear(); - cmSystemTools::ExpandListArgument(std::string(osxArch), - this->Architectures); - archs = cmJoin(this->Architectures, " "); - } buildSettings->AddAttribute("SDKROOT", this->CreateString(sysroot)); } + // recompute this as it may have been changed since enable language + this->ComputeArchitectures(this->CurrentMakefile); + std::string const archs = cmJoin(this->Architectures, " "); if (archs.empty()) { // Tell Xcode to use NATIVE_ARCH instead of ARCHS. buildSettings->AddAttribute("ONLY_ACTIVE_ARCH", this->CreateString("YES")); @@ -3212,6 +3202,48 @@ std::string cmGlobalXCodeGenerator::GetObjectsNormalDirectory( return dir; } +void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf) +{ + this->Architectures.clear(); + const char* osxArch = mf->GetDefinition("CMAKE_OSX_ARCHITECTURES"); + const char* sysroot = mf->GetDefinition("CMAKE_OSX_SYSROOT"); + if (osxArch && sysroot) { + cmSystemTools::ExpandListArgument(std::string(osxArch), + this->Architectures); + } + + if (this->Architectures.empty()) { + // With no ARCHS we use ONLY_ACTIVE_ARCH. + // Look up the arch that Xcode chooses in this case. + if (const char* arch = mf->GetDefinition("CMAKE_XCODE_CURRENT_ARCH")) { + this->ObjectDirArchDefault = arch; + } + } + + this->ComputeObjectDirArch(); +} + +void cmGlobalXCodeGenerator::ComputeObjectDirArch() +{ + if (this->XcodeVersion >= 21) { + if (this->Architectures.size() > 1) { + this->ObjectDirArch = "$(CURRENT_ARCH)"; + } else if (!this->Architectures.empty()) { + this->ObjectDirArch = this->Architectures[0]; + } else { + this->ObjectDirArch = this->ObjectDirArchDefault; + } + } else { +#if defined(__ppc__) + this->ObjectDirArch = "ppc"; +#elif defined(__i386) + this->ObjectDirArch = "i386"; +#else + this->ObjectDirArch = ""; +#endif + } +} + void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( std::vector<cmXCodeObject*>& targets) { @@ -3721,15 +3753,7 @@ void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory( std::string configName = this->GetCMakeCFGIntDir(); std::string dir = this->GetObjectsNormalDirectory("$(PROJECT_NAME)", configName, gt); - if (this->XcodeVersion >= 21) { - dir += "$(CURRENT_ARCH)/"; - } else { -#ifdef __ppc__ - dir += "ppc/"; -#endif -#ifdef __i386 - dir += "i386/"; -#endif - } + dir += this->ObjectDirArch; + dir += "/"; gt->ObjectDirectory = dir; } diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index c4f56b6..982dabd 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -241,6 +241,9 @@ private: const std::string& configName, const cmGeneratorTarget* t) const; + void ComputeArchitectures(cmMakefile* mf); + void ComputeObjectDirArch(); + void addObject(cmXCodeObject* obj); std::string PostBuildMakeTarget(std::string const& tName, std::string const& configName); @@ -262,6 +265,8 @@ private: std::map<std::string, cmXCodeObject*> FileRefs; std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap; std::vector<std::string> Architectures; + std::string ObjectDirArchDefault; + std::string ObjectDirArch; std::string GeneratorToolset; }; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index ef89156..8e6014a 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1727,15 +1727,6 @@ void cmVisualStudio10TargetGenerator::WriteSource(std::string const& tool, this->Tools[tool].push_back(toolSource); } -void cmVisualStudio10TargetGenerator::WriteSources( - std::string const& tool, std::vector<cmSourceFile const*> const& sources) -{ - for (std::vector<cmSourceFile const*>::const_iterator si = sources.begin(); - si != sources.end(); ++si) { - this->WriteSource(tool, *si); - } -} - void cmVisualStudio10TargetGenerator::WriteAllSources() { if (this->GeneratorTarget->GetType() > cmStateEnums::UTILITY) { @@ -1743,90 +1734,96 @@ void cmVisualStudio10TargetGenerator::WriteAllSources() } this->WriteString("<ItemGroup>\n", 1); - std::vector<cmSourceFile const*> headerSources; - this->GeneratorTarget->GetHeaderSources(headerSources, ""); - for (std::vector<cmSourceFile const*>::const_iterator si = - headerSources.begin(); - si != headerSources.end(); ++si) { - this->WriteHeaderSource(*si); - } - std::vector<cmSourceFile const*> idlSources; - this->GeneratorTarget->GetIDLSources(idlSources, ""); - this->WriteSources("Midl", idlSources); + cmGeneratorTarget::KindedSources const& sources = + this->GeneratorTarget->GetKindedSources(""); - std::vector<cmSourceFile const*> objectSources; - this->GeneratorTarget->GetObjectSources(objectSources, ""); - for (std::vector<cmSourceFile const*>::const_iterator si = - objectSources.begin(); - si != objectSources.end(); ++si) { - const std::string& lang = (*si)->GetLanguage(); + for (std::vector<cmGeneratorTarget::SourceAndKind>::const_iterator si = + sources.Sources.begin(); + si != sources.Sources.end(); ++si) { std::string tool; - if (lang == "C" || lang == "CXX") { - tool = "ClCompile"; - } else if (lang == "ASM_MASM" && this->GlobalGenerator->IsMasmEnabled()) { - tool = "MASM"; - } else if (lang == "ASM_NASM" && this->GlobalGenerator->IsNasmEnabled()) { - tool = "NASM"; - } else if (lang == "RC") { - tool = "ResourceCompile"; - } else if (lang == "CSharp") { - tool = "Compile"; - } else if (lang == "CUDA" && this->GlobalGenerator->IsCudaEnabled()) { - tool = "CudaCompile"; + switch (si->Kind) { + case cmGeneratorTarget::SourceKindAppManifest: + tool = "AppxManifest"; + break; + case cmGeneratorTarget::SourceKindCertificate: + tool = "None"; + break; + case cmGeneratorTarget::SourceKindCustomCommand: + // Handled elsewhere. + break; + case cmGeneratorTarget::SourceKindExternalObject: + tool = "Object"; + if (this->LocalGenerator->GetVersion() < + cmGlobalVisualStudioGenerator::VS11) { + // For VS == 10 we cannot use LinkObjects to avoid linking custom + // command outputs. If an object file is generated in this target, + // then vs10 will use it in the build, and we have to list it as + // None instead of Object. + std::vector<cmSourceFile*> const* d = + this->GeneratorTarget->GetSourceDepends(si->Source); + if (d && !d->empty()) { + tool = "None"; + } + } + break; + case cmGeneratorTarget::SourceKindExtra: + this->WriteExtraSource(si->Source); + break; + case cmGeneratorTarget::SourceKindHeader: + this->WriteHeaderSource(si->Source); + break; + case cmGeneratorTarget::SourceKindIDL: + tool = "Midl"; + break; + case cmGeneratorTarget::SourceKindManifest: + // Handled elsewhere. + break; + case cmGeneratorTarget::SourceKindModuleDefinition: + tool = "None"; + break; + case cmGeneratorTarget::SourceKindObjectSource: { + const std::string& lang = si->Source->GetLanguage(); + if (lang == "C" || lang == "CXX") { + tool = "ClCompile"; + } else if (lang == "ASM_MASM" && + this->GlobalGenerator->IsMasmEnabled()) { + tool = "MASM"; + } else if (lang == "ASM_NASM" && + this->GlobalGenerator->IsNasmEnabled()) { + tool = "NASM"; + } else if (lang == "RC") { + tool = "ResourceCompile"; + } else if (lang == "CSharp") { + tool = "Compile"; + } else if (lang == "CUDA" && this->GlobalGenerator->IsCudaEnabled()) { + tool = "CudaCompile"; + } else { + tool = "None"; + } + } break; + case cmGeneratorTarget::SourceKindResx: + // Handled elsewhere. + break; + case cmGeneratorTarget::SourceKindXaml: + // Handled elsewhere. + break; } if (!tool.empty()) { - this->WriteSource(tool, *si, " "); - if (this->OutputSourceSpecificFlags(*si)) { - this->WriteString("</", 2); - (*this->BuildFileStream) << tool << ">\n"; + if (si->Kind == cmGeneratorTarget::SourceKindObjectSource) { + this->WriteSource(tool, si->Source, " "); + if (this->OutputSourceSpecificFlags(si->Source)) { + this->WriteString("</", 2); + (*this->BuildFileStream) << tool << ">\n"; + } else { + (*this->BuildFileStream) << " />\n"; + } } else { - (*this->BuildFileStream) << " />\n"; + this->WriteSource(tool, si->Source); } - } else { - this->WriteSource("None", *si); - } - } - - std::vector<cmSourceFile const*> manifestSources; - this->GeneratorTarget->GetAppManifest(manifestSources, ""); - this->WriteSources("AppxManifest", manifestSources); - - std::vector<cmSourceFile const*> certificateSources; - this->GeneratorTarget->GetCertificates(certificateSources, ""); - this->WriteSources("None", certificateSources); - - std::vector<cmSourceFile const*> externalObjects; - this->GeneratorTarget->GetExternalObjects(externalObjects, ""); - if (this->LocalGenerator->GetVersion() > - cmGlobalVisualStudioGenerator::VS10) { - // For VS >= 11 we use LinkObjects to avoid linking custom command - // outputs. Use Object for all external objects, generated or not. - this->WriteSources("Object", externalObjects); - } else { - // If an object file is generated in this target, then vs10 will use - // it in the build, and we have to list it as None instead of Object. - for (std::vector<cmSourceFile const*>::const_iterator si = - externalObjects.begin(); - si != externalObjects.end(); ++si) { - std::vector<cmSourceFile*> const* d = - this->GeneratorTarget->GetSourceDepends(*si); - this->WriteSource((d && !d->empty()) ? "None" : "Object", *si); } } - std::vector<cmSourceFile const*> extraSources; - this->GeneratorTarget->GetExtraSources(extraSources, ""); - for (std::vector<cmSourceFile const*>::const_iterator si = - extraSources.begin(); - si != extraSources.end(); ++si) { - this->WriteExtraSource(*si); - } - - std::vector<cmSourceFile const*> defSources; - this->GeneratorTarget->GetModuleDefinitionSources(defSources, ""); - this->WriteSources("None", defSources); - if (this->IsMissingFiles) { this->WriteMissingFiles(); } diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 1f5a7dc..7432244 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -62,8 +62,6 @@ private: void WriteNsightTegraConfigurationValues(std::string const& config); void WriteSource(std::string const& tool, cmSourceFile const* sf, const char* end = 0); - void WriteSources(std::string const& tool, - std::vector<cmSourceFile const*> const&); void WriteAllSources(); void WriteDotNetReferences(); void WriteDotNetReference(std::string const& ref, std::string const& hint); diff --git a/Utilities/KWIML/test/CMakeLists.txt b/Utilities/KWIML/test/CMakeLists.txt index 1bf93bb..40fe62f 100644 --- a/Utilities/KWIML/test/CMakeLists.txt +++ b/Utilities/KWIML/test/CMakeLists.txt @@ -38,6 +38,8 @@ endif() add_executable(kwiml_test ${test_srcs}) set_property(TARGET kwiml_test PROPERTY COMPILE_DEFINITIONS ${test_defs}) +set_property(TARGET kwiml_test PROPERTY C_INCLUDE_WHAT_YOU_USE "") +set_property(TARGET kwiml_test PROPERTY CXX_INCLUDE_WHAT_YOU_USE "") set_property(TARGET kwiml_test PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_test(NAME ${KWIML_TEST_PREFIX}.test COMMAND kwiml_test) |