summaryrefslogtreecommitdiffstats
path: root/Source/cmCoreTryCompile.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-06 22:31:47 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-08 18:05:31 (GMT)
commitfabf1fbabb4fc67844d5b2210e70a9829a59ff23 (patch)
tree9e40776ac9efdcb7b674f2e25f1d47f74b3b7baf /Source/cmCoreTryCompile.cxx
parenta6ae2ea72bc0d4149c2ff6118fcfd577e95c680d (diff)
downloadCMake-fabf1fbabb4fc67844d5b2210e70a9829a59ff23.zip
CMake-fabf1fbabb4fc67844d5b2210e70a9829a59ff23.tar.gz
CMake-fabf1fbabb4fc67844d5b2210e70a9829a59ff23.tar.bz2
stringapi: Use strings in target name
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r--Source/cmCoreTryCompile.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 1e8e4d0..b0e2b6f 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -28,7 +28,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
const char* sourceDirectory = argv[2].c_str();
const char* projectName = 0;
- const char* targetName = 0;
+ std::string targetName;
std::vector<std::string> cmakeFlags;
std::vector<std::string> compileDefs;
std::string outputVariable;
@@ -450,7 +450,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n",
this->BinaryDirectory.c_str());
/* Create the actual executable. */
- fprintf(fout, "add_executable(%s", targetName);
+ fprintf(fout, "add_executable(%s", targetName.c_str());
for(std::vector<std::string>::iterator si = sources.begin();
si != sources.end(); ++si)
{
@@ -466,12 +466,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if (useOldLinkLibs)
{
fprintf(fout,
- "target_link_libraries(%s ${LINK_LIBRARIES})\n",targetName);
+ "target_link_libraries(%s ${LINK_LIBRARIES})\n",
+ targetName.c_str());
}
else
{
fprintf(fout, "target_link_libraries(%s %s)\n",
- targetName,
+ targetName.c_str(),
libsToLink.c_str());
}
fclose(fout);
@@ -610,7 +611,7 @@ void cmCoreTryCompile::CleanupFiles(const char* binDir)
}
}
-void cmCoreTryCompile::FindOutputFile(const char* targetName)
+void cmCoreTryCompile::FindOutputFile(const std::string& targetName)
{
this->FindErrorMessage = "";
this->OutputFile = "";