Skip to content
  • Brad King's avatar
    FortranCInterface: Work around mingw32-make trouble with parens · 4cb73c43
    Brad King authored
    The mingw32-make tool does not handle parenthesis in the path to a
    source file consistently.  When CMake is installed in a typical location
    like "c:\Program Files (x86)\CMake 2.8\" the mingw32-make tool fails on
    the FortranCInterface detection project sometimes with errors like
    
     >mingw32-make -f CMakeFiles\myfort.dir\build.make CMakeFiles/myfort.dir/my_module.f90.obj
     mingw32-make: *** No rule to make target `x86)/CMake 2.8/share/cmake-2.8/Modules/FortranCInterface/my_module.f90)',
     needed by `CMakeFiles/myfort.dir/my_module.f90.obj'.  Stop.
    
    due to parens in the path to the FortranCInterface source directory.
    However, the behavior varies with the file name of build.make:
    
     >copy CMakeFiles\myfort.dir\build.make CMakeFiles\myfort.dir\build2.make
     >mingw32-make -f CMakeFiles\myfort.dir\build2.make CMakeFiles/myfort.dir/my_module.f90.obj
     [  3%] Building Fortran object CMakeFiles/myfort.dir/my_module.f90.obj
    
    Tested with
    
     >mingw32-make -v
     GNU Make 3.82
     Built for i386-pc-mingw32
    
    Work around the problem by copying the whole FortranCInterface source
    directory in to the project build tree.
    4cb73c43