Quantcast

cmake 2.8.8 doesn't create vfproj for Visual Studio 10

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

cmake 2.8.8 doesn't create vfproj for Visual Studio 10

DonRobinson
Disclaimer - I'm just learning cmake. I read as much as I could before posting. I am attempting to use Cmake 2.8.8 to create a to create a VS2010 SLN file. I have MS Visual Studio 10, Intel Fortran XE 12.1.2.278 and MSVC 16.00.40219.01 all installed and work for other mixed language solutions (SLN files) created "by hand." Intermediate tests run internally by cmake appear to succeed and TryCompile executables are built. My listing of source files contains a mix of over 500 .f, .F77, .c and .h files. When the SLN file is created all files are incorporated into one project (vcxproj), and all .f files are treated as non-compilable. From a read of various posts I think that some developers have been able to combine all source code into a single project file that will compile. I haven't been able to do this! I welcome any advice (possibly even example CMakeLists.txt files) or URLs about how to proceed. I'm quite stuck at this point. My experience with working with hand-built SLN files created from with the VS2010 environment has been to keep .c code in separate C language projects which compile to LIB files that are linked. The .f code (the bulk of the code) is compiled separately and the LIB and OBJ files are combined at link time.
Donald Robinson
ESSA Technologies Ltd.
Vancouver, Canada
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cmake 2.8.8 doesn't create vfproj for Visual Studio 10

Bill Hoffman
On 8/17/2012 9:19 PM, DonRobinson wrote:

> Disclaimer - I'm just learning cmake. I read as much as I could before
> posting. I am attempting to use Cmake 2.8.8 to create a to create a
> VS2010 SLN file. I have MS Visual Studio 10, Intel Fortran XE 12.1.2.278
> and MSVC 16.00.40219.01 all installed and work for other mixed language
> solutions (SLN files) created "by hand." Intermediate tests run
> internally by cmake appear to succeed and TryCompile executables are
> built. My listing of source files contains a mix of over 500 .f, .F77,
> .c and .h files. When the SLN file is created all files are incorporated
> into one project (vcxproj), and all .f files are treated as
> non-compilable. From a read of various posts I think that */some
> /*developers have been able to combine all source code into a single
> project file that will compile. I haven't been able to do this! I
> welcome any advice (possibly even example CMakeLists.txt files) or URLs
> about how to proceed. I'm quite stuck at this point. My experience with
> working with hand-built SLN files created from with the VS2010
> environment has been to keep .c code in separate C language projects
> which compile to LIB files that are linked. The .f code (the bulk of the
> code) is compiled separately and the LIB and OBJ files are combined at
> link time.
> ------------------------------------------------------------------------

You have to separate the fortran from the C to get it to work with the
IDE project files.  So, all the fortran needs to be in its own
add_library call.  You can combine them with the makefiles in CMake but
VS has the restriction that the fortran has to be in a separate target.

Something like this should work:

add_library(fortranlib f1.f f2.f ...)
add_library(clib c1.c c2.c ...)
target_link_libraries(clib fortranlib)


-Bill

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: cmake 2.8.8 doesn't create vfproj for Visual Studio 10

DonRobinson

Thanks!

 

I’ll give it a try next week.

 

Donald Robinson

Sr. Systems Ecologist

ESSA Technologies Ltd.

Vancouver, Canada

www.essa.com

604.535.1997

- audio, video, disco

From: Bill Hoffman [via CMake] [mailto:[hidden email]]
Sent: Friday, August 17, 2012 8:35 PM
To: DonRobinson
Subject: Re: cmake 2.8.8 doesn't create vfproj for Visual Studio 10

 

On 8/17/2012 9:19 PM, DonRobinson wrote:


> Disclaimer - I'm just learning cmake. I read as much as I could before
> posting. I am attempting to use Cmake 2.8.8 to create a to create a
> VS2010 SLN file. I have MS Visual Studio 10, Intel Fortran XE 12.1.2.278
> and MSVC 16.00.40219.01 all installed and work for other mixed language
> solutions (SLN files) created "by hand." Intermediate tests run
> internally by cmake appear to succeed and TryCompile executables are
> built. My listing of source files contains a mix of over 500 .f, .F77,
> .c and .h files. When the SLN file is created all files are incorporated
> into one project (vcxproj), and all .f files are treated as
> non-compilable. From a read of various posts I think that */some
> /*developers have been able to combine all source code into a single
> project file that will compile. I haven't been able to do this! I
> welcome any advice (possibly even example CMakeLists.txt files) or URLs
> about how to proceed. I'm quite stuck at this point. My experience with
> working with hand-built SLN files created from with the VS2010
> environment has been to keep .c code in separate C language projects
> which compile to LIB files that are linked. The .f code (the bulk of the
> code) is compiled separately and the LIB and OBJ files are combined at
> link time.
> ------------------------------------------------------------------------

You have to separate the fortran from the C to get it to work with the
IDE project files.  So, all the fortran needs to be in its own
add_library call.  You can combine them with the makefiles in CMake but
VS has the restriction that the fortran has to be in a separate target.

Something like this should work:

add_library(fortranlib f1.f f2.f ...)
add_library(clib c1.c c2.c ...)
target_link_libraries(clib fortranlib)


-Bill

--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


If you reply to this email, your message will be added to the discussion below:

http://cmake.3232098.n2.nabble.com/cmake-2-8-8-doesn-t-create-vfproj-for-Visual-Studio-10-tp7581286p7581287.html

To unsubscribe from cmake 2.8.8 doesn't create vfproj for Visual Studio 10, click here.
NAML

Donald Robinson
ESSA Technologies Ltd.
Vancouver, Canada
Loading...