summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx18
-rw-r--r--Source/cmConfigure.cmake.h.in1
-rw-r--r--Source/cmFindPackageCommand.cxx9
-rw-r--r--Source/cmGeneratorTarget.cxx3
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx4
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx14
-rw-r--r--Source/cmSystemTools.cxx28
-rw-r--r--Source/cmSystemTools.h1
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx15
9 files changed, 69 insertions, 24 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index a904b94..df22028 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -181,11 +181,25 @@ CMakeSetupDialog::CMakeSetupDialog()
&QCMakeCacheView::collapseAll);
QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help"));
- a = HelpMenu->addAction(tr("About"));
- QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doAbout);
a = HelpMenu->addAction(tr("Help"));
QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doHelp);
a->setShortcut(QKeySequence::HelpContents);
+ a = HelpMenu->addAction(tr("CMake Reference Manual"));
+ QObject::connect(a, &QAction::triggered, this, []() {
+ QString urlFormat("https://cmake.org/cmake/help/v%1.%2/");
+ QUrl url(urlFormat.arg(QString::number(cmVersion::GetMajorVersion()),
+ QString::number(cmVersion::GetMinorVersion())));
+
+ if (!cmSystemTools::GetHTMLDoc().empty()) {
+ url = QUrl::fromLocalFile(
+ QDir(QString::fromLocal8Bit(cmSystemTools::GetHTMLDoc().data()))
+ .filePath("index.html"));
+ }
+
+ QDesktopServices::openUrl(url);
+ });
+ a = HelpMenu->addAction(tr("About"));
+ QObject::connect(a, &QAction::triggered, this, &CMakeSetupDialog::doAbout);
this->setAcceptDrops(true);
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index ceb2a32..cf32b05 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -21,6 +21,7 @@
#define CMake_DEFAULT_RECURSION_LIMIT @CMake_DEFAULT_RECURSION_LIMIT@
#define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
+#define CMAKE_DOC_DIR "/@CMAKE_DOC_DIR@"
#define CM_FALLTHROUGH cmsys_FALLTHROUGH
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 86251d2..c988b59 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1984,6 +1984,9 @@ cmFileListGeneratorBase* cmFileListGeneratorBase::SetNext(
bool cmFileListGeneratorBase::Consider(std::string const& fullPath,
cmFileList& listing)
{
+ if (!cmSystemTools::FileIsDirectory(fullPath)) {
+ return false;
+ }
if (this->Next) {
return this->Next->Search(fullPath + "/", listing);
}
@@ -2238,10 +2241,8 @@ private:
// Look for directories among the matches.
for (std::string const& f : files) {
- if (cmSystemTools::FileIsDirectory(f)) {
- if (this->Consider(f, lister)) {
- return true;
- }
+ if (this->Consider(f, lister)) {
+ return true;
}
}
return false;
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 859fa6a..bdea9fa 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3190,6 +3190,9 @@ void cmGeneratorTarget::GetAppleArchs(const std::string& config,
if (archs) {
cmExpandList(*archs, archVec);
}
+ if (archVec.empty()) {
+ this->Makefile->GetDefExpandList("_CMAKE_APPLE_ARCHS_DEFAULT", archVec);
+ }
}
void cmGeneratorTarget::AddCUDAArchitectureFlags(std::string& flags) const
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b78f0a0..acae2b6 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -4023,6 +4023,10 @@ void cmGlobalXCodeGenerator::ComputeArchitectures(cmMakefile* mf)
}
if (this->Architectures.empty()) {
+ mf->GetDefExpandList("_CMAKE_APPLE_ARCHS_DEFAULT", this->Architectures);
+ }
+
+ if (this->Architectures.empty()) {
// With no ARCHS we use ONLY_ACTIVE_ARCH and possibly a
// platform-specific default ARCHS placeholder value.
// Look up the arch that Xcode chooses in this case.
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 7795654..fdf8307 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -583,7 +583,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
{
std::string mfcFlag;
if (cmProp p = this->Makefile->GetDefinition("CMAKE_MFC_FLAG")) {
- mfcFlag = *p;
+ mfcFlag = cmGeneratorExpression::Evaluate(*p, this, configName);
} else {
mfcFlag = "0";
}
@@ -1081,11 +1081,13 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
if (stackVal) {
fout << "\t\t\t\tStackReserveSize=\"" << *stackVal << "\"\n";
}
- temp = cmStrCat(
- target->GetDirectory(configName, cmStateEnums::ImportLibraryArtifact),
- '/', targetNames.ImportLibrary);
- fout << "\t\t\t\tImportLibrary=\""
- << this->ConvertToXMLOutputPathSingle(temp) << "\"";
+ if (!targetNames.ImportLibrary.empty()) {
+ temp = cmStrCat(target->GetDirectory(
+ configName, cmStateEnums::ImportLibraryArtifact),
+ '/', targetNames.ImportLibrary);
+ fout << "\t\t\t\tImportLibrary=\""
+ << this->ConvertToXMLOutputPathSingle(temp) << "\"";
+ }
if (this->FortranProject) {
fout << "\n\t\t\t\tLinkDLL=\"true\"";
}
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 1e625a4..97440d2 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2077,6 +2077,7 @@ static std::string cmSystemToolsCMakeCursesCommand;
static std::string cmSystemToolsCMakeGUICommand;
static std::string cmSystemToolsCMClDepsCommand;
static std::string cmSystemToolsCMakeRoot;
+static std::string cmSystemToolsHTMLDoc;
void cmSystemTools::FindCMakeResources(const char* argv0)
{
std::string exe_dir;
@@ -2166,18 +2167,23 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
// Install tree has
// - "<prefix><CMAKE_BIN_DIR>/cmake"
// - "<prefix><CMAKE_DATA_DIR>"
- if (cmHasSuffix(exe_dir, CMAKE_BIN_DIR)) {
+ // - "<prefix><CMAKE_DOC_DIR>"
+ if (cmHasLiteralSuffix(exe_dir, CMAKE_BIN_DIR)) {
std::string const prefix =
- exe_dir.substr(0, exe_dir.size() - strlen(CMAKE_BIN_DIR));
- cmSystemToolsCMakeRoot = prefix + CMAKE_DATA_DIR;
+ exe_dir.substr(0, exe_dir.size() - cmStrLen(CMAKE_BIN_DIR));
+ cmSystemToolsCMakeRoot = cmStrCat(prefix, CMAKE_DATA_DIR);
+ if (cmSystemTools::FileExists(
+ cmStrCat(prefix, CMAKE_DOC_DIR "/html/index.html"))) {
+ cmSystemToolsHTMLDoc = cmStrCat(prefix, CMAKE_DOC_DIR "/html");
+ }
}
if (cmSystemToolsCMakeRoot.empty() ||
!cmSystemTools::FileExists(
- (cmSystemToolsCMakeRoot + "/Modules/CMake.cmake"))) {
+ cmStrCat(cmSystemToolsCMakeRoot, "/Modules/CMake.cmake"))) {
// Build tree has "<build>/bin[/<config>]/cmake" and
// "<build>/CMakeFiles/CMakeSourceDir.txt".
std::string dir = cmSystemTools::GetFilenamePath(exe_dir);
- std::string src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt";
+ std::string src_dir_txt = cmStrCat(dir, "/CMakeFiles/CMakeSourceDir.txt");
cmsys::ifstream fin(src_dir_txt.c_str());
std::string src_dir;
if (fin && cmSystemTools::GetLineFromStream(fin, src_dir) &&
@@ -2185,13 +2191,18 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
cmSystemToolsCMakeRoot = src_dir;
} else {
dir = cmSystemTools::GetFilenamePath(dir);
- src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt";
+ src_dir_txt = cmStrCat(dir, "/CMakeFiles/CMakeSourceDir.txt");
cmsys::ifstream fin2(src_dir_txt.c_str());
if (fin2 && cmSystemTools::GetLineFromStream(fin2, src_dir) &&
cmSystemTools::FileIsDirectory(src_dir)) {
cmSystemToolsCMakeRoot = src_dir;
}
}
+ if (!cmSystemToolsCMakeRoot.empty() && cmSystemToolsHTMLDoc.empty() &&
+ cmSystemTools::FileExists(
+ cmStrCat(dir, "/Utilities/Sphinx/html/index.html"))) {
+ cmSystemToolsHTMLDoc = cmStrCat(dir, "/Utilities/Sphinx/html");
+ }
}
#else
// Bootstrap build knows its source.
@@ -2234,6 +2245,11 @@ std::string const& cmSystemTools::GetCMakeRoot()
return cmSystemToolsCMakeRoot;
}
+std::string const& cmSystemTools::GetHTMLDoc()
+{
+ return cmSystemToolsHTMLDoc;
+}
+
std::string cmSystemTools::GetCurrentWorkingDirectory()
{
return cmSystemTools::CollapseFullPath(
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index d571b96..1100f05 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -389,6 +389,7 @@ public:
static std::string const& GetCMakeCursesCommand();
static std::string const& GetCMClDepsCommand();
static std::string const& GetCMakeRoot();
+ static std::string const& GetHTMLDoc();
/** Get the CWD mapped through the KWSys translation map. */
static std::string GetCurrentWorkingDirectory();
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a7b90b4..413166e 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1224,7 +1224,8 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
cmProp mfcFlag = this->Makefile->GetDefinition("CMAKE_MFC_FLAG");
if (mfcFlag) {
- std::string const mfcFlagValue = *mfcFlag;
+ std::string const mfcFlagValue =
+ cmGeneratorExpression::Evaluate(*mfcFlag, this->LocalGenerator, config);
std::string useOfMfcValue = "false";
if (this->GeneratorTarget->GetType() <= cmStateEnums::OBJECT_LIBRARY) {
@@ -3791,12 +3792,14 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
std::string pdb = cmStrCat(this->GeneratorTarget->GetPDBDirectory(config),
'/', targetNames.PDB);
- std::string imLib =
- cmStrCat(this->GeneratorTarget->GetDirectory(
- config, cmStateEnums::ImportLibraryArtifact),
- '/', targetNames.ImportLibrary);
+ if (!targetNames.ImportLibrary.empty()) {
+ std::string imLib =
+ cmStrCat(this->GeneratorTarget->GetDirectory(
+ config, cmStateEnums::ImportLibraryArtifact),
+ '/', targetNames.ImportLibrary);
- linkOptions.AddFlag("ImportLibrary", imLib);
+ linkOptions.AddFlag("ImportLibrary", imLib);
+ }
linkOptions.AddFlag("ProgramDataBaseFile", pdb);
// A Windows Runtime component uses internal .NET metadata,