ENH: Define target-specific support directories
This creates method cmTarget::GetSupportDirectory to compute a target-specific support directory in the build tree. It uses the "CMakeFiles/<name>.dir" convention already used by the Makefile generators. The method will be useful for any code that needs to generate per-target information into the build tree for use by CMake tools that do not run at generate time.
This commit is contained in:
parent
ffba5b14ae
commit
d0ed46e3d6
|
@ -865,6 +865,17 @@ cmListFileBacktrace const& cmTarget::GetBacktrace() const
|
|||
return this->Internal->Backtrace;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string cmTarget::GetSupportDirectory() const
|
||||
{
|
||||
std::string dir = this->Makefile->GetCurrentOutputDirectory();
|
||||
dir += cmake::GetCMakeFilesDirectory();
|
||||
dir += "/";
|
||||
dir += this->Name;
|
||||
dir += ".dir";
|
||||
return dir;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmTarget::IsExecutableWithExports()
|
||||
{
|
||||
|
|
|
@ -415,6 +415,9 @@ public:
|
|||
/** Get a backtrace from the creation of the target. */
|
||||
cmListFileBacktrace const& GetBacktrace() const;
|
||||
|
||||
/** Get a build-tree directory in which to place target support files. */
|
||||
std::string GetSupportDirectory() const;
|
||||
|
||||
private:
|
||||
/**
|
||||
* A list of direct dependencies. Use in conjunction with DependencyMap.
|
||||
|
|
Loading…
Reference in New Issue