From 86aeefc7c97cd65d952513963400d28e6eb32808 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 5 Jan 2009 11:05:57 -0500 Subject: [PATCH] COMP: Fix installation of cmake-gui by CMake 2.4 When CMake 2.4 generates the build tree for CMake itself it asks the built CMake to install itself using the rules that 2.4 generated. Since the install rules use undocumented commands that are not compatible from 2.4 to 2.6 we need a special case to avoid failure. This sets a special indicator variable in the install rules that enables a compatibility hack to support the old install rule format. --- Source/QtDialog/CMakeLists.txt | 5 +++++ Source/cmFileCommand.cxx | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 9918d490a..4032b474e 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -72,6 +72,11 @@ ELSE(NOT QT4_FOUND) ENDIF(APPLE) SET(CMAKE_INSTALL_DESTINATION_ARGS BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}") + ELSE(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) + # Since the built CMake will install itself instead of the + # generating CMake, tell it that the install rules were generated + # by CMake 2.4. + INSTALL(CODE "SET(CMAKE_INSTALL_SELF_2_4 1)") ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) # if qt is not static and we are on windows then skip the install # I don't want to distribute qt dlls diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 9a452fa85..a10143575 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1690,7 +1690,7 @@ bool cmFileCommand::ParseInstallArgs(std::vector const& args, std::string stype = "FILES"; enum Doing { DoingNone, DoingFiles, DoingProperties, DoingPermissionsFile, DoingPermissionsDir, - DoingPermissionsMatch }; + DoingPermissionsMatch, DoingSelf24 }; Doing doing = DoingNone; bool use_given_permissions_file = false; bool use_given_permissions_dir = false; @@ -1844,6 +1844,14 @@ bool cmFileCommand::ParseInstallArgs(std::vector const& args, } else if ( *cstr == "COMPONENTS" ) { + if(this->Makefile->IsOn("CMAKE_INSTALL_SELF_2_4")) + { + // When CMake 2.4 builds this CMake version we need to support + // the install scripts it generates since it asks this CMake + // to install itself using the rules it generated. + doing = DoingSelf24; + continue; + } cmOStringStream e; e << "INSTALL called with old-style COMPONENTS argument. " << "This script was generated with an older version of CMake. " @@ -1903,6 +1911,13 @@ bool cmFileCommand::ParseInstallArgs(std::vector const& args, return false; } } + else if(doing == DoingSelf24) + { + // Ignore these arguments for compatibility. This should be + // reached only when CMake 2.4 is installing the current + // CMake. It can be removed when CMake 2.6 or higher is + // required to build CMake. + } else { this->SetError("called with inappropriate arguments");