diff options
author | Brad King <brad.king@kitware.com> | 2005-01-04 23:24:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2005-01-04 23:24:52 (GMT) |
commit | 4b48a89b967ef62e611184f1e750d60777279683 (patch) | |
tree | 9ee17e2e9bee388cffd0d5ca4fa8f0b7e844efbd /Source/cmLocalUnixMakefileGenerator2.cxx | |
parent | 79c67a6dfa0f864734859a0ab08fe7c22bcfbf24 (diff) | |
download | CMake-4b48a89b967ef62e611184f1e750d60777279683.zip CMake-4b48a89b967ef62e611184f1e750d60777279683.tar.gz CMake-4b48a89b967ef62e611184f1e750d60777279683.tar.bz2 |
ENH: Added install target implementation. Also added missing include of assert.h.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator2.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator2.cxx | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator2.cxx b/Source/cmLocalUnixMakefileGenerator2.cxx index 9168fd2..99acf28 100644 --- a/Source/cmLocalUnixMakefileGenerator2.cxx +++ b/Source/cmLocalUnixMakefileGenerator2.cxx @@ -23,6 +23,8 @@ #include <queue> +#include <assert.h> + // Quick-switch for generating old makefiles. #if 0 # define CMLUMG_MAKEFILE_NAME "Makefile" @@ -32,8 +34,9 @@ #endif // TODO: Add "help" target. -// TODO: Add install targets to m_InstallTargets list. // TODO: Identify remaining relative path violations. +// TODO: Add test to drive installation through native build system. +// TODO: Is there a case where quoted object list fails and unquoted works? //---------------------------------------------------------------------------- cmLocalUnixMakefileGenerator2::cmLocalUnixMakefileGenerator2() @@ -147,11 +150,6 @@ void cmLocalUnixMakefileGenerator2::GenerateMakefile() "Build targets in this directory.", m_BuildTargets); - // Write install rules. - this->WritePassRules(makefileStream, "install", - "Install files from this directory.", - m_InstallTargets); - // Write clean rules. this->WritePassRules(makefileStream, "clean", "Clean targets in this directory.", @@ -895,6 +893,30 @@ cmLocalUnixMakefileGenerator2 no_commands); } + // Write special "install" target to run cmake_install.cmake script. + { + std::vector<std::string> no_depends; + std::vector<std::string> commands; + std::string cmd; + if(m_Makefile->GetDefinition("CMake_BINARY_DIR")) + { + // We are building CMake itself. We cannot use the original + // executable to install over itself. + cmd = m_ExecutableOutputPath; + cmd += "cmake"; + cmd = this->ConvertToRelativeOutputPath(cmd.c_str()); + } + else + { + cmd = "$(CMAKE_COMMAND)"; + } + cmd += " -P cmake_install.cmake"; + commands.push_back(cmd); + this->WriteMakeRule(makefileStream, + "Special rule to run installation script.", 0, + "install", no_depends, commands); + } + // Write special "rebuild_cache" target to re-run cmake. { std::vector<std::string> no_depends; |