[cmake-developers] [CMake 0015175]: Intel Fortran 15.0 Visual Studio integration requires TargetName property for renamed targets

Mantis Bug Tracker mantis at public.kitware.com
Sun Sep 28 14:26:45 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15175 
====================================================================== 
Reported By:                Ian Harvey
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15175
Category:                   CMake
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-09-28 14:26 EDT
Last Modified:              2014-09-28 14:26 EDT
====================================================================== 
Summary:                    Intel Fortran 15.0 Visual Studio integration
requires TargetName property for renamed targets
Description: 
A change to the behaviour of the Visual Studio integration with ifort 15.0 means
that executable and DLL projects that have the base part of the output filename
different to the name of the project need to have the TargetName property set
for the project, or the integration will issue warnings during the build and the
manifest tool will fail (an EXE or DLL may still be produced).

Steps to Reproduce: 
With the following Fortran source in a file named HelloWorld.f90:

  IMPLICIT NONE
  PRINT "('Hello world')"
  END


and the following CMakeLists.txt in the same directory as above:

  cmake_minimum_required(VERSION 3.0.2)
  project(helloworld Fortran)
  add_executable(helloworld "HelloWorld.f90")
  set_target_properties(helloworld PROPERTIES OUTPUT_NAME foobar)


>From within an Intel Fortran command prompt in a build subdirectory run cmake:

  >"c:\Program Files (x86)\CMake\bin\cmake.exe" ..
  -- Building for: Visual Studio 10 2010
  -- The Fortran compiler identification is Intel
  -- Check for working Fortran compiler using: Visual Studio 10 2010
  -- Check for working Fortran compiler using: Visual Studio 10 2010  -- works
  -- Detecting Fortran compiler ABI info
  -- Detecting Fortran compiler ABI info - done
  -- Determine Intel Fortran Compiler Implicit Link Path
  -- Determine Intel Fortran Compiler Implicit Link Path -- done
  -- Checking whether C:/Program Files (x86)/Intel/Composer XE
2015/bin/ia32/ifort.exe supports Fortran 90
  -- Checking whether C:/Program Files (x86)/Intel/Composer XE
2015/bin/ia32/ifort.exe supports Fortran 90 -- yes
  -- Configuring done
  -- Generating done
  -- Build files have been written to: H:/Projects/cmake-test/build


Use cmake to then build the generated solution:

>"c:\Program Files (x86)\CMake\bin\cmake.exe" --build .
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>  Checking Build System
1>  CMake does not need to re-run because
H:/Projects/cmake-test/build/CMakeFiles/generate.stamp is up-to-date.
2>------ Build started: Project: helloworld, Configuration: Debug Win32 ------
2>helloworld: warning:
TargetPath(H:\Projects\cmake-test\build\Debug\helloworld.exe) does not match the
Linker's OutputF
ile property value (H:\Projects\cmake-test\build\Debug\foobar.exe). This may
cause your project to build incorrectly. To
 correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt)
property values match the value specified
 in %(Link.OutputFile).
2>Compiling with Intel(R) Visual Fortran Compiler XE 15.0.0.108 [IA-32]...
2>HelloWorld.f90
2>Compiling manifest to resources...
2>Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
2>Copyright (C) Microsoft Corporation.  All rights reserved.
2>Linking...
2>Microsoft (R) Incremental Linker Version 10.00.40219.01
2>Copyright (C) Microsoft Corporation.  All rights reserved.
2>/OUT:H:\Projects\cmake-test\build\Debug\foobar.exe
2>/VERSION:0.0
2>/MANIFEST
2>/MANIFESTFILE:helloworld.dir\Debug\helloworld.exe.intermediate.manifest
2>"/MANIFESTUAC:level='asInvoker' uiAccess='false'"
2>/DEBUG
2>/PDB:H:\Projects\cmake-test\build\Debug/foobar.pdb
2>/SUBSYSTEM:CONSOLE
2>/IMPLIB:H:\Projects\cmake-test\build\Debug\foobar.lib
2>user32.lib
2>/machine:X86
2>/debug
2>/INCREMENTAL
2>helloworld.dir\Debug\HelloWorld.obj
2>helloworld.dir\Debug\helloworld.exe.embed.manifest.res
2>Embedding manifest...
2>mt.exe : general error c10100b1: Failed to load file
"H:\Projects\cmake-test\build\Debug\helloworld.exe". The system c
annot find the file specified.
2>
2>Build log written to 
"file://H:\Projects\cmake-test\build\helloworld.dir\Debug\BuildLog.htm"
2>helloworld - 1 error(s), 1 warning(s)
3>------ Build started: Project: ALL_BUILD, Configuration: Debug Win32 ------
3>  Building Custom Rule H:/Projects/cmake-test/CMakeLists.txt
3>  CMake does not need to re-run because
H:\Projects\cmake-test\build\CMakeFiles\generate.stamp is up-to-date.
3>  Build all projects
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


Additional Information: 
This patch applied to cmLocalVisualStudio7Generator.cxx is a crude fix.

637a638,641
>
> // stolen from cmGlobalVisualStudio7Generator.cxx
> #define CM_INTEL_PLUGIN_GUID "{B68A201D-CB9B-47AF-A52F-7EEC72E217E4}"
>
651a656,677
>   // ifort 15.0 integration uses TargetName property.  Installed integration
>   // version test lifted from cmGlobalVisualStudio7Generator.cxx.
>   unsigned int intelVersionNumber = ~0u;
>   if (this->FortranProject) {
>     cmGlobalVisualStudio7Generator* gg =
>       static_cast<cmGlobalVisualStudio7Generator *>(
>          this->GlobalGenerator );
>     std::string intel_registry_version;
>     std::string vskey = gg->GetRegistryBase();
>     vskey += "\\Packages\\" CM_INTEL_PLUGIN_GUID ";ProductVersion";
>     cmSystemTools::ReadRegistryValue(vskey.c_str(), intel_registry_version,
>                                      cmSystemTools::KeyWOW64_32);
>     sscanf(intel_registry_version.c_str(), "%u", &intelVersionNumber);
>     if (intelVersionNumber == 15) {
>       std::string prefix;
>       std::string base;
>       std::string suffix;
>       target.GetFullNameComponents(prefix, base, suffix);
>       fout << "\t\t\tTargetName=\"" << this->EscapeForXML(base.c_str())
>            << "\"\n";
>     }
>   }
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-09-28 14:26 Ian Harvey     New Issue                                    
======================================================================



More information about the cmake-developers mailing list