summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CompileFlags.cmake2
-rw-r--r--Help/command/if.rst2
-rw-r--r--Help/manual/cmake-variables.7.rst3
-rw-r--r--Help/prop_tgt/OSX_ARCHITECTURES.rst12
-rw-r--r--Help/prop_tgt/OSX_ARCHITECTURES_CONFIG.rst2
-rw-r--r--Help/variable/CMAKE_OSX_ARCHITECTURES.rst10
-rw-r--r--Help/variable/CMAKE_OSX_DEPLOYMENT_TARGET.rst13
-rw-r--r--Help/variable/CMAKE_OSX_SYSROOT.rst13
-rw-r--r--Help/variable/CMAKE_OSX_VARIABLE.txt6
-rw-r--r--Modules/GNUInstallDirs.cmake64
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/QtDialog/AddCacheEntry.cxx38
-rw-r--r--Source/QtDialog/AddCacheEntry.h11
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx26
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h3
-rw-r--r--Source/cmAddDependenciesCommand.cxx4
-rw-r--r--Source/cmAddExecutableCommand.cxx2
-rw-r--r--Source/cmAddLibraryCommand.cxx2
-rw-r--r--Source/cmComputeTargetDepends.cxx2
-rw-r--r--Source/cmCoreTryCompile.cxx2
-rw-r--r--Source/cmCustomCommandGenerator.cxx2
-rw-r--r--Source/cmExportBuildFileGenerator.cxx2
-rw-r--r--Source/cmExportCommand.cxx2
-rw-r--r--Source/cmExportFileGenerator.cxx2
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx2
-rw-r--r--Source/cmFLTKWrapUICommand.cxx2
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx12
-rw-r--r--Source/cmGeneratorTarget.cxx10
-rw-r--r--Source/cmGetPropertyCommand.cxx6
-rw-r--r--Source/cmGetTargetPropertyCommand.cxx2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx30
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx16
-rw-r--r--Source/cmIfCommand.cxx2
-rw-r--r--Source/cmInstallCommand.cxx4
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmMakefile.cxx18
-rw-r--r--Source/cmMakefile.h8
-rw-r--r--Source/cmSetPropertyCommand.cxx4
-rw-r--r--Source/cmSetTargetPropertiesCommand.cxx2
-rw-r--r--Source/cmTarget.cxx20
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx2
-rw-r--r--Source/cmTargetPropCommandBase.cxx4
-rw-r--r--Source/cmTestGenerator.cxx2
43 files changed, 252 insertions, 123 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 20f5dec..24ac58d 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -66,5 +66,5 @@ endif ()
# avoid binutils problem with large binaries, e.g. when building CMake in debug mode
# See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50230
if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text.*")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*")
endif ()
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 49c356e..a45b995 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -187,7 +187,7 @@ above-documented signature accepts ``<variable|string>``:
variables, if so their defined values are used otherwise the original
value is used.
-* Both left and right hand argumemnts to ``VERSION_LESS``,
+* Both left and right hand arguments to ``VERSION_LESS``,
``VERSION_EQUAL``, and ``VERSION_GREATER`` are independently tested
to see if they are defined variables, if so their defined values are
used otherwise the original value is used.
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index cdd996c..832bd99 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -214,6 +214,9 @@ Variables that Control the Build
/variable/CMAKE_MODULE_LINKER_FLAGS
/variable/CMAKE_NO_BUILTIN_CHRPATH
/variable/CMAKE_NO_SYSTEM_FROM_IMPORTED
+ /variable/CMAKE_OSX_ARCHITECTURES
+ /variable/CMAKE_OSX_DEPLOYMENT_TARGET
+ /variable/CMAKE_OSX_SYSROOT
/variable/CMAKE_PDB_OUTPUT_DIRECTORY
/variable/CMAKE_PDB_OUTPUT_DIRECTORY_CONFIG
/variable/CMAKE_POSITION_INDEPENDENT_CODE
diff --git a/Help/prop_tgt/OSX_ARCHITECTURES.rst b/Help/prop_tgt/OSX_ARCHITECTURES.rst
index 68ff970..cefe03f 100644
--- a/Help/prop_tgt/OSX_ARCHITECTURES.rst
+++ b/Help/prop_tgt/OSX_ARCHITECTURES.rst
@@ -3,9 +3,9 @@ OSX_ARCHITECTURES
Target specific architectures for OS X.
-The OSX_ARCHITECTURES property sets the target binary architecture for
-targets on OS X. This property is initialized by the value of the
-variable CMAKE_OSX_ARCHITECTURES if it is set when a target is
-created. Use OSX_ARCHITECTURES_<CONFIG> to set the binary
-architectures on a per-configuration basis. <CONFIG> is an upper-case
-name (ex: "OSX_ARCHITECTURES_DEBUG").
+The ``OSX_ARCHITECTURES`` property sets the target binary architecture for
+targets on OS X (``-arch``). This property is initialized by the value of the
+variable :variable:`CMAKE_OSX_ARCHITECTURES` if it is set when a target is
+created. Use :prop_tgt:`OSX_ARCHITECTURES_<CONFIG>` to set the binary
+architectures on a per-configuration basis, where ``<CONFIG>`` is an
+upper-case name (e.g. ``OSX_ARCHITECTURES_DEBUG``).
diff --git a/Help/prop_tgt/OSX_ARCHITECTURES_CONFIG.rst b/Help/prop_tgt/OSX_ARCHITECTURES_CONFIG.rst
index ea05bea..f8fdcff 100644
--- a/Help/prop_tgt/OSX_ARCHITECTURES_CONFIG.rst
+++ b/Help/prop_tgt/OSX_ARCHITECTURES_CONFIG.rst
@@ -4,4 +4,4 @@ OSX_ARCHITECTURES_<CONFIG>
Per-configuration OS X binary architectures for a target.
This property is the configuration-specific version of
-OSX_ARCHITECTURES.
+:prop_tgt:`OSX_ARCHITECTURES`.
diff --git a/Help/variable/CMAKE_OSX_ARCHITECTURES.rst b/Help/variable/CMAKE_OSX_ARCHITECTURES.rst
new file mode 100644
index 0000000..b9de518
--- /dev/null
+++ b/Help/variable/CMAKE_OSX_ARCHITECTURES.rst
@@ -0,0 +1,10 @@
+CMAKE_OSX_ARCHITECTURES
+-----------------------
+
+Target specific architectures for OS X.
+
+This variable is used to initialize the :prop_tgt:`OSX_ARCHITECTURES`
+property on each target as it is creaed. See that target property
+for additional information.
+
+.. include:: CMAKE_OSX_VARIABLE.txt
diff --git a/Help/variable/CMAKE_OSX_DEPLOYMENT_TARGET.rst b/Help/variable/CMAKE_OSX_DEPLOYMENT_TARGET.rst
new file mode 100644
index 0000000..4fb2caa
--- /dev/null
+++ b/Help/variable/CMAKE_OSX_DEPLOYMENT_TARGET.rst
@@ -0,0 +1,13 @@
+CMAKE_OSX_DEPLOYMENT_TARGET
+---------------------------
+
+Specify the minimum version of OS X on which the target binaries are
+to be deployed. CMake uses this value for the ``-mmacosx-version-min``
+flag and to help choose the default SDK
+(see :variable:`CMAKE_OSX_SYSROOT`).
+
+If not set explicitly the value is initialized by the
+``MACOSX_DEPLOYMENT_TARGET`` environment variable, if set,
+and otherwise computed based on the host platform.
+
+.. include:: CMAKE_OSX_VARIABLE.txt
diff --git a/Help/variable/CMAKE_OSX_SYSROOT.rst b/Help/variable/CMAKE_OSX_SYSROOT.rst
new file mode 100644
index 0000000..f1d58c6
--- /dev/null
+++ b/Help/variable/CMAKE_OSX_SYSROOT.rst
@@ -0,0 +1,13 @@
+CMAKE_OSX_SYSROOT
+-----------------
+
+Specify the location or name of the OS X platform SDK to be used.
+CMake uses this value to compute the value of the ``-isysroot`` flag
+or equivalent and to help the ``find_*`` commands locate files in
+the SDK.
+
+If not set explicitly the value is initialized by the ``SDKROOT``
+environment variable, if set, and otherwise computed based on the
+:variable:`CMAKE_OSX_DEPLOYMENT_TARGET` or the host platform.
+
+.. include:: CMAKE_OSX_VARIABLE.txt
diff --git a/Help/variable/CMAKE_OSX_VARIABLE.txt b/Help/variable/CMAKE_OSX_VARIABLE.txt
new file mode 100644
index 0000000..385f871
--- /dev/null
+++ b/Help/variable/CMAKE_OSX_VARIABLE.txt
@@ -0,0 +1,6 @@
+The value of this variable should be set prior to the first
+:command:`project` or :command:`enable_language` command invocation
+because it may influence configuration of the toolchain and flags.
+It is intended to be set locally by the user creating a build tree.
+
+This variable is ignored on platforms other than OS X.
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 9f5b8a4..d868cb3 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -85,7 +85,31 @@ if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
endif()
-if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
+# We check if the variable was manually set and not cached, in order to
+# allow projects to set the values as normal variables before including
+# GNUInstallDirs to avoid having the entries cached or user-editable. It
+# replaces the "if(NOT DEFINED CMAKE_INSTALL_XXX)" checks in all the
+# other cases.
+# If CMAKE_INSTALL_LIBDIR is defined, if _libdir_set is false, then the
+# variable is a normal one, otherwise it is a cache one.
+get_property(_libdir_set CACHE CMAKE_INSTALL_LIBDIR PROPERTY TYPE SET)
+if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set
+ AND DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX
+ AND NOT "${_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX}" STREQUAL "${CMAKE_INSTALL_PREFIX}"))
+ # If CMAKE_INSTALL_LIBDIR is not defined, it is always executed.
+ # Otherwise:
+ # * if _libdir_set is false it is not executed (meaning that it is
+ # not a cache variable)
+ # * if _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX is not defined it is
+ # not executed
+ # * if _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX and
+ # CMAKE_INSTALL_PREFIX are the same string it is not executed.
+ # _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX is updated after the
+ # execution, of this part of code, therefore at the next inclusion
+ # of the file, CMAKE_INSTALL_LIBDIR is defined, and the 2 strings
+ # are equal, meaning that the if is not executed the code the
+ # second time.
+
set(_LIBDIR_DEFAULT "lib")
# Override this default 'lib' with 'lib64' iff:
# - we are on Linux system but NOT cross-compiling
@@ -94,13 +118,30 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
+ # and CMAKE_INSTALL_PREFIX is "/usr"
# See http://wiki.debian.org/Multiarch
+ if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
+ set(__LAST_LIBDIR_DEFAULT "lib")
+ # __LAST_LIBDIR_DEFAULT is the default value that we compute from
+ # _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX, not a cache entry for
+ # the value that was last used as the default.
+ # This value is used to figure out whether the user changed the
+ # CMAKE_INSTALL_LIBDIR value manually, or if the value was the
+ # default one. When CMAKE_INSTALL_PREFIX changes, the value is
+ # updated to the new default, unless the user explicitly changed it.
+ endif()
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
AND NOT CMAKE_CROSSCOMPILING)
if (EXISTS "/etc/debian_version") # is this a debian system ?
- if(CMAKE_LIBRARY_ARCHITECTURE)
- set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
- endif()
+ if(CMAKE_LIBRARY_ARCHITECTURE)
+ if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
+ set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+ endif()
+ if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX
+ AND "${_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
+ set(__LAST_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+ endif()
+ endif()
else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
message(AUTHOR_WARNING
@@ -109,12 +150,25 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
else()
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(_LIBDIR_DEFAULT "lib64")
+ if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
+ set(__LAST_LIBDIR_DEFAULT "lib64")
+ endif()
endif()
endif()
endif()
endif()
- set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
+ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
+ set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
+ elseif(DEFINED __LAST_LIBDIR_DEFAULT
+ AND "${__LAST_LIBDIR_DEFAULT}" STREQUAL "${CMAKE_INSTALL_LIBDIR}")
+ set_property(CACHE CMAKE_INSTALL_LIBDIR PROPERTY VALUE "${_LIBDIR_DEFAULT}")
+ endif()
endif()
+# Save for next run
+set(_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "CMAKE_INSTALL_PREFIX during last run")
+unset(_libdir_set)
+unset(__LAST_LIBDIR_DEFAULT)
+
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index d79ac73..ff35331 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 12)
-set(CMake_VERSION_TWEAK 20140115)
+set(CMake_VERSION_TWEAK 20140120)
#set(CMake_VERSION_RC 1)
diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx
index e7fedc5..3881045 100644
--- a/Source/QtDialog/AddCacheEntry.cxx
+++ b/Source/QtDialog/AddCacheEntry.cxx
@@ -15,14 +15,16 @@
#include <QCompleter>
static const int NumTypes = 4;
+static const int DefaultTypeIndex = 0;
static const QByteArray TypeStrings[NumTypes] =
{ "BOOL", "PATH", "FILEPATH", "STRING" };
static const QCMakeProperty::PropertyType Types[NumTypes] =
{ QCMakeProperty::BOOL, QCMakeProperty::PATH,
QCMakeProperty::FILEPATH, QCMakeProperty::STRING};
-AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& completions)
- : QWidget(p)
+AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& varNames,
+ const QStringList& varTypes)
+ : QWidget(p), VarNames(varNames), VarTypes(varTypes)
{
this->setupUi(this);
for(int i=0; i<NumTypes; i++)
@@ -43,7 +45,10 @@ AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& completions)
this->setTabOrder(path, filepath);
this->setTabOrder(filepath, string);
this->setTabOrder(string, this->Description);
- this->Name->setCompleter(new QCompleter(completions, this));
+ QCompleter *completer = new QCompleter(this->VarNames, this);
+ this->Name->setCompleter(completer);
+ connect(completer, SIGNAL(activated(const QString&)),
+ this, SLOT(onCompletionActivated(const QString&)));
}
QString AddCacheEntry::name() const
@@ -77,7 +82,32 @@ QCMakeProperty::PropertyType AddCacheEntry::type() const
{
return Types[idx];
}
- return QCMakeProperty::BOOL;
+ return Types[DefaultTypeIndex];
}
+QString AddCacheEntry::typeString() const
+{
+ int idx = this->Type->currentIndex();
+ if(idx >= 0 && idx < NumTypes)
+ {
+ return TypeStrings[idx];
+ }
+ return TypeStrings[DefaultTypeIndex];
+}
+void AddCacheEntry::onCompletionActivated(const QString &text)
+{
+ int idx = this->VarNames.indexOf(text);
+ if (idx != -1)
+ {
+ QString vartype = this->VarTypes[idx];
+ for (int i = 0; i < NumTypes; i++)
+ {
+ if (TypeStrings[i] == vartype)
+ {
+ this->Type->setCurrentIndex(i);
+ break;
+ }
+ }
+ }
+}
diff --git a/Source/QtDialog/AddCacheEntry.h b/Source/QtDialog/AddCacheEntry.h
index e219d4e..38c3a74 100644
--- a/Source/QtDialog/AddCacheEntry.h
+++ b/Source/QtDialog/AddCacheEntry.h
@@ -24,12 +24,21 @@ class AddCacheEntry : public QWidget, public Ui::AddCacheEntry
{
Q_OBJECT
public:
- AddCacheEntry(QWidget* p, const QStringList& completions);
+ AddCacheEntry(QWidget* p, const QStringList& varNames,
+ const QStringList& varTypes);
QString name() const;
QVariant value() const;
QString description() const;
QCMakeProperty::PropertyType type() const;
+ QString typeString() const;
+
+private slots:
+ void onCompletionActivated(const QString &text);
+
+private:
+ const QStringList& VarNames;
+ const QStringList& VarTypes;
};
#endif
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 1903c02..f62afd6 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -70,8 +70,10 @@ CMakeSetupDialog::CMakeSetupDialog()
restoreGeometry(settings.value("geometry").toByteArray());
restoreState(settings.value("windowState").toByteArray());
- this->AddVariableCompletions = settings.value("AddVariableCompletionEntries",
+ this->AddVariableNames = settings.value("AddVariableNames",
QStringList("CMAKE_INSTALL_PREFIX")).toStringList();
+ this->AddVariableTypes = settings.value("AddVariableTypes",
+ QStringList("PATH")).toStringList();
QWidget* cont = new QWidget(this);
this->setupUi(cont);
@@ -1049,7 +1051,8 @@ void CMakeSetupDialog::addCacheEntry()
dialog.resize(400, 200);
dialog.setWindowTitle(tr("Add Cache Entry"));
QVBoxLayout* l = new QVBoxLayout(&dialog);
- AddCacheEntry* w = new AddCacheEntry(&dialog, this->AddVariableCompletions);
+ AddCacheEntry* w = new AddCacheEntry(&dialog, this->AddVariableNames,
+ this->AddVariableTypes);
QDialogButtonBox* btns = new QDialogButtonBox(
QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
Qt::Horizontal, &dialog);
@@ -1064,23 +1067,26 @@ void CMakeSetupDialog::addCacheEntry()
m->insertProperty(w->type(), w->name(), w->description(), w->value(), false);
// only add variable names to the completion which are new
- if (!this->AddVariableCompletions.contains(w->name()))
+ if (!this->AddVariableNames.contains(w->name()))
{
- this->AddVariableCompletions << w->name();
+ this->AddVariableNames << w->name();
+ this->AddVariableTypes << w->typeString();
// limit to at most 100 completion items
- if (this->AddVariableCompletions.size() > 100)
+ if (this->AddVariableNames.size() > 100)
{
- this->AddVariableCompletions.removeFirst();
+ this->AddVariableNames.removeFirst();
+ this->AddVariableTypes.removeFirst();
}
// make sure CMAKE_INSTALL_PREFIX is always there
- if (!this->AddVariableCompletions.contains("CMAKE_INSTALL_PREFIX"))
+ if (!this->AddVariableNames.contains("CMAKE_INSTALL_PREFIX"))
{
- this->AddVariableCompletions << QString("CMAKE_INSTALL_PREFIX");
+ this->AddVariableNames << "CMAKE_INSTALL_PREFIX";
+ this->AddVariableTypes << "PATH";
}
QSettings settings;
settings.beginGroup("Settings/StartPath");
- settings.setValue("AddVariableCompletionEntries",
- this->AddVariableCompletions);
+ settings.setValue("AddVariableNames", this->AddVariableNames);
+ settings.setValue("AddVariableTypes", this->AddVariableTypes);
}
}
}
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 963c7d1..1b26c64 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -110,7 +110,8 @@ protected:
QTextCharFormat ErrorFormat;
QTextCharFormat MessageFormat;
- QStringList AddVariableCompletions;
+ QStringList AddVariableNames;
+ QStringList AddVariableTypes;
QStringList FindHistory;
QEventLoop LocalLoop;
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index a7ffded..b55334f 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -24,14 +24,14 @@ bool cmAddDependenciesCommand
}
std::string target_name = args[0];
- if(this->Makefile->IsAlias(target_name.c_str()))
+ if(this->Makefile->IsAlias(target_name))
{
cmOStringStream e;
e << "Cannot add target-level dependencies to alias target \""
<< target_name << "\".\n";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
}
- if(cmTarget* target = this->Makefile->FindTargetToUse(target_name.c_str()))
+ if(cmTarget* target = this->Makefile->FindTargetToUse(target_name))
{
if (target->GetType() == cmTarget::INTERFACE_LIBRARY)
{
diff --git a/Source/cmAddExecutableCommand.cxx b/Source/cmAddExecutableCommand.cxx
index a352be0..62b6667 100644
--- a/Source/cmAddExecutableCommand.cxx
+++ b/Source/cmAddExecutableCommand.cxx
@@ -201,7 +201,7 @@ bool cmAddExecutableCommand
if(importTarget)
{
// Make sure the target does not already exist.
- if(this->Makefile->FindTargetToUse(exename.c_str()))
+ if(this->Makefile->FindTargetToUse(exename))
{
cmOStringStream e;
e << "cannot create imported target \"" << exename
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index 2627445..a29f784 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -363,7 +363,7 @@ bool cmAddLibraryCommand
}
// Make sure the target does not already exist.
- if(this->Makefile->FindTargetToUse(libName.c_str()))
+ if(this->Makefile->FindTargetToUse(libName))
{
cmOStringStream e;
e << "cannot create imported target \"" << libName
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index a848e4f..6511510 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -411,7 +411,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
i != utils.end(); ++i)
{
if(cmTarget const* transitive_dependee =
- dependee->GetMakefile()->FindTargetToUse(i->c_str()))
+ dependee->GetMakefile()->FindTargetToUse(*i))
{
this->AddTargetDepend(depender_index, transitive_dependee, false);
}
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 78bb9a6..bbdb3a1 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -93,7 +93,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
else if(doing == DoingLinkLibraries)
{
libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" ";
- if(cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i].c_str()))
+ if(cmTarget *tgt = this->Makefile->FindTargetToUse(argv[i]))
{
switch(tgt->GetType())
{
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index f2f77ee..f24dfa2 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -41,7 +41,7 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const
std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
{
std::string const& argv0 = this->CC.GetCommandLines()[c][0];
- cmTarget* target = this->Makefile->FindTargetToUse(argv0.c_str());
+ cmTarget* target = this->Makefile->FindTargetToUse(argv0);
if(target && target->GetType() == cmTarget::EXECUTABLE &&
(target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING")))
{
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index b669cd1..858f76c 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -35,7 +35,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
tei = targets.begin();
tei != targets.end(); ++tei)
{
- cmTarget *te = this->Makefile->FindTargetToUse(tei->c_str());
+ cmTarget *te = this->Makefile->FindTargetToUse(*tei);
expectedTargets += sep + this->Namespace + te->GetExportName();
sep = " ";
if(this->ExportedTargets.insert(te).second)
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 7c97d8d..db56aaf 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -159,7 +159,7 @@ bool cmExportCommand
currentTarget != this->Targets.GetVector().end();
++currentTarget)
{
- if (this->Makefile->IsAlias(currentTarget->c_str()))
+ if (this->Makefile->IsAlias(*currentTarget))
{
cmOStringStream e;
e << "given ALIAS target \"" << *currentTarget
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 13bff19..4a161ee 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -534,7 +534,7 @@ cmExportFileGenerator::AddTargetNamespace(std::string &input,
{
cmMakefile *mf = target->GetMakefile();
- cmTarget *tgt = mf->FindTargetToUse(input.c_str());
+ cmTarget *tgt = mf->FindTargetToUse(input);
if (!tgt)
{
return false;
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 8d37b62..a8a91d6 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -109,7 +109,7 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget const* target,
for(std::vector<std::string>::const_iterator li = depends.begin();
li != depends.end(); ++li)
{
- cmTarget *tgt = target->GetMakefile()->FindTargetToUse(li->c_str());
+ cmTarget *tgt = target->GetMakefile()->FindTargetToUse(*li);
if(tgt && emitted.insert(tgt).second)
{
this->Exports.push_back(tgt);
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index 4ce1ea5..4dd81be 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -120,7 +120,7 @@ void cmFLTKWrapUICommand::FinalPass()
// people should add the srcs to the target themselves, but the old command
// didn't support that, so check and see if they added the files in and if
// they didn;t then print a warning and add then anyhow
- cmTarget* target = this->Makefile->FindTarget(this->Target.c_str());
+ cmTarget* target = this->Makefile->FindTarget(this->Target);
if(!target)
{
std::string msg =
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 1feb03a..7036992 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -822,7 +822,7 @@ std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
// self-referencing loop.
continue;
}
- if (context->Makefile->FindTargetToUse(it->c_str()))
+ if (context->Makefile->FindTargetToUse(*it))
{
depString +=
sep + "$<TARGET_PROPERTY:" + *it + "," + interfacePropertyName + ">";
@@ -912,18 +912,16 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
}
if(propertyName == "ALIASED_TARGET")
{
- if(context->Makefile->IsAlias(targetName.c_str()))
+ if(context->Makefile->IsAlias(targetName))
{
- if(cmTarget* tgt =
- context->Makefile->FindTargetToUse(targetName.c_str()))
+ if(cmTarget* tgt = context->Makefile->FindTargetToUse(targetName))
{
return tgt->GetName();
}
}
return "";
}
- target = context->Makefile->FindTargetToUse(
- targetName.c_str());
+ target = context->Makefile->FindTargetToUse(targetName);
if (!target)
{
@@ -1476,7 +1474,7 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
"Expression syntax not recognized.");
return std::string();
}
- cmTarget* target = context->Makefile->FindTargetToUse(name.c_str());
+ cmTarget* target = context->Makefile->FindTargetToUse(name);
if(!target)
{
::reportError(context, content->GetOriginalExpression(),
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 0fcee3e..2573c85 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -68,7 +68,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, const std::string &name,
std::vector<std::string>& result,
bool excludeImported)
{
- cmTarget* depTgt = mf->FindTargetToUse(name.c_str());
+ cmTarget* depTgt = mf->FindTargetToUse(name);
if (!depTgt)
{
@@ -230,7 +230,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir,
{
if (uniqueDeps.insert(*li).second)
{
- cmTarget* tgt = this->Makefile->FindTargetToUse(li->c_str());
+ cmTarget* tgt = this->Makefile->FindTargetToUse(*li);
if (!tgt)
{
@@ -394,7 +394,7 @@ void cmGeneratorTarget::LookupObjectLibraries()
oli != objLibs.end(); ++oli)
{
std::string const& objLibName = *oli;
- if(cmTarget* objLib = this->Makefile->FindTargetToUse(objLibName.c_str()))
+ if(cmTarget* objLib = this->Makefile->FindTargetToUse(objLibName))
{
if(objLib->GetType() == cmTarget::OBJECT_LIBRARY)
{
@@ -607,7 +607,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep)
}
// Check for a target with this name.
- if(cmTarget* t = this->Makefile->FindTargetToUse(util.c_str()))
+ if(cmTarget* t = this->Makefile->FindTargetToUse(util))
{
// If we find the target and the dep was given as a full path,
// then make sure it was not a full path to something else, and
@@ -661,7 +661,7 @@ cmTargetTraceDependencies
{
std::string const& command = *cit->begin();
// Check for a target with this name.
- if(cmTarget* t = this->Makefile->FindTargetToUse(command.c_str()))
+ if(cmTarget* t = this->Makefile->FindTargetToUse(command))
{
if(t->GetType() == cmTarget::EXECUTABLE)
{
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index a1454a3..33c43ca 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -290,17 +290,17 @@ bool cmGetPropertyCommand::HandleTargetMode()
if(this->PropertyName == "ALIASED_TARGET")
{
- if(this->Makefile->IsAlias(this->Name.c_str()))
+ if(this->Makefile->IsAlias(this->Name))
{
if(cmTarget* target =
- this->Makefile->FindTargetToUse(this->Name.c_str()))
+ this->Makefile->FindTargetToUse(this->Name))
{
return this->StoreResult(target->GetName());
}
}
return this->StoreResult((this->Variable + "-NOTFOUND").c_str());
}
- if(cmTarget* target = this->Makefile->FindTargetToUse(this->Name.c_str()))
+ if(cmTarget* target = this->Makefile->FindTargetToUse(this->Name))
{
return this->StoreResult(target->GetProperty(this->PropertyName.c_str()));
}
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index 488cc28..4aa49fe 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -21,7 +21,7 @@ bool cmGetTargetPropertyCommand
return false;
}
std::string var = args[0].c_str();
- const char* targetName = args[1].c_str();
+ const std::string& targetName = args[1];
const char *prop = 0;
if(args[2] == "ALIASED_TARGET")
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 65b01db..5e1f1ed 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1107,46 +1107,24 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
/*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
- /*restat=*/ true,
+ /*restat=*/ false,
/*generator=*/ true);
- cmNinjaDeps implicitDeps, outputs, temp;
- outputs.push_back(NINJA_BUILD_FILE);
+ cmNinjaDeps implicitDeps;
for (std::vector<cmLocalGenerator *>::const_iterator i =
this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i) {
const std::vector<std::string>& lf = (*i)->GetMakefile()->GetListFiles();
implicitDeps.insert(implicitDeps.end(), lf.begin(), lf.end());
-
- const std::vector<std::string>& of = (*i)->GetMakefile()->GetOutputFiles();
- temp.insert(temp.end(), of.begin(), of.end());
}
-
- //Add the CMakeCache.txt file to the implicit depends so that we catch
- //when somebody manually modifies the file.
- implicitDeps.push_back("CMakeCache.txt");
-
- //make sure nothing is in implicit depends twice
std::sort(implicitDeps.begin(), implicitDeps.end());
implicitDeps.erase(std::unique(implicitDeps.begin(), implicitDeps.end()),
implicitDeps.end());
-
-
- //make sure nothing is in outputs depends twice
- std::sort(temp.begin(), temp.end());
- temp.erase(std::unique(temp.begin(), temp.end()),
- temp.end());
-
- //make sure that anything that is in implicitDeps is also NOT in outputs
- std::set_difference(temp.begin(),
- temp.end(),
- implicitDeps.begin(),
- implicitDeps.end(),
- std::back_inserter(outputs));
+ implicitDeps.push_back("CMakeCache.txt");
this->WriteBuild(os,
"Re-run CMake if any of its inputs changed.",
"RERUN_CMAKE",
- outputs,
+ /*outputs=*/ cmNinjaDeps(1, NINJA_BUILD_FILE),
/*explicitDeps=*/ cmNinjaDeps(),
implicitDeps,
/*orderOnlyDeps=*/ cmNinjaDeps(),
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f7a42fc..41961ed 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -753,7 +753,8 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
//----------------------------------------------------------------------------
std::string
GetSourcecodeValueFromFileExtension(const std::string& _ext,
- const std::string& lang)
+ const std::string& lang,
+ bool& keepLastKnownFileType)
{
std::string ext = cmSystemTools::LowerCase(_ext);
std::string sourcecode = "sourcecode";
@@ -764,10 +765,12 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext,
}
else if(ext == "xib")
{
+ keepLastKnownFileType = true;
sourcecode = "file.xib";
}
else if(ext == "storyboard")
{
+ keepLastKnownFileType = true;
sourcecode = "file.storyboard";
}
else if(ext == "mm")
@@ -778,10 +781,6 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext,
{
sourcecode += ".c.objc";
}
- else if(ext == "xib")
- {
- sourcecode += ".file.xib";
- }
else if(ext == "plist")
{
sourcecode += ".text.plist";
@@ -797,6 +796,7 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext,
}
else if(ext == "png" || ext == "gif" || ext == "jpg")
{
+ keepLastKnownFileType = true;
sourcecode = "image";
}
else if(ext == "txt")
@@ -875,8 +875,10 @@ cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
}
else
{
- std::string sourcecode = GetSourcecodeValueFromFileExtension(ext, lang);
- const char* attribute = (sourcecode == "file.storyboard") ?
+ bool keepLastKnownFileType = false;
+ std::string sourcecode = GetSourcecodeValueFromFileExtension(ext,
+ lang, keepLastKnownFileType);
+ const char* attribute = keepLastKnownFileType ?
"lastKnownFileType" :
"explicitFileType";
fileRef->AddAttribute(attribute,
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 57cec5b..ee95c05 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -543,7 +543,7 @@ namespace
if (*arg == "TARGET" && argP1 != newArgs.end())
{
HandlePredicate(
- makefile->FindTargetToUse((argP1)->c_str())? true:false,
+ makefile->FindTargetToUse(*argP1)?true:false,
reducible, arg, newArgs, argP1, argP2);
}
// is a variable defined
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 10578f2..6f2dd65 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -363,7 +363,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
++targetIt)
{
- if (this->Makefile->IsAlias(targetIt->c_str()))
+ if (this->Makefile->IsAlias(*targetIt))
{
cmOStringStream e;
e << "TARGETS given target \"" << (*targetIt)
@@ -372,7 +372,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
return false;
}
// Lookup this target in the current directory.
- if(cmTarget* target=this->Makefile->FindTarget(targetIt->c_str()))
+ if(cmTarget* target=this->Makefile->FindTarget(*targetIt))
{
// Found the target. Check its type.
if(target->GetType() != cmTarget::EXECUTABLE &&
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 3effe38..bd910e2 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2021,7 +2021,7 @@ bool cmLocalGenerator::GetRealDependency(const char* inName,
}
// Look for a CMake target with the given name.
- if(cmTarget* target = this->Makefile->FindTargetToUse(name.c_str()))
+ if(cmTarget* target = this->Makefile->FindTargetToUse(name))
{
// make sure it is not just a coincidence that the target name
// found is part of the inName
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 479e712..222cdb6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3859,7 +3859,8 @@ const char* cmMakefile::GetFeature(const char* feature, const char* config)
return 0;
}
-cmTarget* cmMakefile::FindTarget(const char* name, bool excludeAliases) const
+cmTarget* cmMakefile::FindTarget(const std::string& name,
+ bool excludeAliases) const
{
if (!excludeAliases)
{
@@ -4063,7 +4064,8 @@ cmMakefile::AddImportedTarget(const char* name, cmTarget::TargetType type,
}
//----------------------------------------------------------------------------
-cmTarget* cmMakefile::FindTargetToUse(const char* name, bool excludeAliases)
+cmTarget* cmMakefile::FindTargetToUse(const std::string& name,
+ bool excludeAliases)
{
// Look for an imported target. These take priority because they
// are more local in scope and do not have to be globally unique.
@@ -4081,16 +4083,18 @@ cmTarget* cmMakefile::FindTargetToUse(const char* name, bool excludeAliases)
}
// Look for a target built in this project.
- return this->LocalGenerator->GetGlobalGenerator()->FindTarget(0, name,
+ return this->LocalGenerator->GetGlobalGenerator()->FindTarget(0,
+ name.c_str(),
excludeAliases);
}
//----------------------------------------------------------------------------
-bool cmMakefile::IsAlias(const char *name)
+bool cmMakefile::IsAlias(const std::string& name)
{
if (this->AliasTargets.find(name) != this->AliasTargets.end())
return true;
- return this->GetLocalGenerator()->GetGlobalGenerator()->IsAlias(name);
+ return this->GetLocalGenerator()->GetGlobalGenerator()->IsAlias(
+ name.c_str());
}
//----------------------------------------------------------------------------
@@ -4107,7 +4111,7 @@ cmGeneratorTarget* cmMakefile::FindGeneratorTargetToUse(const char* name)
bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
bool isCustom)
{
- if(this->IsAlias(name.c_str()))
+ if(this->IsAlias(name))
{
cmOStringStream e;
e << "cannot create target \"" << name
@@ -4115,7 +4119,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
msg = e.str();
return false;
}
- if(cmTarget* existing = this->FindTargetToUse(name.c_str()))
+ if(cmTarget* existing = this->FindTargetToUse(name))
{
// The name given conflicts with an existing target. Produce an
// error in a compatible way.
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index d9fc93c..0232ffe 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -533,12 +533,14 @@ public:
this->GeneratorTargets = targets;
}
- cmTarget* FindTarget(const char* name, bool excludeAliases = false) const;
+ cmTarget* FindTarget(const std::string& name,
+ bool excludeAliases = false) const;
/** Find a target to use in place of the given name. The target
returned may be imported or built within the project. */
- cmTarget* FindTargetToUse(const char* name, bool excludeAliases = false);
- bool IsAlias(const char *name);
+ cmTarget* FindTargetToUse(const std::string& name,
+ bool excludeAliases = false);
+ bool IsAlias(const std::string& name);
cmGeneratorTarget* FindGeneratorTargetToUse(const char* name);
/**
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index 4207860..1a6f1d6 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -244,12 +244,12 @@ bool cmSetPropertyCommand::HandleTargetMode()
for(std::set<cmStdString>::const_iterator ni = this->Names.begin();
ni != this->Names.end(); ++ni)
{
- if (this->Makefile->IsAlias(ni->c_str()))
+ if (this->Makefile->IsAlias(*ni))
{
this->SetError("can not be used on an ALIAS target.");
return false;
}
- if(cmTarget* target = this->Makefile->FindTargetToUse(ni->c_str()))
+ if(cmTarget* target = this->Makefile->FindTargetToUse(*ni))
{
// Handle the current target.
if(!this->HandleTarget(target))
diff --git a/Source/cmSetTargetPropertiesCommand.cxx b/Source/cmSetTargetPropertiesCommand.cxx
index 78ef393..dab4180 100644
--- a/Source/cmSetTargetPropertiesCommand.cxx
+++ b/Source/cmSetTargetPropertiesCommand.cxx
@@ -72,7 +72,7 @@ bool cmSetTargetPropertiesCommand
int i;
for(i = 0; i < numFiles; ++i)
{
- if (this->Makefile->IsAlias(args[i].c_str()))
+ if (this->Makefile->IsAlias(args[i]))
{
this->SetError("can not be used on an ALIAS target.");
return false;
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 24fa0c5..21f8d4c 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1681,14 +1681,14 @@ static void processIncludeDirectories(cmTarget const* tgt,
evaluatedTargetName = cge->Evaluate(mf, config, false, tgt, 0, 0);
}
- cmTarget *dependentTarget = mf->FindTargetToUse(targetName.c_str());
+ cmTarget *dependentTarget = mf->FindTargetToUse(targetName);
const bool fromImported = dependentTarget
&& dependentTarget->IsImported();
cmTarget *evaluatedDependentTarget =
(targetName != evaluatedTargetName)
- ? mf->FindTargetToUse(evaluatedTargetName.c_str())
+ ? mf->FindTargetToUse(evaluatedTargetName)
: 0;
targetName = evaluatedTargetName;
@@ -1860,7 +1860,7 @@ cmTarget::GetIncludeDirectories(const char *config) const
ge.Parse(it->Value);
std::string result = cge->Evaluate(this->Makefile, config,
false, this, 0, 0);
- if (!this->Makefile->FindTargetToUse(result.c_str()))
+ if (!this->Makefile->FindTargetToUse(result))
{
continue;
}
@@ -2089,7 +2089,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config,
false, this, 0, 0);
- if (!this->Makefile->FindTargetToUse(targetResult.c_str()))
+ if (!this->Makefile->FindTargetToUse(targetResult))
{
continue;
}
@@ -2202,7 +2202,7 @@ void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
ge.Parse(it->Value);
std::string targetResult = cge->Evaluate(this->Makefile, config,
false, this, 0, 0);
- if (!this->Makefile->FindTargetToUse(targetResult.c_str()))
+ if (!this->Makefile->FindTargetToUse(targetResult))
{
continue;
}
@@ -2861,7 +2861,7 @@ public:
for(std::vector<std::string>::const_iterator
li = iface->Libraries.begin(); li != iface->Libraries.end(); ++li)
{
- this->Visit(mf->FindTargetToUse(li->c_str()));
+ this->Visit(mf->FindTargetToUse(*li));
}
}
private:
@@ -2969,7 +2969,7 @@ void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc,
for(std::vector<std::string>::const_iterator li = impl->Libraries.begin();
li != impl->Libraries.end(); ++li)
{
- cll.Visit(this->Makefile->FindTargetToUse(li->c_str()));
+ cll.Visit(this->Makefile->FindTargetToUse(*li));
}
// Store the transitive closure of languages.
@@ -5414,7 +5414,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
{
if(emitted.insert(*li).second)
{
- if(cmTarget* tgt = this->Makefile->FindTargetToUse(li->c_str()))
+ if(cmTarget* tgt = this->Makefile->FindTargetToUse(*li))
{
// This is a runtime dependency on another shared library.
if(tgt->GetType() == cmTarget::SHARED_LIBRARY)
@@ -5624,7 +5624,7 @@ void cmTarget::ComputeLinkImplementation(const char* config,
}
continue;
}
- cmTarget *tgt = this->Makefile->FindTargetToUse(li->c_str());
+ cmTarget *tgt = this->Makefile->FindTargetToUse(*li);
if(!tgt && std::string(item).find("::") != std::string::npos)
{
@@ -5695,7 +5695,7 @@ void cmTarget::ComputeLinkImplementation(const char* config,
i = this->ObjectLibraries.begin();
i != this->ObjectLibraries.end(); ++i)
{
- if(cmTarget* objLib = this->Makefile->FindTargetToUse(i->c_str()))
+ if(cmTarget* objLib = this->Makefile->FindTargetToUse(*i))
{
if(objLib->GetType() == cmTarget::OBJECT_LIBRARY)
{
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 209609d..02da933 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -31,7 +31,7 @@ bool cmTargetLinkLibrariesCommand
return false;
}
- if (this->Makefile->IsAlias(args[0].c_str()))
+ if (this->Makefile->IsAlias(args[0]))
{
this->SetError("can not be used on an ALIAS target.");
return false;
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index e7b6999..195690e 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -26,7 +26,7 @@ bool cmTargetPropCommandBase
}
// Lookup the target for which libraries are specified.
- if (this->Makefile->IsAlias(args[0].c_str()))
+ if (this->Makefile->IsAlias(args[0]))
{
this->SetError("can not be used on an ALIAS target.");
return false;
@@ -36,7 +36,7 @@ bool cmTargetPropCommandBase
->GetGlobalGenerator()->FindTarget(0, args[0].c_str());
if(!this->Target)
{
- this->Target = this->Makefile->FindTargetToUse(args[0].c_str());
+ this->Target = this->Makefile->FindTargetToUse(args[0]);
}
if(!this->Target)
{
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index d962fb2..5dc3e60 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -82,7 +82,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// be translated.
std::string exe = command[0];
cmMakefile* mf = this->Test->GetMakefile();
- cmTarget* target = mf->FindTargetToUse(exe.c_str());
+ cmTarget* target = mf->FindTargetToUse(exe);
if(target && target->GetType() == cmTarget::EXECUTABLE)
{
// Use the target file on disk.