diff options
-rw-r--r-- | Source/cmNMakeMakefileGenerator.cxx | 17 | ||||
-rw-r--r-- | Source/cmNMakeMakefileGenerator.h | 9 | ||||
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 55 | ||||
-rw-r--r-- | Source/cmUnixMakefileGenerator.h | 13 |
4 files changed, 43 insertions, 51 deletions
diff --git a/Source/cmNMakeMakefileGenerator.cxx b/Source/cmNMakeMakefileGenerator.cxx index 5059d9f..713cc69 100644 --- a/Source/cmNMakeMakefileGenerator.cxx +++ b/Source/cmNMakeMakefileGenerator.cxx @@ -676,22 +676,27 @@ bool cmNMakeMakefileGenerator::SamePath(const char* path1, const char* path2) cmSystemTools::LowerCase(ShortPath(path2)); } -void cmNMakeMakefileGenerator::OutputBuildLibraryInDir(std::ostream& fout, - const char* path, - const char* , - const char* fullpath) +void cmNMakeMakefileGenerator::OutputBuildTargetInDir(std::ostream& fout, + const char* path, + const char* library, + const char* fullpath, + const char* libOutPath) { - + const char* makeTarget = library; std::string currentDir = this->ConvertToOutputPath(m_Makefile->GetCurrentOutputDirectory()); std::string wpath = this->ConvertToOutputPath(path); std::string wfullpath = this->ConvertToOutputPath(fullpath); + if(libOutPath && strcmp( libOutPath, "" ) != 0) + { + makeTarget = wfullpath.c_str(); + } fout << wfullpath << ":\n\tcd " << wpath << "\n" << "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.depends\n" << "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) cmake.check_depends\n" << "\t$(MAKE) -$(MAKEFLAGS) $(MAKESILENT) -f cmake.check_depends\n" - << "\t$(MAKE) $(MAKESILENT) " << wfullpath + << "\t$(MAKE) $(MAKESILENT) " << makeTarget << "\n\tcd " << currentDir << "\n"; } diff --git a/Source/cmNMakeMakefileGenerator.h b/Source/cmNMakeMakefileGenerator.h index 1a51a96..29d6715 100644 --- a/Source/cmNMakeMakefileGenerator.h +++ b/Source/cmNMakeMakefileGenerator.h @@ -79,10 +79,11 @@ protected: const cmTarget &tgt); virtual std::string GetOutputExtension(const char* sourceExtension); virtual void OutputIncludeMakefile(std::ostream&, const char* file); - virtual void OutputBuildLibraryInDir(std::ostream& fout, - const char* path, - const char* library, - const char* fullpath); + virtual void OutputBuildTargetInDir(std::ostream& fout, + const char* path, + const char* library, + const char* fullpath, + const char* outputPath); ///! return true if the two paths are the same (checks short paths) virtual bool SamePath(const char* path1, const char* path2); void SetLibraryPathOption(const char* lib){ m_LibraryPathOption = lib;} diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 3165098..e8e7165 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -986,10 +986,13 @@ void cmUnixMakefileGenerator::OutputDependLibs(std::ostream& fout) } libpath += library; // put out a rule to build the library if it does not exist - this->OutputBuildLibraryInDir(fout, - cacheValue, - library.c_str(), - libpath.c_str()); + this->OutputBuildTargetInDir(fout, + cacheValue, + library.c_str(), + libpath.c_str(), + m_Makefile-> + GetDefinition("LIBRARY_OUTPUT_PATH") + ); } // something other than a library... else @@ -1004,23 +1007,26 @@ void cmUnixMakefileGenerator::OutputDependLibs(std::ostream& fout) exepath += "/"; } exepath += *lib; - this->OutputBuildExecutableInDir(fout, - cacheValue, - lib->c_str(), - exepath.c_str()); + this->OutputBuildTargetInDir(fout, + cacheValue, + lib->c_str(), + exepath.c_str(), + m_Makefile-> + GetDefinition("EXECUTABLE_OUTPUT_PATH") + ); } } } } -void cmUnixMakefileGenerator::OutputBuildLibraryInDir(std::ostream& fout, - const char* path, - const char* library, - const char* fullpath) +void cmUnixMakefileGenerator::OutputBuildTargetInDir(std::ostream& fout, + const char* path, + const char* library, + const char* fullpath, + const char* outputPath) { const char* makeTarget = library; - const char* libOutPath = m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"); - if(libOutPath && strcmp( libOutPath, "" ) != 0) + if(outputPath && strcmp( outputPath, "" ) != 0) { makeTarget = fullpath; } @@ -1029,27 +1035,10 @@ void cmUnixMakefileGenerator::OutputBuildLibraryInDir(std::ostream& fout, << "; $(MAKE) $(MAKESILENT) cmake.depends" << "; $(MAKE) $(MAKESILENT) cmake.check_depends" << "; $(MAKE) $(MAKESILENT) -f cmake.check_depends" - << "; $(MAKE) $(MAKESILENT) " << makeTarget << "\n\n"; + << "; $(MAKE) $(MAKESILENT) " + << this->ConvertToOutputPath(makeTarget) << "\n\n"; } -void cmUnixMakefileGenerator::OutputBuildExecutableInDir(std::ostream& fout, - const char* path, - const char* library, - const char* fullpath) -{ - const char* makeTarget = library; - const char* libOutPath = m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); - if(libOutPath && strcmp( libOutPath, "" ) != 0) - { - makeTarget = fullpath; - } - fout << this->ConvertToOutputPath(fullpath) - << ":\n\tcd " << this->ConvertToOutputPath(path) - << "; $(MAKE) $(MAKESILENT) cmake.depends" - << "; $(MAKE) $(MAKESILENT) cmake.check_depends" - << "; $(MAKE) $(MAKESILENT) -f cmake.check_depends" - << "; $(MAKE) $(MAKESILENT) " << makeTarget << "\n\n"; -} bool cmUnixMakefileGenerator::SamePath(const char* path1, const char* path2) { diff --git a/Source/cmUnixMakefileGenerator.h b/Source/cmUnixMakefileGenerator.h index c25879c..d3a7939 100644 --- a/Source/cmUnixMakefileGenerator.h +++ b/Source/cmUnixMakefileGenerator.h @@ -141,14 +141,11 @@ protected: const char* command2 = 0, const char* command3 = 0, const char* command4 = 0); - virtual void OutputBuildLibraryInDir(std::ostream& fout, - const char* path, - const char* library, - const char* fullpath); - virtual void OutputBuildExecutableInDir(std::ostream& fout, - const char* path, - const char* library, - const char* fullpath); + virtual void OutputBuildTargetInDir(std::ostream& fout, + const char* path, + const char* library, + const char* fullpath, + const char* outputPath); ///! return true if the two paths are the same virtual bool SamePath(const char* path1, const char* path2); virtual std::string GetOutputExtension(const char* sourceExtension); |