summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-07 20:02:41 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-08 18:05:32 (GMT)
commit473ca1ac4a5df336ff09ee2c666e437eabf43bc9 (patch)
tree1a98133fcda79243873ee7a8246b742097759cea /Source
parenta5996111164a4c4121e7d1fa08dbcd0983bb3589 (diff)
downloadCMake-473ca1ac4a5df336ff09ee2c666e437eabf43bc9.zip
CMake-473ca1ac4a5df336ff09ee2c666e437eabf43bc9.tar.gz
CMake-473ca1ac4a5df336ff09ee2c666e437eabf43bc9.tar.bz2
stringapi: Use string for OS X resource names
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx6
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.h5
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx9
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.h3
4 files changed, 13 insertions, 10 deletions
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index 76e15fb..95ffab5 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -227,7 +227,7 @@ int cmCPackOSXX11Generator::InitializeInternal()
//----------------------------------------------------------------------
/*
-bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
+bool cmCPackOSXX11Generator::CopyCreateResourceFile(const std::string& name)
{
std::string uname = cmSystemTools::UpperCase(name);
std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
@@ -271,7 +271,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
*/
//----------------------------------------------------------------------
-bool cmCPackOSXX11Generator::CopyResourcePlistFile(const char* name,
+bool cmCPackOSXX11Generator::CopyResourcePlistFile(const std::string& name,
const char* dir, const char* outputFileName /* = 0 */,
bool copyOnly /* = false */)
{
@@ -288,7 +288,7 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile(const char* name,
if ( !outputFileName )
{
- outputFileName = name;
+ outputFileName = name.c_str();
}
std::string destFileName = dir;
diff --git a/Source/CPack/cmCPackOSXX11Generator.h b/Source/CPack/cmCPackOSXX11Generator.h
index b7bd243..7a93f5a 100644
--- a/Source/CPack/cmCPackOSXX11Generator.h
+++ b/Source/CPack/cmCPackOSXX11Generator.h
@@ -37,8 +37,9 @@ protected:
virtual const char* GetPackagingInstallPrefix();
virtual const char* GetOutputExtension() { return ".dmg"; }
- //bool CopyCreateResourceFile(const char* name, const char* dir);
- bool CopyResourcePlistFile(const char* name, const char* dir,
+ //bool CopyCreateResourceFile(const std::string& name,
+ // const std::string& dir);
+ bool CopyResourcePlistFile(const std::string& name, const char* dir,
const char* outputFileName = 0, bool copyOnly = false);
std::string InstallPrefix;
};
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index c5b9c6f..69886a1 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -553,8 +553,9 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
}
//----------------------------------------------------------------------
-bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
- const char* dirName)
+bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(
+ const std::string& name,
+ const std::string& dirName)
{
std::string uname = cmSystemTools::UpperCase(name);
std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
@@ -563,7 +564,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str()
<< " not specified. It should point to "
- << (name ? name : "(NULL)")
+ << (!name.empty() ? name : "<empty>")
<< ".rtf, " << name
<< ".html, or " << name << ".txt file" << std::endl);
return false;
@@ -571,7 +572,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
if ( !cmSystemTools::FileExists(inFileName) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
- << (name ? name : "(NULL)")
+ << (!name.empty() ? name : "<empty>")
<< " resource file: " << inFileName << std::endl);
return false;
}
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.h b/Source/CPack/cmCPackPackageMakerGenerator.h
index ba3d968..bebb633 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.h
+++ b/Source/CPack/cmCPackPackageMakerGenerator.h
@@ -51,7 +51,8 @@ protected:
// CPACK_RESOURCE_FILE_${NAME} (where ${NAME} is the uppercased
// version of name) specifies the input file to use for this file,
// which will be configured via ConfigureFile.
- bool CopyCreateResourceFile(const char* name, const char *dirName);
+ bool CopyCreateResourceFile(const std::string& name,
+ const std::string& dirName);
bool CopyResourcePlistFile(const char* name, const char* outName = 0);
// Run PackageMaker with the given command line, which will (if