[CMake] CHECK_C_SOURCE_COMPILES for objective c?

Nils Gladitz gladitz at sci-vis.de
Fri Sep 14 05:08:31 EDT 2012


A bit hackish but maybe
set(CMAKE_REQUIRED_DEFINITIONS "-x objective-c")
before your check_c_source_compiles call would help (at least with gcc; 
I'm not really familiar with objective c  itself).

Nils

On 09/14/2012 10:28 AM, Doug wrote:
> Small query:
>
> Checking for the presence of cocoa like this fails:
>
>      check_c_source_compiles("
>          #import <Cocoa/Cocoa.h>
>          int main (int argc, char** argv) {}" HAVE_VIDEO_COCOA)
>
> Because compiling blah.c with that content fails, where compiling
> blah.m with that content passes.
>
> What's the right way of handling this?
>
> ~
> Doug.
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


-- 
Nils Gladitz, B.Sc.
DICOM, Konnektivität und Entwicklung

Scivis wissenschaftliche Bildverarbeitung GmbH
Bertha-von-Suttner-Str. 5
D-37085 Göttingen
GERMANY
Handelsregister Nr. / Trade Register No. B3100 Göttingen
Geschäftsführer / Managing Directors Dr. Gernot Ebel, Dr. Uwe Engeland

Tel: 0049 (0)551 634181-28
E-Mail: gladitz at scivis.de
Web: www.scivis.de



More information about the CMake mailing list