diff options
author | Brad King <brad.king@kitware.com> | 2009-02-10 13:50:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-02-10 13:50:09 (GMT) |
commit | d0ed46e3d66beead514ee8d95789b5ee56151812 (patch) | |
tree | bf28abb292ab6bd29a3f4452bc734cd4dca8263f /Source | |
parent | ffba5b14aec7dd3c63cea507de2d4694b2c49d38 (diff) | |
download | CMake-d0ed46e3d66beead514ee8d95789b5ee56151812.zip CMake-d0ed46e3d66beead514ee8d95789b5ee56151812.tar.gz CMake-d0ed46e3d66beead514ee8d95789b5ee56151812.tar.bz2 |
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.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTarget.cxx | 11 | ||||
-rw-r--r-- | Source/cmTarget.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ae250d4..18a7c50 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -866,6 +866,17 @@ cmListFileBacktrace const& cmTarget::GetBacktrace() const } //---------------------------------------------------------------------------- +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() { return (this->GetType() == cmTarget::EXECUTABLE && diff --git a/Source/cmTarget.h b/Source/cmTarget.h index dce4feb..23ef9dc 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -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. |