[cmake-developers] [CMake 0015381]: Certain COMPILE_OPTIONS are missing in Fortran VS10 project after set_source_files_properties()

Mantis Bug Tracker mantis at public.kitware.com
Thu Jan 29 02:59:49 EST 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15381 
====================================================================== 
Reported By:                Øyvind Jensen
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15381
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-01-29 02:59 EST
Last Modified:              2015-01-29 02:59 EST
====================================================================== 
Summary:                    Certain COMPILE_OPTIONS are missing in Fortran VS10
project after set_source_files_properties()
Description: 
Unknown flags are at risk of being unintentionally overwritten.

By "unknown flags" I mean: compile flags that are unknown to the Visual Studio
generator, and for that reason are placed under "Additional options" in the
source file properties dialog of Visual Studio.

According to the documentation, the COMPILE_FLAGS property represents
*additional* flags. However, if an unknown flag is added to a source file using
set_source_files_properties(... COMPILE_FLAGS ...), 
any existing unknown flags will be overwritten.


Steps to Reproduce: 
Please find attached a minimal case that reproduces this behaviour. The archive
contains the files:
    cmake_bug_case/CMakeLists.txt
    cmake_bug_case/source.f90

1) Generate the build files using the Visual Studio 2010 generator (32bit or
64bit).

2) Verify that the "Additional options" field of the source file's property
dialog (Configuration Properties -> Fortran -> Command Line) contains only the
option "/unknown_flag2".

The expected outcome is to see both of the flags "/unknown_flag1" and
"/unknown_flag2" in the "Additional options" field.



Additional Information: 
There are some relatively important flags that are affected by this, for example
the /Qopenmp and the /traceback flags of Intels fortran compiler.

The NMake generator does not have this problem. It behaves as one would expect
from the documentation.

It is also interesting to note that if the COMPILE_FLAGS property is populated
with options that are known to the VS10 generator (flags that do not end up in
the "Additional options" field), everything works as expected.

Also, as you can see from the supplied test case, the problem is not that the
COMPILE_FLAGS property is overwritten, but rather that the visual studio
generator fails to combine compile flags with different origins.

CMake 2.8.12 has the same problem.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-01-29 02:59 Øyvind Jensen  New Issue                                    
2015-01-29 02:59 Øyvind Jensen  File Added: cmake_bug_case.zip                 
  
======================================================================



More information about the cmake-developers mailing list