Reputation: 2401
I have a project with CMake build system. Project type is Fortran
project(ProjectName Fortran)
and the Fortran compiler is recognized as well as the source code.
When trying to create a Visual Studio 9 2008 with
$ cmake . -G "Visual Studio 9 2008"
I get a Visual Studio project file for a C++ project. Which is obviously wrong. I do not have any hints on C/C++ in the project. Do I need to specify another command line option or do I need additional information in CMakeLists.txt?
[UPDATE]
I found in the /build directory of CMake some .vfproj files (beside a corresponding .vcproj file) which contain Fortran project files which are also readable by Visual Studio. The files where in directories with binary targets and modules. But in parent directories were none.
So, what is the trick to get one central Fortran Visual Studion project file for the whole project? I am still puzzled... Is it possible at all?
Upvotes: 3
Views: 1965
Reputation: 2834
As mentioned project (ProjectName Fortran)
should work.
The other option is to enable_language (Fortran)
.
Upvotes: 0
Reputation: 14250
You only show one line of code from your CMakeLists file:
project(ProjectName Fortran)
How do you go about adding references to your fortran source files? It should be something like this:
add_library(MyFLib1 MyFLib1.f)
Or this:
add_executable(MyFExe MyFExe.f)
If you add a library and an executable that are based solely on fortran source files, then CMake should generate a *.vfproj file for each one.
If not, it's a bug...
Upvotes: 1