From a8f9aa814e7362701b1c8b8271e12d12eff09c04 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 19 Mar 2001 10:09:43 -0500 Subject: [PATCH] ENH: Added generation of a rule to re-run CMake if the cable_config.xml file is missing. --- Source/cmCableCommand.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Source/cmCableCommand.cxx b/Source/cmCableCommand.cxx index 3f4be4efe..2d22308bb 100644 --- a/Source/cmCableCommand.cxx +++ b/Source/cmCableCommand.cxx @@ -78,4 +78,30 @@ void cmCableCommand::SetupCableData() // command as its owner. pathName += "/cable_config.xml"; m_CableData = new cmCableData(this, pathName); + + // We must add a custom rule to cause the cable_config.xml to be re-built + // when it is removed. Rebuilding it means re-running CMake. + std::string cMakeLists = m_Makefile->GetStartDirectory(); + cMakeLists += "/"; + cMakeLists += "CMakeLists.txt"; + std::string command = m_Makefile->GetHomeOutputDirectory(); + command += "/CMake/Source/"; + command += cmSystemTools::GetCMakeExecutableName(); + command += " " + cMakeLists; + command += " "; + command += cmSystemTools::GetCMakeExecutableOptions(); + command += " -H"; + command += m_Makefile->GetHomeDirectory(); + command += " -S"; + command += m_Makefile->GetStartDirectory(); + command += " -O"; + command += m_Makefile->GetStartOutputDirectory(); + command += " -B"; + command += m_Makefile->GetHomeOutputDirectory(); + + std::vector depends; + m_Makefile->AddCustomCommand(cMakeLists.c_str(), + "cable_config.xml", + command.c_str(), + depends); }