MantisBT - CMake
View Issue Details
0007827CMakeModulespublic2008-10-18 11:082016-06-10 14:30
Boris Dušek 
Bill Hoffman 
normalminoralways
closedmoved 
CMake-2-6 
 
0007827: FindEXPAT finds expat.h in /Library/Frameworks/Mono.framework/Headers instead of /usr/include on Mac OS X.
Hi,

title pretty says it all - when using find_package(EXPAT REQUIRED), ${EXPAT_INCLUDE_DIRS} gets set to /Library/Frameworks/Mono.framework/Headers even though the header expat.h is clearly in /usr/include as well.

I looked at FindEXPAT, EXPAT_INCLUDE_DIRS is set by FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h) ... SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR}).

Reading the documentation for find_path, I concluded that the reason for this undesirable behavior happening is that CMAKE_FIND_FRAMEWORK is set to "FIRST" by default, so frameworks on OS X are searched before /usr/include. So even though Mono.framework ships expat.h as a "side effect" to support its own headers, it gets searched first.

I really don't know what to think about this, since CMake behaves correctly, and Mono also neads this header for its own ones. I vaugely remember that there might be something like Private Headers or Private Frameworks where it would be more appropriate for Mono to put the headers of 3rdpatry libraries like expat, but I am not sure about this.
No tags attached.
Issue History
2008-10-18 11:08Boris DušekNew Issue
2008-10-18 11:33Boris DušekNote Added: 0013898
2008-10-27 13:46Bill HoffmanStatusnew => assigned
2008-10-27 13:46Bill HoffmanAssigned To => Bill Hoffman
2009-01-10 09:29Alex NeundorfCategoryCMake => Modules
2016-06-10 14:27Kitware RobotNote Added: 0041454
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:30Kitware RobotStatusresolved => closed

Notes
(0013898)
Boris Dušek   
2008-10-18 11:33   
set(CMAKE_FIND_FRAMEWORK LAST) before find_package(EXPAT) is a working workaround.
(0041454)
Kitware Robot   
2016-06-10 14:27   
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.