From 556d27c9eb075dfedb4c1262d51138f2ddf5daad Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 16 Jul 2001 10:14:41 -0400 Subject: [PATCH] ENH: add support for mac osx --- Source/cmMakefile.cxx | 5 ++++- Source/cmSourceFile.cxx | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index a0bb617c0..f44961094 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -108,8 +108,11 @@ void cmMakefile::AddDefaultCommands() // Cygwin is more like unix so enable the unix commands #if defined(__CYGWIN__) this->AddDefinition("UNIX", "1"); + this->AddDefinition("CYGWIN", "1"); +#endif +#if defined(__APPLE__) + this->AddDefinition("APPLE", "1"); #endif - // always creat an empty install target cmTarget target; target.SetType(cmTarget::INSTALL); diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 29e74445a..2081575db 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -134,6 +134,26 @@ void cmSourceFile::SetName(const char* name, const char* dir) return; } + hname = pathname; + hname += ".m"; + if(cmSystemTools::FileExists(hname.c_str())) + { + m_SourceExtension = "m"; + m_HeaderFileOnly = false; + m_FullPath = hname; + return; + } + + hname = pathname; + hname += ".M"; + if(cmSystemTools::FileExists(hname.c_str())) + { + m_SourceExtension = "M"; + m_HeaderFileOnly = false; + m_FullPath = hname; + return; + } + hname = pathname; hname += ".h"; if(cmSystemTools::FileExists(hname.c_str())) @@ -144,7 +164,7 @@ void cmSourceFile::SetName(const char* name, const char* dir) } cmSystemTools::Error("can not find file ", hname.c_str()); - cmSystemTools::Error("Tried .txx .cxx .c for ", hname.c_str()); + cmSystemTools::Error("Tried .cxx .c .txx .cpp .m .M .h for ", hname.c_str()); } void cmSourceFile::SetName(const char* name, const char* dir, const char *ext,