This patch changes the default location that the header files look for IlmBaseConfig.h as in Gentoo the version containg the ILMBASE_VERSION_MAJOR and ILMBASE_VERSION_MINOR is stored under /usr/include/chost. Without this patch, compilation fails as it is unable to identify the required IlmBase version. Based on the fix multilib header patch for 7.1.0 by Bernd Waibel diff -Naur a/cmake/FindIlmBase.cmake b/cmake/FindIlmBase.cmake --- a/cmake/FindIlmBase.cmake 2020-02-02 01:03:55.000000000 +0800 +++ b/cmake/FindIlmBase.cmake 2020-02-02 01:09:05.000000000 +0800 @@ -168,9 +168,15 @@ PATH_SUFFIXES include/OpenEXR OpenEXR ) +if(EXISTS "/usr/include/${CHOST}/OpenEXR/IlmBaseConfig.h") + set(_ILMBASE_HEADERS "/usr/include/${CHOST}/OpenEXR") +else() + set(_ILMBASE_HEADERS ${IlmBase_INCLUDE_DIR}) +endif() + if(EXISTS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h") # Get the ILMBASE version information from the config header - file(STRINGS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h" + file(STRINGS "${_ILMBASE_HEADERS}/IlmBaseConfig.h" _ilmbase_version_major_string REGEX "#define ILMBASE_VERSION_MAJOR " ) string(REGEX REPLACE "#define ILMBASE_VERSION_MAJOR" "" @@ -178,7 +184,7 @@ ) string(STRIP "${_ilmbase_version_major_string}" IlmBase_VERSION_MAJOR) - file(STRINGS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h" + file(STRINGS "${_ILMBASE_HEADERS}/IlmBaseConfig.h" _ilmbase_version_minor_string REGEX "#define ILMBASE_VERSION_MINOR " ) string(REGEX REPLACE "#define ILMBASE_VERSION_MINOR" ""