summaryrefslogtreecommitdiff
path: root/Source/cmFindProgramCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-06-09 11:58:29 -0400
committerBrad King <brad.king@kitware.com>2008-06-09 11:58:29 -0400
commit6706f84cd997d39026080e47e4944072add7f925 (patch)
treee047d48fd75fbcb0a58f50fdffc3359226710c7e /Source/cmFindProgramCommand.cxx
parentd53e5dec3748e1d800dae595dcb78f2c4d55f788 (diff)
downloadcmake-6706f84cd997d39026080e47e4944072add7f925.tar.gz
ENH: Refactor find_* command framework/appbundle search order impl.
- CMAKE_FIND_FRAMEWORK and CMAKE_FIND_APPBUNDLE are supposed to specify whether to find frameworks/appbundles FIRST, LAST, ONLY, or NEVER. - Previously this affected only the placement of CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH with respect to the other path specifiers. - Now it behaves as documented. The entire search path is inspected for each kind of program, library, or header before trying the next kind. - Additionally the ONLY mode is now honored for headers so that users do not end up with a library in framework and a header from elsewhere.
Diffstat (limited to 'Source/cmFindProgramCommand.cxx')
-rw-r--r--Source/cmFindProgramCommand.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index c2b7ca757c..6ba97fb52c 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -97,8 +97,7 @@ std::string cmFindProgramCommand::FindProgram(std::vector<std::string> names)
{
std::string program = "";
- // First/last order taken care of in cmFindBase when the paths are setup.
- if(this->SearchAppBundleFirst || this->SearchAppBundleLast)
+ if(this->SearchAppBundleFirst || this->SearchAppBundleOnly)
{
program = FindAppBundle(names);
}
@@ -107,6 +106,10 @@ std::string cmFindProgramCommand::FindProgram(std::vector<std::string> names)
program = cmSystemTools::FindProgram(names, this->SearchPaths, true);
}
+ if(program.empty() && this->SearchAppBundleLast)
+ {
+ program = this->FindAppBundle(names);
+ }
return program;
}