I'm trying to use CMake (version 2.8.10) for a Fortran project with Visual Studio 10 and Intel Visual Fortran Composer XE 2011. But the generated .vfproj file seems to have bugs.
Below is the snippet in question:
<Tool Name="VFCustomBuildTool" CommandLine="setlocal m4 D:/foo/m4/sub/hello.m4 > D:/foo/build-vs/hello.f90 if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone :cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd" Description="Generating hello.f90" Outputs="D:foobuild-vshello.f90" AdditionalDependencies="D:foom4subhello.m4;"/>
Obviously the tag "VCEnd" is missing. So I modify the code to
... if %errorlevel% neq 0 goto :VCEnd :VCEnd endlocal" Description=" ...
When building, Visual Studio prompts:
>Project : error PRJ0019: A tool returned an error code from "Generating hello.f90"
I checked that the file "D:/foo/build-vs/hello.f90" is correctly generated, so the command "m4 D:/foo/m4/sub/hello.m4 > D:/foo/build-vs/hello.f90" has been executed properly and should return 0. How is the prompted "an error code" returned? I found little information on .vfproj file/ VFCustomBuildTool specification either in Intel Visual Fortran manual or on Internet. So I cannot figure out how to resolve this problem. Any suggestions? Thanks in advance.