[CMake] Cmake 3.0.2 generated projects for VS2010+ifort12.1, encountering problem with VS environment variable $(Configuration)

Fenjuan Hu fenjuan at bios.au.dk
Wed Oct 1 05:47:16 EDT 2014


Hi all
    I am using Cmake3.0.2, and want to generate project for Visual Studio 2010, and I have ifort 12 installed on my computer. After generated the project, when I build them, I got error:

  Error 1  fatal error LNK1181: cannot open input file 'C:\MODELS\build\fabm\0d\models\bb\bb.dir\\filter_feeder.obj' LINK

   Somehow, Visual Studio or Fortran compiler couldn't find the filter_feeder.obj file. While in path above,  between bb.dir and filter_feeder.obj is "\\", and between two slash, it should be "\Debug\" or "\Release\".
  Then I tried to find this object file(filter_feeder.obj), And I can see that its directory is  ('C:\MODELS\build\fabm\0d\models\bb\bb.dir\($Configuration)\filter_feeder.obj).
    So, somehow VS2010 or my fortran compiler can't recognize ($Configuration) when it tried to locate the object file.
    I did some research on Internet, and it was similar problem other people found, see:  https://github.com/TooTallNate/node-gyp/issues/35.
     But no solid solution to this question posted. Most of it is discussion of system information and versions of compilers and Visual Studio, how no solution to solve the problem of different versions.

     Afterwards, I looked up in the  project file (.vfproj), and viewed it with text editor, and in the file wherever the project file try to located the object files, the path was always"  **\**\($Configuration)\***.obj"(** represents any strings of my file directory, where it contains obj. files)

   It is said it's due to the Visual Studio has  changed environment variable ($ConfigurationName) to  ($Configuration)  from VS2008 to VS2010. Then I  replaced all ($Configuration) by ($ConfigurationName) in the vfproj file,  the build worked.

   And by the way, we have several people work on the same project, and two of other people using VS2010 and ifort worked perfectly with this CMake generating system. Their settings on their computer are:


    VS2010, version 10.0.40219.1 SP1Rel
     Intel Visual Fortran Composer XE 2013 Update 1, version 13.0.1.119

And

   VS2010, version 10.0.40219.1 SP1Rel
    Intel Visual Fortran Composer XE 2013 Update 1, version 13.0.1.119

And mine is :


    VS2010, version 10.0.40219.1 SP1Rel
    Intel Visual Fortran Composer XE 2013 Update 1, version 12.1.3534


So the only difference was the versions of ifort compiler. My version is a little old.

So when CMake generated the project files for VS2010 and ifort 12, did we take this problem into consideration?


Best regards

Fen







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20141001/79e151e2/attachment.html>


More information about the CMake mailing list