From c8b2c317e2e3b07d297f75a0fcafb24235bcd14d Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Fri, 9 Jan 2009 18:58:21 -0500 Subject: [PATCH] BUG: fix #8105: don't hardcode "gcc" and "make" but use CMAKE_C_COMPILER and CMAKE_MAKE_PROGRAM instead Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 23 +++++++++++++++++++---- Source/cmExtraEclipseCDT4Generator.h | 3 ++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 713aeb939a..aba15d6e68 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -699,7 +699,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const "\n" ; - this->AppendStorageScanners(fout); + this->AppendStorageScanners(fout, *mf); fout << "\n" "\n" @@ -810,8 +810,23 @@ std::string cmExtraEclipseCDT4Generator::EscapeForXML(const std::string& value) // Helper functions //---------------------------------------------------------------------------- void cmExtraEclipseCDT4Generator -::AppendStorageScanners(cmGeneratedFileStream& fout) +::AppendStorageScanners(cmGeneratedFileStream& fout, + const cmMakefile& makefile) { + // we need the "make" and the C (or C++) compiler which are used, Alex + std::string make = makefile.GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); + std::string compiler = makefile.GetSafeDefinition("CMAKE_C_COMPILER"); + if (compiler.empty()) + { + compiler = makefile.GetSafeDefinition("CMAKE_CXX_COMPILER"); + } + if (compiler.empty()) //Hmm, what to do now ? + { + compiler = "gcc"; + } + + + // the following right now hardcodes gcc behaviour :-/ fout << "\n" "\n"; } diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h index 349156a34d..76079c8041 100644 --- a/Source/cmExtraEclipseCDT4Generator.h +++ b/Source/cmExtraEclipseCDT4Generator.h @@ -87,7 +87,8 @@ private: static std::string EscapeForXML(const std::string& value); // Helper functions - static void AppendStorageScanners(cmGeneratedFileStream& fout); + static void AppendStorageScanners(cmGeneratedFileStream& fout, + const cmMakefile& makefile); static void AppendTarget (cmGeneratedFileStream& fout, const std::string& target, const std::string& make);