summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-03-30 11:55:19 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2006-03-30 11:55:19 -0500
commit3cf3fc510febc42af0db07c71c7c3925724b3201 (patch)
treee6872ad9d7d949ef6c067dd2159075f5c9dbb6cf /Source
parent7b3be313ee9997879bc1496bb3801021039d4d5b (diff)
downloadcmake-3cf3fc510febc42af0db07c71c7c3925724b3201.tar.gz
ENH: make sure framework search order is correct
Diffstat (limited to 'Source')
-rw-r--r--Source/cmFileCommand.cxx8
-rw-r--r--Source/cmFindBase.cxx59
-rw-r--r--Source/cmFindBase.h1
3 files changed, 49 insertions, 19 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 0262bb5744..588111bbe1 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -943,12 +943,20 @@ bool cmFileCommand::HandleSystemPathCommand(std::vector<std::string>
const& args)
{
std::vector<std::string>::const_iterator i = args.begin();
+ for(std::vector<std::string>::const_iterator j = args.begin();
+ j != args.end(); ++j)
+ {
+ std::cerr << "[" << *j << "]\n";
+ }
+ return true;
if(args.size() != 3)
{
this->SetError("FILE(SYSTEM_PATH ENV result) must be called with "
"only three arguments.");
return false;
}
+
+
i++; // Get rid of subcommand
std::vector<std::string> path;
cmSystemTools::GetPath(path, i->c_str());
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index eae6186f10..758065e9d6 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -351,44 +351,49 @@ void cmFindBase::ExpandPaths(std::vector<std::string> userPaths)
// standard search paths.
if(!this->NoDefaultPath)
{
- if(!this->NoCMakeEnvironmentPath)
+ if(this->SearchFrameworkFirst)
+ {
+ this->AddFrameWorkPaths();
+ }
+ if(!this->NoCMakeEnvironmentPath && !this->SearchFrameworkOnly)
{
// Add CMAKE_*_PATH environment variables
this->AddEnvironmentVairables();
}
- if(!this->NoCMakePath)
+ if(!this->NoCMakePath && !this->SearchFrameworkOnly)
{
// Add CMake varibles of the same name as the previous environment
// varibles CMAKE_*_PATH to be used most of the time with -D
// command line options
this->AddCMakeVairables();
}
- if(!this->NoSystemEnvironmentPath)
+ if(!this->NoSystemEnvironmentPath && !this->SearchFrameworkOnly)
{
// add System environment PATH and (LIB or INCLUDE)
this->AddSystemEnvironmentVairables();
}
- if(!this->NoCMakeSystemPath)
+ if(!this->NoCMakeSystemPath && !this->SearchFrameworkOnly)
{
// Add CMAKE_SYSTEM_*_PATH variables which are defined in platform files
this->AddCMakeSystemVariables();
}
+ if(this->SearchFrameworkLast)
+ {
+ this->AddFrameWorkPaths();
+ }
}
// add the paths specified in the FIND_* call
for(unsigned int i =0; i < userPaths.size(); ++i)
{
this->SearchPaths.push_back(userPaths[i]);
}
+
// clean things up
this->ExpandRegistryAndCleanPath();
}
void cmFindBase::AddEnvironmentVairables()
{
- if(this->SearchFrameworkFirst || this->SearchFrameworkOnly)
- {
- cmSystemTools::GetPath(this->SearchPaths, "CMAKE_FRAMEWORK_PATH");
- }
std::string var = "CMAKE_";
var += this->CMakePathName;
var += "_PATH";
@@ -400,16 +405,39 @@ void cmFindBase::AddEnvironmentVairables()
}
-void cmFindBase::AddCMakeVairables()
-{
- if(this->SearchFrameworkFirst || this->SearchFrameworkOnly)
- {
+void cmFindBase::AddFrameWorkPaths()
+{
+ if(this->NoDefaultPath)
+ {
+ return;
+ }
+ // first environment variables
+ if(!this->NoCMakeEnvironmentPath)
+ {
+ cmSystemTools::GetPath(this->SearchPaths, "CMAKE_FRAMEWORK_PATH");
+ }
+ // add cmake variables
+ if(!this->NoCMakePath)
+ {
if(const char* path =
this->Makefile->GetDefinition("CMAKE_FRAMEWORK_PATH"))
{
cmSystemTools::ExpandListArgument(path, this->SearchPaths);
}
}
+ // AddCMakeSystemVariables
+ if(!this->NoCMakeSystemPath)
+ {
+ if(const char* path =
+ this->Makefile->GetDefinition("CMAKE_SYSTEM_FRAMEWORK_PATH"))
+ {
+ cmSystemTools::ExpandListArgument(path, this->SearchPaths);
+ }
+ }
+}
+
+void cmFindBase::AddCMakeVairables()
+{
std::string var = "CMAKE_";
var += this->CMakePathName;
var += "_PATH";
@@ -440,13 +468,6 @@ void cmFindBase::AddSystemEnvironmentVairables()
void cmFindBase::AddCMakeSystemVariables()
{
- if(this->SearchFrameworkFirst || this->SearchFrameworkOnly)
- {
- if(const char* path = this->Makefile->GetDefinition("CMAKE_SYSTEM_FRAMEWORK_PATH"))
- {
- cmSystemTools::ExpandListArgument(path, this->SearchPaths);
- }
- }
std::string var = "CMAKE_SYSTEM_";
var += this->CMakePathName;
var += "_PATH";
diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h
index 7e8d05cff1..ddb46303b7 100644
--- a/Source/cmFindBase.h
+++ b/Source/cmFindBase.h
@@ -42,6 +42,7 @@ public:
protected:
void PrintFindStuff();
void ExpandPaths(std::vector<std::string> userPaths);
+ void AddFrameWorkPaths();
void AddEnvironmentVairables();
void AddCMakeVairables();
void AddSystemEnvironmentVairables();