summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-02-28 23:59:19 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-02-28 23:59:19 (GMT)
commitb1a74218401a6d990b570cae8141cad97fb8dc19 (patch)
tree3775e35ac3f08525ad6808e53f0faf027fe9f357 /Source/cmMakefile.cxx
parent6ab87555ea483601cb1829f3b6e9d3d77d6746ff (diff)
downloadCMake-b1a74218401a6d990b570cae8141cad97fb8dc19.zip
CMake-b1a74218401a6d990b570cae8141cad97fb8dc19.tar.gz
CMake-b1a74218401a6d990b570cae8141cad97fb8dc19.tar.bz2
ENH: Styart working on bundles support and abstract WIN32_EXECUTABLE
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx54
1 files changed, 37 insertions, 17 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 348c489..ecdd3b0 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1053,29 +1053,16 @@ void cmMakefile::AddLibrary(const char* lname, int shared,
}
}
-void cmMakefile::AddExecutable(const char *exeName,
+cmTarget* cmMakefile::AddExecutable(const char *exeName,
const std::vector<std::string> &srcs)
{
- this->AddExecutable(exeName,srcs,false);
-}
-
-void cmMakefile::AddExecutable(const char *exeName,
- const std::vector<std::string> &srcs,
- bool win32)
-{
cmTarget target;
- if (win32)
- {
- target.SetType(cmTarget::WIN32_EXECUTABLE);
- }
- else
- {
- target.SetType(cmTarget::EXECUTABLE);
- }
+ target.SetType(cmTarget::EXECUTABLE);
target.SetInAll(true);
target.GetSourceLists() = srcs;
this->AddGlobalLinkInformation(exeName, target);
- m_Targets.insert(cmTargets::value_type(exeName,target));
+ cmTargets::iterator it =
+ m_Targets.insert(cmTargets::value_type(exeName,target)).first;
// Add an entry into the cache
std::string exePath = exeName;
@@ -1084,6 +1071,7 @@ void cmMakefile::AddExecutable(const char *exeName,
AddCacheEntry(exePath.c_str(),
this->GetCurrentOutputDirectory(),
"Path to an executable", cmCacheManager::INTERNAL);
+ return &it->second;
}
@@ -2186,3 +2174,35 @@ std::string cmMakefile::FindLibrary(const char* name,
return cmSystemTools::FindLibrary(name, path);
}
+
+std::string cmMakefile::GetModulesFile(const char* filename)
+{
+ std::vector<std::string> modulePath;
+ const char* def = this->GetDefinition("CMAKE_MODULE_PATH");
+ if(def)
+ {
+ cmSystemTools::ExpandListArgument(def, modulePath);
+ }
+
+ // Also search in the standard modules location.
+ def = this->GetDefinition("CMAKE_ROOT");
+ if(def)
+ {
+ std::string rootModules = def;
+ rootModules += "/Modules";
+ modulePath.push_back(rootModules);
+ }
+ //std::string Look through the possible module directories.
+ for(std::vector<std::string>::iterator i = modulePath.begin();
+ i != modulePath.end(); ++i)
+ {
+ std::string itempl = *i;
+ cmSystemTools::ConvertToUnixSlashes(itempl);
+ itempl += filename;
+ if(cmSystemTools::FileExists(itempl.c_str()))
+ {
+ return itempl;
+ }
+ }
+ return "";
+}