From ec81feab6649c70e43cfab4e8bda268815b8af2b Mon Sep 17 00:00:00 2001 From: IRIE Shinsuke Date: Wed, 15 Jan 2014 04:36:53 +0900 Subject: CMake: Fix libname handling of OpenEXR 2.1. The library built with Autotools was not found. Weird library names having version suffix (e.g. libIex-2_1.so) are used only when the OpenEXR was built with CMake. Building the library with the Autotools doesn't add the version suffix. --- build_files/cmake/Modules/FindOpenEXR.cmake | 31 +++++++++++------------------ 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'build_files/cmake/Modules/FindOpenEXR.cmake') diff --git a/build_files/cmake/Modules/FindOpenEXR.cmake b/build_files/cmake/Modules/FindOpenEXR.cmake index 166ef052076..79997cf63e2 100644 --- a/build_files/cmake/Modules/FindOpenEXR.cmake +++ b/build_files/cmake/Modules/FindOpenEXR.cmake @@ -34,6 +34,14 @@ IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "") SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR}) ENDIF() +SET(_openexr_FIND_COMPONENTS + Half + Iex + IlmImf + IlmThread + Imath +) + SET(_openexr_SEARCH_DIRS ${OPENEXR_ROOT_DIR} /usr/local @@ -87,24 +95,7 @@ IF(OPENEXR_INCLUDE_DIR) ENDIF() ENDIF() -IF(${OPENEXR_VERSION} VERSION_LESS "2.1") - SET(_openexr_FIND_COMPONENTS - Half - Iex - IlmImf - IlmThread - Imath - ) -ELSE() - STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION}) - SET(_openexr_FIND_COMPONENTS - Half - Iex-${_openexr_libs_ver} - IlmImf-${_openexr_libs_ver} - IlmThread-${_openexr_libs_ver} - Imath-${_openexr_libs_ver} - ) -ENDIF() +STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION}) SET(_openexr_LIBRARIES) FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS}) @@ -112,7 +103,7 @@ FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS}) FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY NAMES - ${COMPONENT} + ${COMPONENT} ${COMPONENT}-${_openexr_libs_ver} HINTS ${_openexr_SEARCH_DIRS} PATH_SUFFIXES @@ -121,6 +112,8 @@ FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS}) LIST(APPEND _openexr_LIBRARIES "${OPENEXR_${UPPERCOMPONENT}_LIBRARY}") ENDFOREACH() +UNSET(_openexr_libs_ver) + # handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) -- cgit v1.2.3