diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-04-27 15:36:53 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-04-27 15:36:53 (GMT) |
commit | 5b13f975b94e7497a8cfcfcfb708d1abc1951efe (patch) | |
tree | 195b26594bb79952ef877252e320fa4b1dbc23cc | |
parent | de67154214cd2c087086f94ea380656ccb67d053 (diff) | |
download | CMake-5b13f975b94e7497a8cfcfcfb708d1abc1951efe.zip CMake-5b13f975b94e7497a8cfcfcfb708d1abc1951efe.tar.gz CMake-5b13f975b94e7497a8cfcfcfb708d1abc1951efe.tar.bz2 |
BUG: fix inplace builds
-rw-r--r-- | CMakeRules.make.in | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 26 |
2 files changed, 17 insertions, 11 deletions
diff --git a/CMakeRules.make.in b/CMakeRules.make.in index 3a8e249..72b3c37 100644 --- a/CMakeRules.make.in +++ b/CMakeRules.make.in @@ -20,7 +20,7 @@ depend: ${CMAKE} ${SUBDIR_DEPEND} clean: ${SUBDIR_CLEAN} rm -f ${SRC_OBJ} ${EXECUTABLES} ${TARGETS} -CMakeTargets.make: ${CMAKE} ${srcdir}/CMakeLists.txt +CMakeTargets.make: ${CMAKE} ${srcdir}/CMakeLists.txt ${CMAKE_CONFIG_DIR}/CMakeCache.txt ${CMAKE} ${currentdir}/CMakeLists.txt -S${currentdir} -O${currentbindir} -H${topdir} -B${CMAKE_CONFIG_DIR} rebuild_cache: ${CMAKE_CONFIG_DIR}/CMakeCache.txt diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 20a1363..54067ff 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -670,20 +670,26 @@ void cmMakefile::GenerateCacheOnly() << mf->GetHomeOutputDirectory() << "/CMake/CMakeMaster.make\n"; dest = mf->GetStartOutputDirectory(); dest += "/CMakeTargets.make"; - std::cout << "cmake: creating : " << dest.c_str() << "\n"; - std::ofstream fout2(dest.c_str()); - if(!fout2) - { - cmSystemTools::Error("Failed to open file for write " , dest.c_str()); + // make sure there is a CMakeTargets.make file as some + // makes require it to exist + if(!cmSystemTools::FileExists(dest.c_str())) + { + std::cout << "cmake: creating : " << dest.c_str() << "\n"; + std::ofstream fout(dest.c_str()); + if(!fout) + { + cmSystemTools::Error("Failed to open file for write " , dest.c_str()); + } + fout << "#Initial CMakeTargets.make file created only to keep \n"; + fout << "#certain makes happy that don't like to include makefiles\n"; + fout << "#that do not exist\n"; } - fout2 << "#Initial CMakeTargets.make file created only to keep \n"; - fout2 << "#certain makes happy that don't like to include makefiles\n"; - fout2 << "#that do not exist\n"; } - + + // CLEAN up the makefiles created for(unsigned int i =0; i < makefiles.size(); ++i) { - delete makefiles[i]; + delete makefiles[i]; } } |