summaryrefslogtreecommitdiffstats
path: root/Source/cmFindProgramCommand.cxx
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2012-08-13 17:42:58 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-13 18:18:39 (GMT)
commit7bbaa4283de26864b2e55e819db0884771585467 (patch)
treeecb748dbe41a13d8bdea77acd0049cde999d933e /Source/cmFindProgramCommand.cxx
parentbe9db98946b7918f279812fd0616abb650eebed0 (diff)
downloadCMake-7bbaa4283de26864b2e55e819db0884771585467.zip
CMake-7bbaa4283de26864b2e55e819db0884771585467.tar.gz
CMake-7bbaa4283de26864b2e55e819db0884771585467.tar.bz2
Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
Diffstat (limited to 'Source/cmFindProgramCommand.cxx')
-rw-r--r--Source/cmFindProgramCommand.cxx40
1 files changed, 20 insertions, 20 deletions
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index 00f5419..909b333 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -81,7 +81,7 @@ bool cmFindProgramCommand
result.c_str(),
this->VariableDocumentation.c_str(),
cmCacheManager::FILEPATH);
-
+
return true;
}
this->Makefile->AddCacheDefinition(this->VariableName.c_str(),
@@ -117,21 +117,21 @@ std::string cmFindProgramCommand
for(std::vector<std::string>::const_iterator name = names.begin();
name != names.end() ; ++name)
{
-
+
std::string appName = *name + std::string(".app");
- std::string appPath = cmSystemTools::FindDirectory(appName.c_str(),
- this->SearchPaths,
+ std::string appPath = cmSystemTools::FindDirectory(appName.c_str(),
+ this->SearchPaths,
true);
if ( !appPath.empty() )
{
std::string executable = GetBundleExecutable(appPath);
- if (!executable.empty())
+ if (!executable.empty())
{
return cmSystemTools::CollapseFullPath(executable.c_str());
}
- }
- }
+ }
+ }
// Couldn't find app bundle
return "";
@@ -142,44 +142,44 @@ std::string cmFindProgramCommand::GetBundleExecutable(std::string bundlePath)
std::string executable = "";
(void)bundlePath;
#if defined(__APPLE__)
- // Started with an example on developer.apple.com about finding bundles
+ // Started with an example on developer.apple.com about finding bundles
// and modified from that.
-
+
// Get a CFString of the app bundle path
// XXX - Is it safe to assume everything is in UTF8?
- CFStringRef bundlePathCFS =
- CFStringCreateWithCString(kCFAllocatorDefault ,
+ CFStringRef bundlePathCFS =
+ CFStringCreateWithCString(kCFAllocatorDefault ,
bundlePath.c_str(), kCFStringEncodingUTF8 );
-
+
// Make a CFURLRef from the CFString representation of the
// bundle’s path.
- CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
+ CFURLRef bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
bundlePathCFS,
kCFURLPOSIXPathStyle,
true );
-
+
// Make a bundle instance using the URLRef.
CFBundleRef appBundle = CFBundleCreate( kCFAllocatorDefault, bundleURL );
-
+
// returned executableURL is relative to <appbundle>/Contents/MacOS/
CFURLRef executableURL = CFBundleCopyExecutableURL(appBundle);
-
+
if (executableURL != NULL)
{
const int MAX_OSX_PATH_SIZE = 1024;
char buffer[MAX_OSX_PATH_SIZE];
-
+
// Convert the CFString to a C string
- CFStringGetCString( CFURLGetString(executableURL), buffer,
+ CFStringGetCString( CFURLGetString(executableURL), buffer,
MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8 );
-
+
// And finally to a c++ string
executable = bundlePath + "/Contents/MacOS/" + std::string(buffer);
// Only release CFURLRef if it's not null
CFRelease( executableURL );
}
- // Any CF objects returned from functions with "create" or
+ // Any CF objects returned from functions with "create" or
// "copy" in their names must be released by us!
CFRelease( bundlePathCFS );
CFRelease( bundleURL );