From 1c5c899fd7b9e0f5214f0e30b5dc64fa2508a27c Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 26 Oct 2001 15:42:02 -0400 Subject: [PATCH] add dependency for configure files and use short path in WIN32 cmake test --- Source/cmConfigureFileCommand.cxx | 1 + Source/cmMakefile.h | 4 ++++ Source/cmaketest.cxx | 18 +++++++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 9f482d395..c30a63b60 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -90,6 +90,7 @@ void cmConfigureFileCommand::FinalPass() void cmConfigureFileCommand::ConfigureFile() { m_Makefile->ExpandVariablesInString(m_InputFile); + m_Makefile->AddCMakeDependFile(m_InputFile.c_str()); m_Makefile->ExpandVariablesInString(m_OuputFile); cmSystemTools::ConvertToUnixSlashes(m_OuputFile); std::string::size_type pos = m_OuputFile.rfind('/'); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 8c0403dbf..532fadde8 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -493,6 +493,10 @@ public: const std::vector& GetListFiles() const { return m_ListFiles; } + ///! When the file changes cmake will be re-run from the build system. + void AddCMakeDependFile(const char* file) + { m_ListFiles.push_back(file);} + /** * Dump documentation to a file. If 0 is returned, the * operation failed. diff --git a/Source/cmaketest.cxx b/Source/cmaketest.cxx index 8756601b7..571e2f79c 100644 --- a/Source/cmaketest.cxx +++ b/Source/cmaketest.cxx @@ -3,6 +3,9 @@ #include "cmake.h" #include "cmListFileCache.h" #include "cmMakefileGenerator.h" +#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) +#include "windows.h" +#endif // this is a test driver program for cmake. int main (int argc, char *argv[]) @@ -60,8 +63,21 @@ int main (int argc, char *argv[]) cmListFileCache::GetInstance()->ClearCache(); // now build the test std::string makeCommand = MAKEPROGRAM; - makeCommand += " "; #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__) + // if there are spaces in the makeCommand, assume a full path + // and convert it to a path with no spaces in it as the + // RunCommand does not like spaces + if(makeCommand.find(' ') != std::string::npos) + { + char *buffer = new char[makeCommand.size()+1]; + if(GetShortPathName(makeCommand.c_str(), buffer, + makeCommand.size()+1) != 0) + { + makeCommand = buffer; + delete [] buffer; + } + } + makeCommand += " "; makeCommand += executableName; makeCommand += ".dsw /MAKE \"ALL_BUILD - Debug\" /REBUILD"; #else