STYLE: fix line length

This commit is contained in:
Ken Martin 2006-05-10 15:46:45 -04:00
parent afbc574356
commit 2af4710525
11 changed files with 125 additions and 65 deletions

View File

@ -136,8 +136,18 @@ void cmFLTKWrapUICommand::FinalPass()
} }
if (!found) if (!found)
{ {
std::string msg = "In CMake 2.2 the FLTK_WRAP_UI command sets a variable to the list of source files that should be added to your executable or library. It appears that you have not added these source files to your target. You should change your CMakeLists.txt file to directly add the generated files to the target. For example FTLK_WRAP_UI(foo src1 src2 src3) will create a variable named foo_FLTK_UI_SRCS that contains the list of sources to add to your target when you call ADD_LIBRARY or ADD_EXECUTABLE. For now CMake 2.2 will add the sources to your target for you as was done in CMake 2.0 and earlier. In the future this may become an error. "; std::string msg =
msg += "The problem was found while processing the source directory: "; "In CMake 2.2 the FLTK_WRAP_UI command sets a variable to the list of "
"source files that should be added to your executable or library. It "
"appears that you have not added these source files to your target. You "
"should change your CMakeLists.txt file to directly add the generated "
"files to the target. For example FTLK_WRAP_UI(foo src1 src2 src3) "
"will create a variable named foo_FLTK_UI_SRCS that contains the list "
"of sources to add to your target when you call ADD_LIBRARY or "
"ADD_EXECUTABLE. For now CMake will add the sources to your target "
"for you as was done in CMake 2.0 and earlier. In the future this may "
"become an error.";
msg +="The problem was found while processing the source directory: ";
msg += this->Makefile->GetStartDirectory(); msg += this->Makefile->GetStartDirectory();
cmSystemTools::Message(msg.c_str(),"Warning"); cmSystemTools::Message(msg.c_str(),"Warning");
// first we add the rules for all the .fl to .h and .cxx files // first we add the rules for all the .fl to .h and .cxx files
@ -146,8 +156,8 @@ void cmFLTKWrapUICommand::FinalPass()
// Generate code for all the .fl files // Generate code for all the .fl files
for(size_t classNum = 0; classNum < lastHeadersClass; classNum++) for(size_t classNum = 0; classNum < lastHeadersClass; classNum++)
{ {
this->Makefile->GetTargets()[this->Target].GetSourceFiles().push_back( this->Makefile->GetTargets()[this->Target].GetSourceFiles().
this->GeneratedSourcesClasses[classNum]); push_back(this->GeneratedSourcesClasses[classNum]);
} }
} }
} }

View File

@ -788,9 +788,11 @@ bool cmFileCommand::HandleInstallCommand(
cmSystemTools::RemoveFile(soname.c_str()); cmSystemTools::RemoveFile(soname.c_str());
cmSystemTools::RemoveFile(libname.c_str()); cmSystemTools::RemoveFile(libname.c_str());
if (!cmSystemTools::CreateSymlink(soname_nopath.c_str(), libname.c_str()) ) if (!cmSystemTools::CreateSymlink(soname_nopath.c_str(),
libname.c_str()) )
{ {
std::string errstring = "error when creating symlink from: " + libname + " to " + soname_nopath; std::string errstring = "error when creating symlink from: "
+ libname + " to " + soname_nopath;
this->SetError(errstring.c_str()); this->SetError(errstring.c_str());
return false; return false;
} }
@ -798,9 +800,11 @@ bool cmFileCommand::HandleInstallCommand(
smanifest_files += libname.substr(destDirLength);; smanifest_files += libname.substr(destDirLength);;
if ( toFile != soname ) if ( toFile != soname )
{ {
if ( !cmSystemTools::CreateSymlink(fromName.c_str(), soname.c_str()) ) if ( !cmSystemTools::CreateSymlink(fromName.c_str(),
soname.c_str()) )
{ {
std::string errstring = "error when creating symlink from: " + soname + " to " + fromName; std::string errstring = "error when creating symlink from: "
+ soname + " to " + fromName;
this->SetError(errstring.c_str()); this->SetError(errstring.c_str());
return false; return false;
} }
@ -832,9 +836,11 @@ bool cmFileCommand::HandleInstallCommand(
cmSystemTools::RemoveFile(exename.c_str()); cmSystemTools::RemoveFile(exename.c_str());
if (!cmSystemTools::CreateSymlink(exename_nopath.c_str(), exename.c_str()) ) if (!cmSystemTools::CreateSymlink(exename_nopath.c_str(),
exename.c_str()) )
{ {
std::string errstring = "error when creating symlink from: " + exename + " to " + exename_nopath; std::string errstring = "error when creating symlink from: "
+ exename + " to " + exename_nopath;
this->SetError(errstring.c_str()); this->SetError(errstring.c_str());
return false; return false;
} }
@ -955,18 +961,23 @@ bool cmFileCommand::HandleRelativePathCommand(
if(!cmSystemTools::FileIsFullPath(directoryName.c_str())) if(!cmSystemTools::FileIsFullPath(directoryName.c_str()))
{ {
std::string errstring = "RelativePath must be passed a full path to the directory: " + directoryName; std::string errstring =
"RelativePath must be passed a full path to the directory: "
+ directoryName;
this->SetError(errstring.c_str()); this->SetError(errstring.c_str());
return false; return false;
} }
if(!cmSystemTools::FileIsFullPath(fileName.c_str())) if(!cmSystemTools::FileIsFullPath(fileName.c_str()))
{ {
std::string errstring = "RelativePath must be passed a full path to the directory: " + directoryName; std::string errstring =
"RelativePath must be passed a full path to the directory: "
+ directoryName;
this->SetError(errstring.c_str()); this->SetError(errstring.c_str());
return false; return false;
} }
std::string res = cmSystemTools::RelativePath(directoryName.c_str(), fileName.c_str()); std::string res = cmSystemTools::RelativePath(directoryName.c_str(),
fileName.c_str());
this->Makefile->AddDefinition(outVar.c_str(), this->Makefile->AddDefinition(outVar.c_str(),
res.c_str()); res.c_str());
return true; return true;

View File

@ -68,7 +68,8 @@ public:
" FILE(APPEND filename \"message to write\"... )\n" " FILE(APPEND filename \"message to write\"... )\n"
" FILE(READ filename variable)\n" " FILE(READ filename variable)\n"
" FILE(GLOB variable [RELATIVE path] [globbing expressions]...)\n" " FILE(GLOB variable [RELATIVE path] [globbing expressions]...)\n"
" FILE(GLOB_RECURSE variable [RELATIVE path] [globbing expressions]...)\n" " FILE(GLOB_RECURSE variable [RELATIVE path] \n"
" [globbing expressions]...)\n"
" FILE(REMOVE [directory]...)\n" " FILE(REMOVE [directory]...)\n"
" FILE(REMOVE_RECURSE [directory]...)\n" " FILE(REMOVE_RECURSE [directory]...)\n"
" FILE(MAKE_DIRECTORY [directory]...)\n" " FILE(MAKE_DIRECTORY [directory]...)\n"

View File

@ -84,7 +84,8 @@ bool cmFileTimeComparisonInternal::Stat(const char* fname,
return false; return false;
} }
#else #else
// Windows version. Get the modification time from extended file attributes. // Windows version. Get the modification time from extended file
// attributes.
WIN32_FILE_ATTRIBUTE_DATA fdata; WIN32_FILE_ATTRIBUTE_DATA fdata;
if(!GetFileAttributesEx(fname, GetFileExInfoStandard, &fdata)) if(!GetFileAttributesEx(fname, GetFileExInfoStandard, &fdata))
{ {
@ -116,13 +117,15 @@ cmFileTimeComparison::~cmFileTimeComparison()
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmFileTimeComparison::FileTimeCompare(const char* f1, const char* f2, int* result) bool cmFileTimeComparison::FileTimeCompare(const char* f1,
const char* f2, int* result)
{ {
return this->Internals->FileTimeCompare(f1, f2, result); return this->Internals->FileTimeCompare(f1, f2, result);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1, cmFileTimeComparison_Type* s2) int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
cmFileTimeComparison_Type* s2)
{ {
#if !defined(_WIN32) || defined(__CYGWIN__) #if !defined(_WIN32) || defined(__CYGWIN__)
# if cmsys_STAT_HAS_ST_MTIM # if cmsys_STAT_HAS_ST_MTIM

View File

@ -106,8 +106,9 @@ cmFindBase::cmFindBase()
" libraries or headers.\n" " libraries or headers.\n"
" \"ONLY\" - Only try to find frameworks.\n" " \"ONLY\" - Only try to find frameworks.\n"
" \"NEVER\". - Never try to find frameworks.\n" " \"NEVER\". - Never try to find frameworks.\n"
"On Darwin or systems supporting OSX Application Bundles, the cmake variable" "On Darwin or systems supporting OSX Application Bundles, the cmake "
" CMAKE_FIND_APPBUNDLE can be set to empty or one of the following:\n" "variable CMAKE_FIND_APPBUNDLE can be set to empty or one of the "
"following:\n"
" \"FIRST\" - Try to find application bundles before standard\n" " \"FIRST\" - Try to find application bundles before standard\n"
" programs. This is the default on Darwin.\n" " programs. This is the default on Darwin.\n"
" \"LAST\" - Try to find application bundles after standard\n" " \"LAST\" - Try to find application bundles after standard\n"
@ -358,7 +359,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
} }
else if(this->Names.size() == 1) else if(this->Names.size() == 1)
{ {
this->VariableDocumentation += "the " + this->Names[0] + " library be found"; this->VariableDocumentation += "the "
+ this->Names[0] + " library be found";
} }
else else
{ {
@ -367,7 +369,8 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
{ {
this->VariableDocumentation += ", " + this->Names[j]; this->VariableDocumentation += ", " + this->Names[j];
} }
this->VariableDocumentation += " or " + this->Names[this->Names.size() - 1] + " libraries be found"; this->VariableDocumentation += " or "
+ this->Names[this->Names.size() - 1] + " libraries be found";
} }
} }
@ -400,24 +403,28 @@ void cmFindBase::ExpandPaths(std::vector<std::string> userPaths)
{ {
this->AddAppBundlePaths(); this->AddAppBundlePaths();
} }
if(!this->NoCMakeEnvironmentPath && !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) if(!this->NoCMakeEnvironmentPath &&
!(this->SearchFrameworkOnly || this->SearchAppBundleOnly))
{ {
// Add CMAKE_*_PATH environment variables // Add CMAKE_*_PATH environment variables
this->AddEnvironmentVairables(); this->AddEnvironmentVairables();
} }
if(!this->NoCMakePath && !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) if(!this->NoCMakePath &&
!(this->SearchFrameworkOnly || this->SearchAppBundleOnly))
{ {
// Add CMake varibles of the same name as the previous environment // Add CMake varibles of the same name as the previous environment
// varibles CMAKE_*_PATH to be used most of the time with -D // varibles CMAKE_*_PATH to be used most of the time with -D
// command line options // command line options
this->AddCMakeVairables(); this->AddCMakeVairables();
} }
if(!this->NoSystemEnvironmentPath && !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) if(!this->NoSystemEnvironmentPath &&
!(this->SearchFrameworkOnly || this->SearchAppBundleOnly))
{ {
// add System environment PATH and (LIB or INCLUDE) // add System environment PATH and (LIB or INCLUDE)
this->AddSystemEnvironmentVairables(); this->AddSystemEnvironmentVairables();
} }
if(!this->NoCMakeSystemPath && !(this->SearchFrameworkOnly || this->SearchAppBundleOnly)) if(!this->NoCMakeSystemPath &&
!(this->SearchFrameworkOnly || this->SearchAppBundleOnly))
{ {
// Add CMAKE_SYSTEM_*_PATH variables which are defined in platform files // Add CMAKE_SYSTEM_*_PATH variables which are defined in platform files
this->AddCMakeSystemVariables(); this->AddCMakeSystemVariables();
@ -569,14 +576,16 @@ void cmFindBase::AddCMakeSystemVariables()
} }
if(this->SearchAppBundleLast) if(this->SearchAppBundleLast)
{ {
if(const char* path = this->Makefile->GetDefinition("CMAKE_SYSTEM_APPBUNDLE_PATH")) if(const char* path =
this->Makefile->GetDefinition("CMAKE_SYSTEM_APPBUNDLE_PATH"))
{ {
cmSystemTools::ExpandListArgument(path, this->SearchPaths); cmSystemTools::ExpandListArgument(path, this->SearchPaths);
} }
} }
if(this->SearchFrameworkLast) if(this->SearchFrameworkLast)
{ {
if(const char* path = this->Makefile->GetDefinition("CMAKE_SYSTEM_FRAMEWORK_PATH")) if(const char* path =
this->Makefile->GetDefinition("CMAKE_SYSTEM_FRAMEWORK_PATH"))
{ {
cmSystemTools::ExpandListArgument(path, this->SearchPaths); cmSystemTools::ExpandListArgument(path, this->SearchPaths);
} }
@ -601,7 +610,8 @@ void cmFindBase::ExpandRegistryAndCleanPath()
cmSystemTools::ConvertToUnixSlashes(*i); cmSystemTools::ConvertToUnixSlashes(*i);
// copy each finalPath combined with SearchPathSuffixes // copy each finalPath combined with SearchPathSuffixes
// to the SearchPaths ivar // to the SearchPaths ivar
for(std::vector<std::string>::iterator j = this->SearchPathSuffixes.begin(); for(std::vector<std::string>::iterator j =
this->SearchPathSuffixes.begin();
j != this->SearchPathSuffixes.end(); ++j) j != this->SearchPathSuffixes.end(); ++j)
{ {
std::string p = *i + std::string("/") + *j; std::string p = *i + std::string("/") + *j;
@ -631,11 +641,14 @@ void cmFindBase::PrintFindStuff()
std::cerr << "SearchAppBundleOnly: " << this->SearchAppBundleOnly << "\n"; std::cerr << "SearchAppBundleOnly: " << this->SearchAppBundleOnly << "\n";
std::cerr << "SearchAppBundleFirst: " << this->SearchAppBundleFirst << "\n"; std::cerr << "SearchAppBundleFirst: " << this->SearchAppBundleFirst << "\n";
std::cerr << "VariableName " << this->VariableName << "\n"; std::cerr << "VariableName " << this->VariableName << "\n";
std::cerr << "VariableDocumentation " << this->VariableDocumentation << "\n"; std::cerr << "VariableDocumentation "
<< this->VariableDocumentation << "\n";
std::cerr << "NoDefaultPath " << this->NoDefaultPath << "\n"; std::cerr << "NoDefaultPath " << this->NoDefaultPath << "\n";
std::cerr << "NoCMakeEnvironmentPath " << this->NoCMakeEnvironmentPath << "\n"; std::cerr << "NoCMakeEnvironmentPath "
<< this->NoCMakeEnvironmentPath << "\n";
std::cerr << "NoCMakePath " << this->NoCMakePath << "\n"; std::cerr << "NoCMakePath " << this->NoCMakePath << "\n";
std::cerr << "NoSystemEnvironmentPath " << this->NoSystemEnvironmentPath << "\n"; std::cerr << "NoSystemEnvironmentPath "
<< this->NoSystemEnvironmentPath << "\n";
std::cerr << "NoCMakeSystemPath " << this->NoCMakeSystemPath << "\n"; std::cerr << "NoCMakeSystemPath " << this->NoCMakeSystemPath << "\n";
std::cerr << "EnvironmentPath " << this->EnvironmentPath << "\n"; std::cerr << "EnvironmentPath " << this->EnvironmentPath << "\n";
std::cerr << "CMakePathName " << this->CMakePathName << "\n"; std::cerr << "CMakePathName " << this->CMakePathName << "\n";
@ -670,7 +683,8 @@ bool cmFindBase::CheckForVariableInCache()
if(cacheValue) if(cacheValue)
{ {
cmCacheManager::CacheIterator it = cmCacheManager::CacheIterator it =
this->Makefile->GetCacheManager()->GetCacheIterator(this->VariableName.c_str()); this->Makefile->GetCacheManager()->
GetCacheIterator(this->VariableName.c_str());
if(!it.IsAtEnd()) if(!it.IsAtEnd())
{ {
const char* hs = it.GetProperty("HELPSTRING"); const char* hs = it.GetProperty("HELPSTRING");

View File

@ -23,7 +23,8 @@ cmFindFileCommand::cmFindFileCommand()
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"FIND_PATH", "FIND_FILE"); "FIND_PATH", "FIND_FILE");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"directory containing the named file", "full path to named file"); "directory containing the named file",
"full path to named file");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"file in a directory", "full path to a file"); "file in a directory", "full path to a file");
} }

View File

@ -26,7 +26,8 @@ cmFindLibraryCommand::cmFindLibraryCommand()
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"XXX_SYSTEM", "LIB"); "XXX_SYSTEM", "LIB");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_SYSTEM_XXX_PATH", "CMAKE_SYSTEM_LIBRARY_PATH"); "CMAKE_SYSTEM_XXX_PATH",
"CMAKE_SYSTEM_LIBRARY_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"SEARCH_XXX_DESC", "library"); "SEARCH_XXX_DESC", "library");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
@ -80,11 +81,13 @@ bool cmFindLibraryCommand::InitialPass(std::vector<std::string> const& argsIn)
void cmFindLibraryCommand::AddLib64Paths() void cmFindLibraryCommand::AddLib64Paths()
{ {
if(!this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->GetLanguageEnabled("C")) if(!this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
GetLanguageEnabled("C"))
{ {
return; return;
} }
std::string voidsize = this->Makefile->GetRequiredDefinition("CMAKE_SIZEOF_VOID_P"); std::string voidsize =
this->Makefile->GetRequiredDefinition("CMAKE_SIZEOF_VOID_P");
int size = atoi(voidsize.c_str()); int size = atoi(voidsize.c_str());
std::vector<std::string> path64; std::vector<std::string> path64;
if(size != 8) if(size != 8)

View File

@ -202,10 +202,12 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
{ {
// Listfiles will be looking for the capitalized version of the // Listfiles will be looking for the capitalized version of the
// name. Provide it. // name. Provide it.
this->Makefile->AddDefinition(upperDir.c_str(), this->Makefile->AddDefinition
this->Makefile->GetDefinition(this->Variable.c_str())); (upperDir.c_str(),
this->Makefile->AddDefinition(upperFound.c_str(), this->Makefile->GetDefinition(this->Variable.c_str()));
this->Makefile->GetDefinition(foundVar.c_str())); this->Makefile->AddDefinition
(upperFound.c_str(),
this->Makefile->GetDefinition(foundVar.c_str()));
} }
#ifdef CMAKE_BUILD_WITH_CMAKE #ifdef CMAKE_BUILD_WITH_CMAKE
@ -297,8 +299,8 @@ bool cmFindPackageCommand::FindConfig()
for(int i=1; i <= 10; ++i) for(int i=1; i <= 10; ++i)
{ {
cmOStringStream r; cmOStringStream r;
r << "[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild" r << "[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\"
<< i << "]"; "Settings\\StartPath;WhereBuild" << i << "]";
std::string entry = r.str(); std::string entry = r.str();
cmSystemTools::ExpandRegistryValues(entry); cmSystemTools::ExpandRegistryValues(entry);
cmSystemTools::ConvertToUnixSlashes(entry); cmSystemTools::ConvertToUnixSlashes(entry);

View File

@ -29,9 +29,11 @@ cmFindPathCommand::cmFindPathCommand()
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"XXX_SYSTEM", "INCLUDE"); "XXX_SYSTEM", "INCLUDE");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_SYSTEM_XXX_PATH", "CMAKE_SYSTEM_INCLUDE_PATH"); "CMAKE_SYSTEM_XXX_PATH",
"CMAKE_SYSTEM_INCLUDE_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"SEARCH_XXX_DESC", "directory containing the named file"); "SEARCH_XXX_DESC",
"directory containing the named file");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"SEARCH_XXX", "file in a directory"); "SEARCH_XXX", "file in a directory");
this->ExtraDocAdded = false; this->ExtraDocAdded = false;
@ -44,9 +46,11 @@ const char* cmFindPathCommand::GetFullDocumentation()
this->GenericDocumentation += this->GenericDocumentation +=
"\n" "\n"
"When searching for frameworks, if the file is specified as " "When searching for frameworks, if the file is specified as "
"A/b.h, then the framework search will look for A.framework/Headers/b.h. " "A/b.h, then the framework search will look for "
"A.framework/Headers/b.h. "
"If that is found the path will be set to the path to the framework. " "If that is found the path will be set to the path to the framework. "
"CMake will convert this to the correct -F option to include the file. "; "CMake will convert this to the correct -F option to include the "
"file. ";
this->ExtraDocAdded = true; this->ExtraDocAdded = true;
} }
return this->GenericDocumentation.c_str(); return this->GenericDocumentation.c_str();
@ -109,20 +113,21 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn)
} }
if(result.size() != 0) if(result.size() != 0)
{ {
this->Makefile->AddCacheDefinition(this->VariableName.c_str(), this->Makefile->AddCacheDefinition
result.c_str(), (this->VariableName.c_str(), result.c_str(),
this->VariableDocumentation.c_str(), this->VariableDocumentation.c_str(),
(this->IncludeFileInPath) ? (this->IncludeFileInPath) ?
cmCacheManager::FILEPATH :cmCacheManager::PATH); cmCacheManager::FILEPATH :cmCacheManager::PATH);
return true; return true;
} }
} }
} }
this->Makefile->AddCacheDefinition(this->VariableName.c_str(), this->Makefile->AddCacheDefinition
(this->VariableName + "-NOTFOUND").c_str(), (this->VariableName.c_str(),
this->VariableDocumentation.c_str(), (this->VariableName + "-NOTFOUND").c_str(),
(this->IncludeFileInPath) ? this->VariableDocumentation.c_str(),
cmCacheManager::FILEPATH :cmCacheManager::PATH); (this->IncludeFileInPath) ?
cmCacheManager::FILEPATH :cmCacheManager::PATH);
return true; return true;
} }
@ -140,7 +145,8 @@ std::string cmFindPathCommand::FindHeaderInFramework(std::string& file,
// remove the name from the slash; // remove the name from the slash;
fileName = fileName.substr(pos+1); fileName = fileName.substr(pos+1);
frameWorkName = file; frameWorkName = file;
frameWorkName = frameWorkName.substr(0, frameWorkName.size()-fileName.size()-1); frameWorkName =
frameWorkName.substr(0, frameWorkName.size()-fileName.size()-1);
// if the framework has a path in it then just use the filename // if the framework has a path in it then just use the filename
if(frameWorkName.find("/") != frameWorkName.npos) if(frameWorkName.find("/") != frameWorkName.npos)
{ {

View File

@ -31,7 +31,8 @@ cmFindProgramCommand::cmFindProgramCommand()
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"XXX_SYSTEM", ""); "XXX_SYSTEM", "");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"CMAKE_SYSTEM_XXX_PATH", "CMAKE_SYSTEM_PROGRAM_PATH"); "CMAKE_SYSTEM_XXX_PATH",
"CMAKE_SYSTEM_PROGRAM_PATH");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
"SEARCH_XXX_DESC", "program"); "SEARCH_XXX_DESC", "program");
cmSystemTools::ReplaceString(this->GenericDocumentation, cmSystemTools::ReplaceString(this->GenericDocumentation,
@ -88,14 +89,17 @@ std::string cmFindProgramCommand::FindProgram(std::vector<std::string> names)
return program; return program;
} }
std::string cmFindProgramCommand::FindAppBundle(std::vector<std::string> names) std::string cmFindProgramCommand
::FindAppBundle(std::vector<std::string> names)
{ {
for(std::vector<std::string>::const_iterator name = names.begin(); for(std::vector<std::string>::const_iterator name = names.begin();
name != names.end() ; ++name) name != names.end() ; ++name)
{ {
std::string appName = *name + std::string(".app"); std::string appName = *name + std::string(".app");
std::string appPath = cmSystemTools::FindDirectory(appName.c_str(), this->SearchPaths, true); std::string appPath = cmSystemTools::FindDirectory(appName.c_str(),
this->SearchPaths,
true);
if ( !appPath.empty() ) if ( !appPath.empty() )
{ {
@ -121,10 +125,12 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
// Get a CFString of the app bundle path // Get a CFString of the app bundle path
// XXX - Is it safe to assume everything is in UTF8? // XXX - Is it safe to assume everything is in UTF8?
CFStringRef bundlePathCFS = CFStringCreateWithCString(kCFAllocatorDefault , CFStringRef bundlePathCFS =
bundlePath.c_str(), kCFStringEncodingUTF8 ); CFStringCreateWithCString(kCFAllocatorDefault ,
bundlePath.c_str(), kCFStringEncodingUTF8 );
// Make a CFURLRef from the CFString representation of the bundles path. // Make a CFURLRef from the CFString representation of the
// bundles path.
CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
bundlePathCFS, bundlePathCFS,
kCFURLPOSIXPathStyle, kCFURLPOSIXPathStyle,
@ -142,7 +148,8 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
char buffer[MAX_OSX_PATH_SIZE]; char buffer[MAX_OSX_PATH_SIZE];
// Convert the CFString to a C string // Convert the CFString to a C string
CFStringGetCString( CFURLGetString(executableURL), buffer, MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8 ); CFStringGetCString( CFURLGetString(executableURL), buffer,
MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8 );
// And finally to a c++ string // And finally to a c++ string
executable = bundlePath + "/Contents/MacOS/" + std::string(buffer); executable = bundlePath + "/Contents/MacOS/" + std::string(buffer);

View File

@ -87,7 +87,9 @@ ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf)
void cmForEachFunctionBlocker:: void cmForEachFunctionBlocker::
ScopeEnded(cmMakefile &mf) ScopeEnded(cmMakefile &mf)
{ {
cmSystemTools::Error("The end of a CMakeLists file was reached with a FOREACH statement that was not closed properly. Within the directory: ", cmSystemTools::Error("The end of a CMakeLists file was reached with a "
"FOREACH statement that was not closed properly. "
"Within the directory: ",
mf.GetCurrentDirectory()); mf.GetCurrentDirectory());
} }