diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-05-03 08:52:32 -0400 |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-05-03 08:52:32 -0400 |
commit | fc1562f0041b1145f79af34357810c5308a15e8e (patch) | |
tree | b11bab2e22a9dfbbb45630746ccdd2aa7cc52400 | |
parent | 0e77477a783804150ed474096ad5d4457082a8f6 (diff) | |
download | cmake-fc1562f0041b1145f79af34357810c5308a15e8e.tar.gz |
system config uses cmake commands now
-rw-r--r-- | CMakeSystemConfig.cmake.in | 8 | ||||
-rw-r--r-- | CMakeSystemConfig.txt.in | 6 | ||||
-rw-r--r-- | CMakeWindowsSystemConfig.cmake | 8 | ||||
-rw-r--r-- | CMakeWindowsSystemConfig.txt | 6 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 48 | ||||
-rw-r--r-- | Source/cmMakefile.h | 5 |
6 files changed, 33 insertions, 48 deletions
diff --git a/CMakeSystemConfig.cmake.in b/CMakeSystemConfig.cmake.in new file mode 100644 index 0000000000..ed860eff13 --- /dev/null +++ b/CMakeSystemConfig.cmake.in @@ -0,0 +1,8 @@ +# +# CMakeLocal.make.in should be in the directory where you run configure +# in, which need not be the source directory +# +SET (WORDS_BIGENDIAN @WORDS_BIGENDIAN@) +SET (HAVE_LIMITS_H @HAVE_LIMITS_H@) +SET (HAVE_UNISTD_H @HAVE_UNISTD_H@) + diff --git a/CMakeSystemConfig.txt.in b/CMakeSystemConfig.txt.in index 4c8cff23c6..ed860eff13 100644 --- a/CMakeSystemConfig.txt.in +++ b/CMakeSystemConfig.txt.in @@ -2,7 +2,7 @@ # CMakeLocal.make.in should be in the directory where you run configure # in, which need not be the source directory # -Define WORDS_BIGENDIAN @WORDS_BIGENDIAN@ -Define HAVE_LIMITS_H @HAVE_LIMITS_H@ -Define HAVE_UNISTD_H @HAVE_UNISTD_H@ +SET (WORDS_BIGENDIAN @WORDS_BIGENDIAN@) +SET (HAVE_LIMITS_H @HAVE_LIMITS_H@) +SET (HAVE_UNISTD_H @HAVE_UNISTD_H@) diff --git a/CMakeWindowsSystemConfig.cmake b/CMakeWindowsSystemConfig.cmake new file mode 100644 index 0000000000..e1faa24d80 --- /dev/null +++ b/CMakeWindowsSystemConfig.cmake @@ -0,0 +1,8 @@ +# +# CMakeLocal.make.in should be in the directory where you run configure +# in, which need not be the source directory +# +SET (WORDS_BIGENDIAN ) +SET (HAVE_LIMITS_H 1) +SET (HAVE_UNISTD_H 1) + diff --git a/CMakeWindowsSystemConfig.txt b/CMakeWindowsSystemConfig.txt index 773fd99fcc..e1faa24d80 100644 --- a/CMakeWindowsSystemConfig.txt +++ b/CMakeWindowsSystemConfig.txt @@ -2,7 +2,7 @@ # CMakeLocal.make.in should be in the directory where you run configure # in, which need not be the source directory # -Define WORDS_BIGENDIAN -Define HAVE_LIMITS_H 1 -Define HAVE_UNISTD_H 1 +SET (WORDS_BIGENDIAN ) +SET (HAVE_LIMITS_H 1) +SET (HAVE_UNISTD_H 1) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e063ee64b1..72dd9a618e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -87,37 +87,6 @@ void cmMakefile::AddDefaultCommands() } -void cmMakefile::ReadSystemConfiguration(const char *fname) -{ - std::ifstream fin(fname); - if(!fin) - { - cmSystemTools::Error("error can not open file ", fname); - return; - } - - cmRegularExpression aDef("^Define[ \t]*([A-Za-z_0-9]*)[ \t]*([A-Za-z_0-9]*)[ \t]*$"); - const int BUFFER_SIZE = 4096; - char inbuffer[BUFFER_SIZE]; - while (fin) - { - if(fin.getline(inbuffer, BUFFER_SIZE ) ) - { - if(aDef.find(inbuffer)) - { - // the arguments are the second match - std::string def = aDef.match(1); - std::string val = aDef.match(2); - // add the definition if true - if (cmSystemTools::IsOn(val.c_str())) - { - this->AddDefinition(def.c_str(),val.c_str()); - } - } - } - } -} - cmMakefile::~cmMakefile() { for(unsigned int i=0; i < m_UsedCommands.size(); i++) @@ -201,7 +170,10 @@ bool cmMakefile::ReadListFile(const char* filename, const char* external) { // keep track of the current file being read - m_cmCurrentListFile= filename; + if (filename) + { + m_cmCurrentListFile= filename; + } // if this is not a remote makefile // (if it were, this would be called from the "filename" call, @@ -245,8 +217,10 @@ bool cmMakefile::ReadListFile(const char* filename, const char* external) const char *filenametoread= filename; if( external) + { filenametoread= external; - + } + std::ifstream fin(filenametoread); if(!fin) { @@ -884,8 +858,8 @@ void cmMakefile::SetHomeDirectory(const char* dir) this->AddDefinition("CMAKE_SOURCE_DIR", this->GetHomeDirectory()); #if defined(_WIN32) && !defined(__CYGWIN__) std::string fpath = dir; - fpath += "/CMake/CMakeWindowsSystemConfig.txt"; - this->ReadSystemConfiguration(fpath.c_str()); + fpath += "/CMake/CMakeWindowsSystemConfig.cmake"; + this->ReadListFile(NULL,fpath.c_str()); #endif } @@ -896,7 +870,7 @@ void cmMakefile::SetHomeOutputDirectory(const char* lib) this->AddDefinition("CMAKE_BINARY_DIR", this->GetHomeOutputDirectory()); #if !defined(_WIN32) || defined(__CYGWIN__) std::string fpath = lib; - fpath += "/CMakeSystemConfig.txt"; - this->ReadSystemConfiguration(fpath.c_str()); + fpath += "/CMakeSystemConfig.cmake"; + this->ReadListFile(NULL,fpath.c_str()); #endif } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index fbfd6502d0..ff60091e6e 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -470,11 +470,6 @@ public: /** * find what source group this source is in */ - void ReadSystemConfiguration(const char *fname); - - /** - * find what source group this source is in - */ cmSourceGroup& FindSourceGroup(const char* source, std::vector<cmSourceGroup> &groups); |