View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010329CMakeCMakepublic2010-02-24 13:272016-06-10 14:31
ReporterBrian Bassett 
Assigned ToBill Hoffman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0010329: Visual Studio 2008 does not build Fortan objects for mixed-language targets
DescriptionGiven a simple listfile with a target that contains both Fortran and C (or C++) sources:

project(MixedFortran)
cmake_minimum_required(VERSION 2.8)
enable_language(Fortran)
add_executable(MixedFortran main.c fortran.f)

The Visual Studio 2008 generator outputs the following into MixedFortran.vcproj:

            <File
                RelativePath="Z:\src\snext\test\MixedFortran\fortran.f">
            </File>

Visual Studio does not understand how to compile Fortran sources found in a .vcproj. CMake should instead create a MixedFortran.vfproj file containing the Fortran sources. This vfproj should probably be a static library, which should be linked into the MixedFortran target.

This listfile works as expected when using the NMake or Unix makefile generators. Only the Visual Studio generators are affected.
Additional InformationEnvironment consists of:

CMake 2.8.0
Visual Studio 2008
Intel Visual Fortran 11.1.054

Attached files:

MixedFortran.zip: The source tree
VisualStudio.zip: The out-of-source binary build tree generated with cmake-gui, the "Visual Studio 9 2008" generator, and default compilers. Includes build log for the Debug configuration.
TagsNo tags attached.
Attached Fileszip file icon MixedFortran.zip [^] (676 bytes) 2010-02-24 13:27
zip file icon VisualStudio.zip [^] (413,867 bytes) 2010-02-24 21:11
patch file icon vs_mixedfortran.v2.patch [^] (17,468 bytes) 2010-06-08 22:59 [Show Content]

 Relationships

  Notes
(0019617)
Bill Hoffman (manager)
2010-02-25 09:40

Yes, this is a limitation of Visual Studio. Do you have a suggestion on how this can work?
(0019638)
Brian Bassett (reporter)
2010-02-25 19:51

I'd probably structure things so that a MixedFortran.vfproj project is created in addition to MixedFortran.vcproj. This new .vfproj would build a static lib of the Fortran sources, which would then be linked with the C/C++ sources in the .vcproj.

I can prototype a patch to CMake or an example of how the project files should look for the MixedFortran example I attached if that would help.
(0020949)
Brian Bassett (reporter)
2010-06-08 22:59

I've attached a prototype patch we're currently using on an internal project that should be able to serve as a starting point for a fix to this issue.
(0041656)
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
2010-02-24 13:27 Brian Bassett New Issue
2010-02-24 13:27 Brian Bassett File Added: MixedFortran.zip
2010-02-24 21:11 Brian Bassett File Added: VisualStudio.zip
2010-02-25 09:40 Bill Hoffman Note Added: 0019617
2010-02-25 09:40 Bill Hoffman Status new => assigned
2010-02-25 09:40 Bill Hoffman Assigned To => Bill Hoffman
2010-02-25 19:51 Brian Bassett Note Added: 0019638
2010-06-08 22:59 Brian Bassett File Added: vs_mixedfortran.v2.patch
2010-06-08 22:59 Brian Bassett Note Added: 0020949
2016-06-10 14:27 Kitware Robot Note Added: 0041656
2016-06-10 14:27 Kitware Robot Status assigned => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team