Re: [CMake] Fortran project compiling with -isystem causing error

2015-03-26 Thread Hugh Sorby
Thanks Brad, I looked at the documentation for gfortran and it says (before asking about my problem, I also read the CMake documentation but failed to comprehend it properly) |-isystem|dir Searchdirfor header files, after all directories specified by-Ibut before the standard system dire

Re: [CMake] Fortran project compiling with -isystem causing error

2015-03-26 Thread Brad King
On 03/25/2015 08:26 PM, Hugh Sorby wrote: > |-- ex > | |-- CMakeLists.txt > | `-- use_mod.f90 > |-- ex-build > |-- install > |-- modsrc > | |-- CMakeLists.txt > | `-- a.f90 > `-- modsrc-build Thanks for the detailed example. It was trivial to reproduce the issue with that! Since this com

Re: [CMake] Fortran project compiling with -isystem causing error

2015-03-25 Thread Hugh Sorby
Right got it, the problem occurs when I add the target_link_libraries command to the dependent project. The attached tar.gz contains my not working example source, layout: Konsole output . |-- ex | |-- CMakeLists.txt | `-- use_mod.f90 |-- ex-build |-- install |-- modsrc | |-- CMakeLis

Re: [CMake] Fortran project compiling with -isystem causing error

2015-03-25 Thread Hugh Sorby
My first simple example worked, so I looked at adding an imported target, as this is what my actual script has, to install the dependent modules but this also worked as expected. I am now going to go back to the original CMakeLists.txt file to see if I can make it the same as my second examp

Re: [CMake] Fortran project compiling with -isystem causing error

2015-03-25 Thread Brad King
On Tue, Mar 24, 2015 at 11:03 PM, Hugh Sorby wrote: > I am trying to create a simple Fortran project that relies on a module file > that has been built by another project. I have added the directory > containing the module file into the include_directories command but the > project isn't compiling

[CMake] Fortran project compiling with -isystem causing error

2015-03-24 Thread Hugh Sorby
Hi All, I am trying to create a simple Fortran project that relies on a module file that has been built by another project. I have added the directory containing the module file into the include_directories command but the project isn't compiling and raises an error can't find module. The d