summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2001-04-27 18:52:16 (GMT)
committerBrad King <brad.king@kitware.com>2001-04-27 18:52:16 (GMT)
commit244892bc3bd51f16c2e80a924bbae786f5e2acc3 (patch)
tree58f79da6a59c81bec9d161b9995a99777a965b39
parent2f42d7ffcb541979059715c6373f1d6f12044f5a (diff)
downloadCMake-244892bc3bd51f16c2e80a924bbae786f5e2acc3.zip
CMake-244892bc3bd51f16c2e80a924bbae786f5e2acc3.tar.gz
CMake-244892bc3bd51f16c2e80a924bbae786f5e2acc3.tar.bz2
BUG: Removed output of GCC_XML rules when the command cannot be found.
-rw-r--r--Source/cmCablePackageCommand.cxx38
1 files changed, 22 insertions, 16 deletions
diff --git a/Source/cmCablePackageCommand.cxx b/Source/cmCablePackageCommand.cxx
index 81bb6de..9a2e369 100644
--- a/Source/cmCablePackageCommand.cxx
+++ b/Source/cmCablePackageCommand.cxx
@@ -73,9 +73,10 @@ bool cmCablePackageCommand::Invoke(std::vector<std::string>& args)
{
// 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();
+ std::string cMakeLists = "\"";
+ cMakeLists += m_Makefile->GetStartDirectory();
cMakeLists += "/";
- cMakeLists += "CMakeLists.txt";
+ cMakeLists += "CMakeLists.txt\"";
std::string command;
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -147,20 +148,25 @@ bool cmCablePackageCommand::Invoke(std::vector<std::string>& args)
{
std::string command = "${GCCXML}";
m_Makefile->ExpandVariablesInString(command);
- std::vector<std::string> depends;
- depends.push_back(command);
- std::string input = "Cxx/"+m_PackageName+"_cxx.cxx";
- std::string output = "Cxx/"+m_PackageName+"_cxx.xml";
- command = "\""+command+"\" ${CXX_FLAGS} -fsyntax-only -fxml=" + output + " -c " + input;
-
- std::vector<std::string> outputs;
- outputs.push_back("Cxx/"+m_PackageName+"_cxx.xml");
-
- // A rule for the package's source files.
- m_Makefile->AddCustomCommand(input.c_str(),
- command.c_str(),
- depends,
- outputs, m_TargetName.c_str());
+ // Only add the rule if GCC-XML is available.
+ if((command != "") && (command != "${GCCXML}"))
+ {
+ std::vector<std::string> depends;
+ depends.push_back(command);
+ std::string input = m_Makefile->GetStartOutputDirectory();
+ input = input + "/Cxx/"+m_PackageName+"_cxx.cxx";
+ std::string output = "Cxx/"+m_PackageName+"_cxx.xml";
+ command = "\""+command+"\" ${CXX_FLAGS} -fsyntax-only -fxml=" + output + " -c " + input;
+
+ std::vector<std::string> outputs;
+ outputs.push_back("Cxx/"+m_PackageName+"_cxx.xml");
+
+ // A rule for the package's source files.
+ m_Makefile->AddCustomCommand(input.c_str(),
+ command.c_str(),
+ depends,
+ outputs, m_TargetName.c_str());
+ }
}
// add the source list to the target