summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-05-18 19:20:31 (GMT)
committerKen Martin <ken.martin@kitware.com>2001-05-18 19:20:31 (GMT)
commit7ec7fb7e95a8859c71d8a2345c88b62e81ac3124 (patch)
tree869504ba3bfd02caef92eec7c14355442bbafde9 /Source
parentcb0af952cf1ebaa82eb09bb3b63be681e3d2d3ca (diff)
downloadCMake-7ec7fb7e95a8859c71d8a2345c88b62e81ac3124.zip
CMake-7ec7fb7e95a8859c71d8a2345c88b62e81ac3124.tar.gz
CMake-7ec7fb7e95a8859c71d8a2345c88b62e81ac3124.tar.bz2
changes for cmake to live outside of the source tree
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMSProjectGenerator.cxx9
-rw-r--r--Source/cmMSProjectGenerator.h6
-rw-r--r--Source/cmMakefileGenerator.h6
-rw-r--r--Source/cmUnixMakefileGenerator.cxx30
-rw-r--r--Source/cmUnixMakefileGenerator.h6
5 files changed, 49 insertions, 8 deletions
diff --git a/Source/cmMSProjectGenerator.cxx b/Source/cmMSProjectGenerator.cxx
index 9a6f4f1..6a0c384 100644
--- a/Source/cmMSProjectGenerator.cxx
+++ b/Source/cmMSProjectGenerator.cxx
@@ -73,3 +73,12 @@ void cmMSProjectGenerator::SetLocal(bool local)
{
m_BuildDSW = !local;
}
+
+void cmMSProjectGenerator::ComputeSystemInfo()
+{
+ // now load the settings
+ std::string fpath =
+ cmCacheManager::GetInstance()->GetCacheValue("CMAKE_ROOT");
+ fpath += "/CMakeWindowsSystemConfig.cmake";
+ m_Makefile->ReadListFile(NULL,fpath.c_str());
+}
diff --git a/Source/cmMSProjectGenerator.h b/Source/cmMSProjectGenerator.h
index a4f568b..07f7a50 100644
--- a/Source/cmMSProjectGenerator.h
+++ b/Source/cmMSProjectGenerator.h
@@ -98,6 +98,12 @@ public:
cmDSPMakefile* GetDSPMakefile()
{return m_DSPMakefile;}
+ /**
+ * Try to determine system infomation such as shared library
+ * extension, pthreads, byte order etc.
+ */
+ virtual void ComputeSystemInfo();
+
private:
cmDSWMakefile* m_DSWMakefile;
cmDSPMakefile* m_DSPMakefile;
diff --git a/Source/cmMakefileGenerator.h b/Source/cmMakefileGenerator.h
index 72832b2..a44e62b 100644
--- a/Source/cmMakefileGenerator.h
+++ b/Source/cmMakefileGenerator.h
@@ -76,6 +76,12 @@ public:
*/
virtual void SetLocal(bool ) {};
+ /**
+ * Try to determine system infomation such as shared library
+ * extension, pthreads, byte order etc.
+ */
+ virtual void ComputeSystemInfo() = 0;
+
protected:
cmMakefile* m_Makefile;
};
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx
index 352dfb8..3e47dca 100644
--- a/Source/cmUnixMakefileGenerator.cxx
+++ b/Source/cmUnixMakefileGenerator.cxx
@@ -755,7 +755,7 @@ void cmUnixMakefileGenerator::OutputMakeVariables(std::ostream& fout)
"THREAD_LIBS = @CMAKE_THREAD_LIBS@\n"
"\n"
"# set up the path to the rulesgen program\n"
- "CMAKE_COMMAND = ${CMAKE_BINARY_DIR}/CMake/Source/CMakeBuildTargets\n"
+ "CMAKE_COMMAND = ${CMAKE_COMMAND}\n"
"\n"
"\n"
"\n";
@@ -794,12 +794,6 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
"Makefile cmake.depends ${TARGETS} ${SUBDIR_BUILD} ${CMAKE_COMMAND}",
0);
this->OutputMakeRule(fout,
- "rule to build cmake from source",
- "${CMAKE_COMMAND}", "${CMAKE_SOURCE_DIR}/CMake/Source/*.cxx "
- "${CMAKE_SOURCE_DIR}/CMake/Source/*.h",
- "cd ${CMAKE_BINARY_DIR}/CMake/Source; "
- "${MAKE} CMakeBuildTargets");
- this->OutputMakeRule(fout,
"remove generated files",
"clean",
"${SUBDIR_CLEAN}",
@@ -830,7 +824,7 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout)
"rebuild_cache",
"${CMAKE_BINARY_DIR}/CMakeCache.txt",
"${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}/CMakeLists.txt "
- "-MakeCache -S${CMAKE_SOURCE_DIR} -O${CMAKE_BINARY_DIR} "
+ "-S${CMAKE_SOURCE_DIR} -O${CMAKE_BINARY_DIR} "
"-H${CMAKE_SOURCE_DIR} -B${CMAKE_BINARY_DIR}");
}
@@ -889,3 +883,23 @@ void cmUnixMakefileGenerator::SetLocal (bool local)
m_Recurse = true;
}
}
+
+void cmUnixMakefileGenerator::ComputeSystemInfo()
+{
+ if (m_CacheOnly)
+ {
+ // currently we run configure shell script here to determine the info
+ std::string output;
+ std::string cmd;
+ const char* root
+ = cmCacheManager::GetInstance()->GetCacheValue("CMAKE_ROOT");
+ cmd = root;
+ cmd += "/Templates/configure";
+ cmSystemTools::RunCommand(cmd.c_str(), output);
+ }
+
+ // now load the settings
+ std::string fpath = m_Makefile->GetHomeOutputDirectory();
+ fpath += "/CMakeSystemConfig.cmake";
+ m_Makefile->ReadListFile(NULL,fpath.c_str());
+}
diff --git a/Source/cmUnixMakefileGenerator.h b/Source/cmUnixMakefileGenerator.h
index 8199017..4082724 100644
--- a/Source/cmUnixMakefileGenerator.h
+++ b/Source/cmUnixMakefileGenerator.h
@@ -84,6 +84,12 @@ public:
*/
void OutputObjectDepends(std::ostream&);
+ /**
+ * Try to determine system infomation such as shared library
+ * extension, pthreads, byte order etc.
+ */
+ virtual void ComputeSystemInfo();
+
private:
void RecursiveGenerateCacheOnly();
void GenerateCacheOnly();