diff options
author | Brad King <brad.king@kitware.com> | 2009-12-10 09:09:50 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-12-10 09:09:50 -0500 |
commit | d5eb99cb6ff0313626ce376522fcd0fceaeddd18 (patch) | |
tree | ccb40ffee50b7c1fa77cad80273216cf179670d2 | |
parent | 419d050bb528145431d115d83780847947ef475d (diff) | |
download | cmake-d5eb99cb6ff0313626ce376522fcd0fceaeddd18.tar.gz |
Simplify CMake self-install special case
CMake has a special case for the "make install" target when building
CMake itself. We use the just-built CMake to install itself since an
existing CMake installation cannot replace itself (at least on Windows).
We simplify the code that computes the location of the CMake binary by
taking advantage of existing generator support for target lookup. This
will make it robust to any changes in CMake's own CMakeLists.txt files
in the future.
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4734c50975..1cbd423e4c 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1761,7 +1761,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) ostr.str().c_str(), &cpackCommandLines, depends, 0); } - std::string cmd; + std::string cmd = cmakeCommand; cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end()); singleLine.erase(singleLine.begin(), singleLine.end()); @@ -1782,18 +1782,9 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets) if(mf->GetDefinition("CMake_BINARY_DIR")) { // We are building CMake itself. We cannot use the original - // executable to install over itself. - cmd = mf->GetDefinition("EXECUTABLE_OUTPUT_PATH"); - if(cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.') - { - cmd += "/"; - cmd += cmakeCfgIntDir; - } - cmd += "/cmake"; - } - else - { - cmd = cmakeCommand; + // executable to install over itself. The generator will + // automatically convert this name to the build-time location. + cmd = "cmake"; } singleLine.push_back(cmd.c_str()); if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.' ) |