Re: [cmake-developers] [patch] treat .m files as c, not c++

2014-03-20 Thread Brad King
On 03/19/2014 03:58 PM, Brad King wrote:
 I'll look at integrating the change.

I've applied the patch here:

 Treat .m files consistently as C across all generators
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95cdf132

with more detail in the commit message.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] [patch] treat .m files as c, not c++

2014-03-20 Thread Steve Wilson
Took me a bit longer than I expected, but you can find the 
'objective-c-support' topic at:

https://github.com/swwilso1/CMake.git


On Mar 19, 2014, at 11:55 AM, Steve Wilson ste...@wolfram.com wrote:

 On Mar 19, 2014, at 11:09 AM, Brad King brad.k...@kitware.com wrote:
 
 On 03/19/2014 12:50 PM, Tim Blechmann wrote:
 obj-c is a superset of c, while obj-c++ is a superset of obj-c
 
 this patch corrects this behavior.
 
 The incorrect behavior is left from the earliest days of CMake.
 Fixing this outright will change existing build behavior.  We
 would have to do this with a CMake Policy.  However, Steve Wilson
 is working on first-class Objective C and Objective C++ support:
 
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/9371
 
 That will resolve this in a compatible way by allowing projects
 to enable OBJC and/or OBJCXX languages to get .m and .mm sources
 compiled properly.
 
 Steve, do you have the work-in-progress topic published somewhere?
 
 Not at the moment, but I’ll work on making the topic available on github 
 before the end of the day.
 -- 
 
 Powered by www.kitware.com
 
 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ
 
 Kitware offers various services to support the CMake community. For more 
 information on each offering, please visit:
 
 CMake Support: http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html
 
 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html
 
 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



signature.asc
Description: Message signed with OpenPGP using GPGMail
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] [patch] treat .m files as c, not c++

2014-03-20 Thread Brad King
On 03/20/2014 11:38 AM, Steve Wilson wrote:
 Took me a bit longer than I expected, but you can find the 
 'objective-c-support' topic at:
 
 https://github.com/swwilso1/CMake.git

Great, thanks.

I encourage others to look at the topic and the discussion
thread I linked earlier in this thread.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] [patch] treat .m files as c, not c++

2014-03-20 Thread tim
 I'll look at integrating the change.
 
 I've applied the patch here:
 
  Treat .m files consistently as C across all generators
  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95cdf132
 
 with more detail in the commit message.

thanks a lot!

tim

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] [patch] treat .m files as c, not c++

2014-03-19 Thread Brad King
On 03/19/2014 12:50 PM, Tim Blechmann wrote:
 obj-c is a superset of c, while obj-c++ is a superset of obj-c
 
 this patch corrects this behavior.

The incorrect behavior is left from the earliest days of CMake.
Fixing this outright will change existing build behavior.  We
would have to do this with a CMake Policy.  However, Steve Wilson
is working on first-class Objective C and Objective C++ support:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/9371

That will resolve this in a compatible way by allowing projects
to enable OBJC and/or OBJCXX languages to get .m and .mm sources
compiled properly.

Steve, do you have the work-in-progress topic published somewhere?

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


[cmake-developers] [patch] treat .m files as c, not c++

2014-03-19 Thread Tim Blechmann
hi all,

compiling .m files with CXX_FLAGS like -std=c++11 causes troubles.
make/ninja treat .m files as c++, which is inconsistent in three
different ways:

a) cmSystemTools::GetFileFormat:
if ( ext == c || ext == .c ||
   ext == m || ext == .m
) { return cmSystemTools::C_FILE_FORMAT; }
  if (
ext == C || ext == .C ||
ext == M || ext == .M ||
ext == c++ || ext == .c++ ||
ext == cc || ext == .cc ||
ext == cpp || ext == .cpp ||
ext == cxx || ext == .cxx ||
ext == mm || ext == .mm
)

b) xcode and the cmake/xcode generator

c) the language detection based on the file extension as implemented by gcc:

man gcc:
   file.m
   Objective-C source code.  Note that you must link with the
   libobjc library to make an Objective-C program work.

obj-c is a superset of c, while obj-c++ is a superset of obj-c

this patch corrects this behavior.

best regards,
tim
From dc956e47ec280979d62666c42632d01267560927 Mon Sep 17 00:00:00 2001
From: Tim Blechmann t...@klingt.org
Date: Wed, 19 Mar 2014 17:31:01 +0100
Subject: [PATCH] Modules: treat .m files as c instead of c++

this gets it in line with cmSystemTools::GetFileFormat. especially
CXX_FLAGS should not be passed to obj-c sources

Signed-off-by: Tim Blechmann t...@klingt.org
---
 Modules/CMakeCCompiler.cmake.in   | 2 +-
 Modules/CMakeCXXCompiler.cmake.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 804cce2..694f8b8 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -26,7 +26,7 @@ if(CMAKE_COMPILER_IS_MINGW)
   set(MINGW 1)
 endif()
 set(CMAKE_C_COMPILER_ID_RUN 1)
-set(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
+set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
 set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
 set(CMAKE_C_LINKER_PREFERENCE 10)
 
diff --git a/Modules/CMakeCXXCompiler.cmake.in 
b/Modules/CMakeCXXCompiler.cmake.in
index 35aa6c4..c75611a 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -27,7 +27,7 @@ if(CMAKE_COMPILER_IS_MINGW)
 endif()
 set(CMAKE_CXX_COMPILER_ID_RUN 1)
 set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
-set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
+set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;mm;CPP)
 set(CMAKE_CXX_LINKER_PREFERENCE 30)
 set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
 
-- 
1.9.0

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] [patch] treat .m files as c, not c++

2014-03-19 Thread Steve Wilson
On Mar 19, 2014, at 11:09 AM, Brad King brad.k...@kitware.com wrote:

 On 03/19/2014 12:50 PM, Tim Blechmann wrote:
 obj-c is a superset of c, while obj-c++ is a superset of obj-c
 
 this patch corrects this behavior.
 
 The incorrect behavior is left from the earliest days of CMake.
 Fixing this outright will change existing build behavior.  We
 would have to do this with a CMake Policy.  However, Steve Wilson
 is working on first-class Objective C and Objective C++ support:
 
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/9371
 
 That will resolve this in a compatible way by allowing projects
 to enable OBJC and/or OBJCXX languages to get .m and .mm sources
 compiled properly.
 
 Steve, do you have the work-in-progress topic published somewhere?

Not at the moment, but I’ll work on making the topic available on github before 
the end of the day.


signature.asc
Description: Message signed with OpenPGP using GPGMail
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] [patch] treat .m files as c, not c++

2014-03-19 Thread Brad King
On 03/19/2014 01:29 PM, Tim Blechmann wrote:
 emulating old bugs is a nice thing, but then maybe the inconsistency between 
 xcode and make/ninja generators should be be documented or the xcode 
 generator should emulate wrong behavior to be consistent with make/ninja?

On second thought, since the Xcode generator already does this correctly
I think it is better to just fix the inconsistency.  I doubt anyone is
intentionally depending on compiling .m sources with the C++ compiler.
If it comes up we can add the CMake Policy for compatibility later.

It looks like this was reported and fixed in 2008:

 http://www.cmake.org/Bug/view.php?id=7045

but the fix was not correct because the generators do not use the
cmSystemTools::GetFileFormat hard-coded table anymore.

I'll look at integrating the change.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers