MantisBT - CMake
View Issue Details
0008408CMakeCMakepublic2009-01-20 11:102009-02-24 15:40
Matthew West 
Brad King 
normalminoralways
closedfixed 
CMake-2-6 
 
0008408: /usr/include should not be omitted from include_directories() with gfortran
gfortran does not automatically search /usr/include for .mod module files, but trying to add /usr/include to the include path with include_directories(/usr/include) does not do so because it is automatically excluded.

At the moment I'm doing an unconditional add_definitions(-I/usr/include) but this is a bit of a hack.

For a discussion of the issue from the gfortran side see:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35707 [^]

The code that should work is:

FIND_PATH(NETCDF_INCLUDE_DIR netcdf.mod
  DOC "NetCDF include directory"
  PATHS
  /usr/include
  /usr/include/netcdf-3)
INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIR})

which works fine if netcdf.mod is installed in /usr/include/netcdf-3 but fails if netcdf.mod is installed in /usr/include (because gfortran needs the explicit -I/usr/include).
No tags attached.
child of 0008598closed Brad King implicit include directory suppression may be outdated 
Issue History
2009-01-20 11:10Matthew WestNew Issue
2009-02-24 10:19Bill HoffmanStatusnew => assigned
2009-02-24 10:19Bill HoffmanAssigned To => Brad King
2009-02-24 15:24Brad KingRelationship addedchild of 0008598
2009-02-24 15:40Brad KingNote Added: 0015342
2009-02-24 15:40Brad KingStatusassigned => closed
2009-02-24 15:40Brad KingResolutionopen => fixed

Notes
(0015342)
Brad King   
2009-02-24 15:40   
I've removed include dir suppression outright. See issue 0008598.