MantisBT - CMake
View Issue Details
0014891CMakeCMakepublic2014-04-18 14:132016-06-10 14:31
vitaut 
Bill Hoffman 
normalminoralways
closedmoved 
x86_64 (amd64)Windows7
CMake 2.8.11.2 
 
0014891: cmake_add_fortran_subdirectory incorrectly handles path to gfortran compiler containing spaces
I use cmake_add_fortran_subdirectory to build a Fortran subproject with MinGW gfortran as described in http://www.kitware.com/blog/home/post/231. [^] 64-bit build of MinGW obtained from http://mingw-w64.sourceforge.net/ [^] is installed in the default location "C:\Program Files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64". CMake correctly generates Visual Studio solution and project files, but when running the build the following error is reported:

CUSTOMBUILD : CMake error : your Fortran compiler: "C:/Program" was not found. Please set CMAKE_Fortran_COMPILER to a valid compiler path or name. [C:\fortran-test\SUB1_build.vcxproj]
CUSTOMBUILD : CMake error : Internal CMake error, TryCompile configure of cmake failed [C:\fortran-test\SUB1_build.vcxproj]
  -- Check for working Fortran compiler: C:/Program -- broken

See the attached log for the full output.

It seems that CMake is confused by space in the compiler path.
1. Install MinGW from http://mingw-w64.sourceforge.net/ [^] in "C:\Program Files".

2. Get a copy of the test repository:

  git clone https://github.com/vitaut/fortran-test [^]

3. Generate Visual Studio solution and project files:

  cmake -G "Visual Studio 10 Win64" .

4. Try building the solution:

  msbuild TEST.sln

5. Observe the error.
No tags attached.
txt build-log.txt (6,956) 2014-04-18 14:13
https://public.kitware.com/Bug/file/5134/build-log.txt
Issue History
2014-04-18 14:13vitautNew Issue
2014-04-18 14:13vitautFile Added: build-log.txt
2014-04-18 14:35Brad KingAssigned To => Bill Hoffman
2014-04-18 14:35Brad KingStatusnew => assigned
2014-04-18 14:36Brad KingSummaryCMake incorrectly handles path to gfortran compiler containing spaces => cmake_add_fortran_subdirectory incorrectly handles path to gfortran compiler containing spaces
2016-06-10 14:29Kitware RobotNote Added: 0042539
2016-06-10 14:29Kitware RobotStatusassigned => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0042539)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.