MantisBT - CMake
View Issue Details
0015438CMake(No Category)public2015-03-09 04:132016-06-10 14:31
Mathieu Malaterre 
Kitware Robot 
normalminorhave not tried
closedmoved 
CMake 3.0.2 
 
0015438: project([...] C) for Objective-C
The following cmake scripts has an implicit (working) behavior for Objective-C++:

project(bla CXX)
add_executable(foo foo.c foo.mm)

However the following (equivalent) code does not seems to be working as I would expect:

project(bla C)
add_executable(foo foo.c foo.m)
While Objective-C has never been documented in CMake, it is a required behavior on MacOSX as so many of its API are only accessible through Objective-C.
No tags attached.
related to 0014516closed Kitware Robot Map LANGUAGE source file property to compiler language flag 
Issue History
2015-03-09 04:13Mathieu MalaterreNew Issue
2015-03-09 04:33Mathieu MalaterreNote Added: 0038179
2015-03-25 11:00Brad KingRelationship addedrelated to 0014516
2015-03-25 11:02Brad KingNote Added: 0038294
2016-06-10 14:29Kitware RobotNote Added: 0042727
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0038179)
Mathieu Malaterre   
2015-03-09 04:33   
What works for me is:

cmake_minimum_required(VERSION 3.1)
project(bla C)
add_executable(foo foo.c foo.m)
set_source_files_properties(foo.m PROPERTIES LANGUAGE C)
(0038294)
Brad King   
2015-03-25 11:02   
Relevant mailing list threads:

 Objective-C support
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/9371 [^]

 [patch] treat .m files as c, not c++
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/9707 [^]
(0042727)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.