Generate

Generate

I am converting a project to use cmake to generate my visual studio (2010) project files.

When I directly use Visual Studio to (successfully) compile/link my project, I start by creating a "QuickWin Application Intel(R) Visual Fortan" project. This seems to set up all the correct libraries et cetera for my project.

When I use cmake (2.8.10.2) I can not seem to figure out how to have it generate the Visual Studio project file with the same defaults. And I can not seem to see how to change the cmake generated Visual Studio project file to be of the QuickWin type.

Does someone know how to do this? or is there a place to see what options the "QuickWin Application Intel(R) Visual Fortan" project selection has set so that I can try to coax cmake to set them?

Thanks in advance,

-sanjay

9 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Can cmake create a Fortran project at all?  You can open a .vfproj file in Notepad to see what it looks like.

Steve - Intel Developer Support

Yes, we use cmake to generate some of our Fortran project(s).  Also has several c libraries that are combined.  It takes a bit of getting used to if you've been using Visual Studio all along.

Linda

Thanks for the hint.  I was reading the .sln files.  I will have a look at the .vfproj files

Steve,

The .vfproj files seem to give the hint as to how to fix the problem.  One thing I see right off is that cmake only supports the runtime libraries rtMultiThreaded[Debug][DLL].  There is no generator option for rtQuickWin.  This is a bit dissappointing but at least I know know where to start hacking.

Thanks for the help.  -sanjay

Try adding /libs:qwin to the command line; it puts linker directives in the object file to include the QuickWin libraries.

  --Lorri

Lorri you are correct about adding /libs:qwin helps.  This allows for a successful linking of the code.  But at run time the code crashes with an error (in a QuickWin utility function).  Note I have also investigated changing the the run time library to rtQuickWin -- as well as adjusting the KEYWORD in the vfproj file to QuickWin -- as well as all permuations of these changes.

The bottom line seems to be that the vfproj file from cmake sets far too many options and one or more of these is interfering with the creation of a proper executable.  When I build the project 'manual', i.e. directly from within Visual Studio, everything works fine and I note that the vfproj file is substantially simpler.  It simply uses a lot of default options unlike the cmake generated vfproj.

So I am still searching for the crucial difference.

-sanjay

QuickWin needs two things:

1. /libs:qwin
2. /subsystem:windows (linker option)

Steve - Intel Developer Support

Steve, that was the solution!  Thanks so much.  I was just about to write a custom_command for cmake to force it in a rather painstaking way to create a .sln and .vfproj file that I know would work.  But your point 2 solved everything without having to suffer through the custom route.

To summarize, two steps were needed to get things working between cmake and VisualStudio for a QuickWin application.  After running cmake, go to the project properties, then

1: Under Fortran,Libraries select QuickWin for the runtime library, click apply

2: Under Linker,System select Windows for the SubSystem, click apply

-sanjay

Leave a Comment

Please sign in to add a comment. Not a member? Join today