diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-05-21 13:32:11 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-05-21 13:32:11 (GMT) |
commit | 619864c09eac7b4d87e3607c017a52c0499fdc11 (patch) | |
tree | 66d23cad33de8aa096e53bdc2bd9c03bb1fefe43 /Source | |
parent | e2a555e1e177f364137c85ba326e4c91b7d89611 (diff) | |
download | CMake-619864c09eac7b4d87e3607c017a52c0499fdc11.zip CMake-619864c09eac7b4d87e3607c017a52c0499fdc11.tar.gz CMake-619864c09eac7b4d87e3607c017a52c0499fdc11.tar.bz2 |
new out of place builds
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Makefile.in | 12 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 15 | ||||
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 31 | ||||
-rw-r--r-- | Source/cmake.cxx | 6 |
4 files changed, 26 insertions, 38 deletions
diff --git a/Source/Makefile.in b/Source/Makefile.in index 4b68a2b..d0fadb8 100644 --- a/Source/Makefile.in +++ b/Source/Makefile.in @@ -7,12 +7,14 @@ CXXFLAGS = -DCMAKE_ROOT_DIR='"@CMAKE_ROOT_DIR@"' @CXXFLAGS@ -DCMAKE_HAS_AUT .SUFFIXES: .cxx .java .class +all: cmake + .cxx.o: ${CXX} ${CXXFLAGS} -c $< -o $@ OBJS = \ -CMakeBuildTargets.o \ +cmake.o \ cmMakeDepend.o \ cmMakefile.o \ cmMakefileGenerator.o \ @@ -28,10 +30,10 @@ cmCacheManager.o \ cmCableClassSet.o \ cmSourceGroup.o -DEPENDS = $(srcdir)/*.h ${CMAKE_CONFIG_DIR}/CMake/Source/cmConfigure.h +DEPENDS = $(srcdir)/*.h cmConfigure.h cmCollectFlags.o : $(DEPENDS) -CMakeBuildTargets.o : $(DEPENDS) +cmake.o : $(DEPENDS) cmMakeDepend.o : $(DEPENDS) cmMakefile.o : $(DEPENDS) cmMakefileGenerator.o : $(DEPENDS) @@ -49,6 +51,6 @@ cmSourceGroup.o : $(DEPENDS) -CMakeBuildTargets: ${OBJS} - ${CXX} ${OBJS} ${CXX_FLAGS} -o CMakeBuildTargets +cmake: ${OBJS} + ${CXX} ${OBJS} ${CXX_FLAGS} -o cmake diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 436146c..41a0ffa 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -64,13 +64,6 @@ cmMakefile::cmMakefile() this->AddDefaultCommands(); this->AddDefaultDefinitions(); cmCacheManager::GetInstance()->DefineCache(this); -#if defined(_WIN32) && !defined(__CYGWIN__) - const char* cacheValue - = cmCacheManager::GetInstance()->GetCacheValue("CMAKE_ROOT"); - std::string fpath = cacheValue; - fpath += "/Templates/CMakeWindowsSystemConfig.cmake"; - this->ReadListFile(NULL,fpath.c_str()); -#endif } void cmMakefile::AddDefaultCommands() @@ -346,6 +339,7 @@ void cmMakefile::SetMakefileGenerator(cmMakefileGenerator* mf) { delete m_MakefileGenerator; m_MakefileGenerator = mf; + mf->SetMakefile(this); } // Generate the output file @@ -353,8 +347,6 @@ void cmMakefile::GenerateMakefile() { // do all the variable expansions here this->ExpandVariables(); - // set the makefile on the generator - m_MakefileGenerator->SetMakefile(this); // give all the commands a chance to do something // after the file has been parsed before generation for(std::vector<cmCommand*>::iterator i = m_UsedCommands.begin(); @@ -868,11 +860,6 @@ void cmMakefile::SetHomeOutputDirectory(const char* lib) m_HomeOutputDirectory = lib; cmSystemTools::ConvertToUnixSlashes(m_HomeOutputDirectory); this->AddDefinition("CMAKE_BINARY_DIR", this->GetHomeOutputDirectory()); -#if !defined(_WIN32) || defined(__CYGWIN__) - std::string fpath = lib; - fpath += "/CMakeSystemConfig.cmake"; - this->ReadListFile(NULL,fpath.c_str()); -#endif } diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 306da35..d1490a4 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -517,7 +517,8 @@ OutputSubDirectoryVars(std::ostream& fout, fout << target << "_" << subdir.c_str() << ":\n"; if(target1) { - fout << "\tcd " << SubDirectories[i].c_str() + fout << "\tif test ! -d " << SubDirectories[i].c_str() << "; then ${MAKE} rebuild_cache; fi\n" + "\tcd " << SubDirectories[i].c_str() << "; ${MAKE} -${MAKEFLAGS} " << target1 << "\n"; } if(target2) @@ -802,43 +803,35 @@ void cmUnixMakefileGenerator::OutputMakeRules(std::ostream& fout) "Rule to build the Makefile", "Makefile", "${CMAKE_COMMAND} ${CMAKE_MAKEFILE_SOURCES} ", - "${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE}/CMakeLists.txt " + "${CMAKE_COMMAND} " "-S${CMAKE_CURRENT_SOURCE} -O${CMAKE_CURRENT_BINARY} " "-H${CMAKE_SOURCE_DIR} -B${CMAKE_BINARY_DIR}"); this->OutputMakeRule(fout, "Rule to build the cmake.depends", "cmake.depends", "${CMAKE_COMMAND} ${CMAKE_MAKEFILE_SOURCES} ", - "${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE}/CMakeLists.txt " + "${CMAKE_COMMAND} " "-S${CMAKE_CURRENT_SOURCE} -O${CMAKE_CURRENT_BINARY} " "-H${CMAKE_SOURCE_DIR} -B${CMAKE_BINARY_DIR}"); this->OutputMakeRule(fout, "Rule to force the build of cmake.depends", "depend", "${SUBDIR_DEPEND}", - "${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE}/CMakeLists.txt " + "${CMAKE_COMMAND} " "-S${CMAKE_CURRENT_SOURCE} -O${CMAKE_CURRENT_BINARY} " "-H${CMAKE_SOURCE_DIR} -B${CMAKE_BINARY_DIR}"); - - 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, "Rebuild the cache", "rebuild_cache", "${CMAKE_BINARY_DIR}/CMakeCache.txt", - "${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}/CMakeLists.txt " - "-MakeCache -S${CMAKE_SOURCE_DIR} -O${CMAKE_BINARY_DIR} " + "${CMAKE_COMMAND} " "-H${CMAKE_SOURCE_DIR} -B${CMAKE_BINARY_DIR}"); - // this->OutputMakeRule(fout, - // "Rebuild cmake dummy rule", - // "${CMAKE_COMMAND}", - // 0, - // "echo \"cmake might be out of date\""); - + this->OutputMakeRule(fout, + "Rebuild cmake dummy rule", + "${CMAKE_COMMAND}", + 0, + "echo \"cmake might be out of date\""); + } void cmUnixMakefileGenerator::OutputMakeRule(std::ostream& fout, diff --git a/Source/cmake.cxx b/Source/cmake.cxx index bb3a90d..d9a5c24 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -134,6 +134,12 @@ void cmake::SetArgs(cmMakefile& builder, int ac, char** av) m_Verbose = true; } } + + if (!m_Local) + { + builder.SetStartDirectory(builder.GetHomeDirectory()); + builder.SetStartOutputDirectory(builder.GetHomeOutputDirectory()); + } } // at the end of this CMAKE_ROOT and CMAAKE_COMMAND should be added to the cache |