View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007389CMakeCMakepublic2008-07-22 10:162016-06-10 14:30
ReporterFederico Carminati 
Assigned ToBill Hoffman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0007389: Fortran flags assigned to C compiler when generating Xcode
DescriptionCurrently CMake does not support Fortran language for Xcode, as Xcode itself does not support it. However it is possible to generate an Xcode project where C files are compiled but not Fortran files. In this case CMake assigns to the C compiler the flags defined for the fortran compiler, and therefore also C compilation breaks. This should not happen. Please consider the following example of CMakeLists.txt

Project(Test)
Cmake_Minimum_Required(VERSION 2.6)
Set(CMAKE_Fortran_COMPILER gfortran)
Enable_Language(Fortran)
Set(CMAKE_Fortran_FLAGS "-fno-second-underscore")
Add_Executable(hello hello.c sub.F)

Xcode generation works, however the -fno-second-underscore flag ends up in the CFLAGS and therefore C compilation fails.
Additional InformationThe files mentioned before are immaterial, however for completeness here they are

[.../Users/fca/cmaketest] cat sub.f
      subroutine sub
      print *, 'Hello World from Fortran!'
      end

[.../Users/fca/cmaketest] cat hello.c
#include <stdio.h>

void sub_();
int main () {printf(" Hello World from C!\n"); sub_(); return 0;}

TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0041442)
Kitware Robot (administrator)
2016-06-10 14:27

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.

 Issue History
Date Modified Username Field Change
2008-07-22 10:16 Federico Carminati New Issue
2008-08-19 16:47 Bill Hoffman Status new => assigned
2008-08-19 16:47 Bill Hoffman Assigned To => Bill Hoffman
2016-06-10 14:27 Kitware Robot Note Added: 0041442
2016-06-10 14:27 Kitware Robot Status assigned => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team