Skip to content

System OpenEXR detection broken in Linux #16293

@h6197627

Description

@h6197627

After committing 2e20f06 system OpenEXR library detection is broken in Linux.
First:

    SET(LIBRARY_SUFFIXES
        "-${OPENEXR_VERSION}"
        "-${OPENEXR_VERSION}_s"
        "-${OPENEXR_VERSION}_d"
        "-${OPEXEXR_VERSION}_s_d"
        ""
        "_s"
        "_d"
        "_s_d")

    FOREACH(LIBRARY_SUFFIX ${LIBRARY_SUFFIXES})

ignores empty suffix ("") while iterating in FOREACH loop. On Ubuntu 18.04 default libraries installed from apt-get do not have any suffixes.

Second:
In function

MACRO(FIND_OPENEXR_LIBRARY LIBRARY_NAME LIBRARY_SUFFIX)
    string(TOUPPER "${LIBRARY_NAME}" LIBRARY_NAME_UPPER)
    FIND_LIBRARY(OPENEXR_${LIBRARY_NAME_UPPER}_LIBRARY
        NAMES ${LIBRARY_NAME}${LIBRARY_SUFFIX}
        PATH_SUFFIXES ${OPENEXR_LIBSEARCH_SUFFIXES}
        NO_DEFAULT_PATH
        PATHS "${SEARCH_PATH}/lib" "${SEARCH_PATH}/lib/static")
ENDMACRO()

NO_DEFAULT_PATH is passed, so libraries are not searched in default Linux directories like x86_64-linux-gnu or i386-linux-gnu. Though it can be fixed by providing search path suffixes as for Windows build.

System information (version)
  • OpenCV => 4.2.0
  • Operating System / Platform => Ubuntu 18.04
  • Compiler => gcc 7.4.0

I will do PR with fixes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions