summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDocumentVariables.cxx6
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx14
-rw-r--r--Source/cmFindLibraryCommand.cxx114
-rw-r--r--Source/cmFindLibraryCommand.h5
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx21
-rw-r--r--Source/cmake.cxx6
6 files changed, 83 insertions, 83 deletions
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 77aaffc..05ef8fc 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -831,9 +831,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"the shared MFC library. This is used in visual "
"studio 6 and 7 project files. The CMakeSetup "
"dialog used MFC and the CMakeLists.txt looks like this:\n"
- "add_definitions(-D_AFXDLL)\n"
- "set(CMAKE_MFC_FLAG 2)\n"
- "add_executable(CMakeSetup WIN32 ${SRCS})\n",false,
+ " add_definitions(-D_AFXDLL)\n"
+ " set(CMAKE_MFC_FLAG 2)\n"
+ " add_executable(CMakeSetup WIN32 ${SRCS})\n",false,
"Variables That Change Behavior");
cm->DefineProperty
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 78a8704..5c7d400 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -1334,12 +1334,26 @@ bool cmExtraEclipseCDT4Generator
{
outputPath = this->HomeOutputDirectory + "/" + outputPath;
}
+
+ // in this case it's not necessary:
if (cmSystemTools::IsSubDirectory(outputPath.c_str(),
this->HomeOutputDirectory.c_str()))
{
return false;
}
+ // in these two cases Eclipse would complain:
+ if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
+ outputPath.c_str()))
+ {
+ return false;
+ }
+ if (cmSystemTools::GetRealPath(outputPath.c_str())
+ == cmSystemTools::GetRealPath(this->HomeOutputDirectory.c_str()))
+ {
+ return false;
+ }
+
std::string name = this->GetPathBasename(outputPath);
// make sure linked resource name is unique
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 6cdbbf2..652e697 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -105,7 +105,10 @@ bool cmFindLibraryCommand
->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS"))
{
// add special 64 bit paths if this is a 64 bit compile.
- this->AddLib64Paths();
+ if(this->Makefile->PlatformIs64Bit())
+ {
+ this->AddArchitecturePaths("64");
+ }
}
std::string library = this->FindLibrary();
@@ -129,90 +132,55 @@ bool cmFindLibraryCommand
//----------------------------------------------------------------------------
void cmFindLibraryCommand::AddArchitecturePaths(const char* suffix)
{
- std::vector<std::string> newPaths;
- bool found = false;
- std::string subpath = "lib";
- subpath += suffix;
- subpath += "/";
- for(std::vector<std::string>::iterator i = this->SearchPaths.begin();
- i != this->SearchPaths.end(); ++i)
+ std::vector<std::string> original;
+ original.swap(this->SearchPaths);
+ for(std::vector<std::string>::iterator i = original.begin();
+ i != original.end(); ++i)
{
- // Try replacing lib/ with lib<suffix>/
- std::string s = *i;
- cmSystemTools::ReplaceString(s, "lib/", subpath.c_str());
- if((s != *i) && cmSystemTools::FileIsDirectory(s.c_str()))
- {
- found = true;
- newPaths.push_back(s);
- }
+ this->AddArchitecturePath(*i, 0, suffix);
+ }
+}
- // Now look for lib<suffix>
- s = *i;
- s += suffix;
- if(cmSystemTools::FileIsDirectory(s.c_str()))
+//----------------------------------------------------------------------------
+void cmFindLibraryCommand::AddArchitecturePath(
+ std::string const& dir, std::string::size_type start_pos,
+ const char* suffix, bool fresh)
+{
+ std::string::size_type pos = dir.find("lib/", start_pos);
+ if(pos != std::string::npos)
+ {
+ std::string cur_dir = dir.substr(0,pos+3);
+
+ // Follow "lib<suffix>".
+ std::string next_dir = cur_dir + suffix;
+ if(cmSystemTools::FileIsDirectory(next_dir.c_str()))
{
- found = true;
- newPaths.push_back(s);
+ next_dir += dir.substr(pos+3);
+ std::string::size_type next_pos = pos+3+strlen(suffix)+1;
+ this->AddArchitecturePath(next_dir, next_pos, suffix);
}
- // now add the original unchanged path
- if(cmSystemTools::FileIsDirectory(i->c_str()))
+
+ // Follow "lib".
+ if(cmSystemTools::FileIsDirectory(cur_dir.c_str()))
{
- newPaths.push_back(*i);
+ this->AddArchitecturePath(dir, pos+3+1, suffix, false);
}
}
-
- // If any new paths were found replace the original set.
- if(found)
+ if(fresh)
{
- this->SearchPaths = newPaths;
- }
-}
-
-void cmFindLibraryCommand::AddLib64Paths()
-{
- std::string voidsize =
- this->Makefile->GetSafeDefinition("CMAKE_SIZEOF_VOID_P");
- int size = atoi(voidsize.c_str());
- if(size != 8)
- {
- return;
- }
- std::vector<std::string> path64;
- bool found64 = false;
- for(std::vector<std::string>::iterator i = this->SearchPaths.begin();
- i != this->SearchPaths.end(); ++i)
- {
- std::string s = *i;
- std::string s2 = *i;
- cmSystemTools::ReplaceString(s, "lib/", "lib64/");
- // try to replace lib with lib64 and see if it is there,
- // then prepend it to the path
- // Note that all paths have trailing slashes.
- if((s != *i) && cmSystemTools::FileIsDirectory(s.c_str()))
+ // Check for <dir><suffix>/.
+ std::string cur_dir = dir + suffix + "/";
+ if(cmSystemTools::FileIsDirectory(cur_dir.c_str()))
{
- path64.push_back(s);
- found64 = true;
- }
- // now just add a 64 to the path name and if it is there,
- // add it to the path
- s2 += "64/";
- if(cmSystemTools::FileIsDirectory(s2.c_str()))
- {
- found64 = true;
- path64.push_back(s2);
- }
- // now add the original unchanged path
- if(cmSystemTools::FileIsDirectory(i->c_str()))
+ this->SearchPaths.push_back(cur_dir);
+ }
+
+ // Now add the original unchanged path
+ if(cmSystemTools::FileIsDirectory(dir.c_str()))
{
- path64.push_back(*i);
+ this->SearchPaths.push_back(dir);
}
}
- // now replace the SearchPaths with the 64 bit converted path
- // if any 64 bit paths were discovered
- if(found64)
- {
- this->SearchPaths = path64;
- }
}
//----------------------------------------------------------------------------
diff --git a/Source/cmFindLibraryCommand.h b/Source/cmFindLibraryCommand.h
index b880be2..31a5c3f 100644
--- a/Source/cmFindLibraryCommand.h
+++ b/Source/cmFindLibraryCommand.h
@@ -62,7 +62,10 @@ public:
protected:
void AddArchitecturePaths(const char* suffix);
- void AddLib64Paths();
+ void AddArchitecturePath(std::string const& dir,
+ std::string::size_type start_pos,
+ const char* suffix,
+ bool fresh = true);
std::string FindLibrary();
virtual void GenerateDocumentation();
private:
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 938977b..ae92a0a 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -136,8 +136,23 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::New()
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
cmXcodeVersionParser parser;
- if (cmSystemTools::FileExists(
- "/Applications/Xcode.app/Contents/version.plist"))
+ std::string versionFile;
+ {
+ std::string out;
+ std::string::size_type pos;
+ if(cmSystemTools::RunSingleCommand("xcode-select --print-path", &out, 0, 0,
+ cmSystemTools::OUTPUT_NONE) &&
+ (pos = out.find(".app/"), pos != out.npos))
+ {
+ versionFile = out.substr(0, pos+5)+"Contents/version.plist";
+ }
+ }
+ if(!versionFile.empty() && cmSystemTools::FileExists(versionFile.c_str()))
+ {
+ parser.ParseFile(versionFile.c_str());
+ }
+ else if (cmSystemTools::FileExists(
+ "/Applications/Xcode.app/Contents/version.plist"))
{
parser.ParseFile
("/Applications/Xcode.app/Contents/version.plist");
@@ -3739,7 +3754,7 @@ cmGlobalXCodeGenerator
const char* configName = this->GetCMakeCFGIntDir();
std::string dir = this->GetObjectsNormalDirectory(
- this->CurrentProject, configName, gt->Target);
+ "$(PROJECT_NAME)", configName, gt->Target);
if(this->XcodeVersion >= 21)
{
dir += "$(CURRENT_ARCH)/";
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index fdc42fa..75aa471 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1043,7 +1043,7 @@ int cmake::AddCMakePaths()
{
cMakeRoot = cMakeRoot.substr(0, slashPos);
}
- // is there no Modules direcory there?
+ // is there no Modules directory there?
modules = cMakeRoot + "/Modules/CMake.cmake";
}
@@ -1072,7 +1072,7 @@ int cmake::AddCMakePaths()
{
// next try exe
cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str());
- // is there no Modules direcory there?
+ // is there no Modules directory there?
modules = cMakeRoot + "/Modules/CMake.cmake";
}
if (!cmSystemTools::FileExists(modules.c_str()))
@@ -1421,7 +1421,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
int retval = 0;
int timeout = 0;
if ( cmSystemTools::RunSingleCommand(command.c_str(), 0, &retval,
- directory.c_str(), cmSystemTools::OUTPUT_MERGE, timeout) )
+ directory.c_str(), cmSystemTools::OUTPUT_NORMAL, timeout) )
{
return retval;
}