diff options
author | IRIE Shinsuke <irieshinsuke@yahoo.co.jp> | 2014-01-14 23:36:53 +0400 |
---|---|---|
committer | IRIE Shinsuke <irieshinsuke@yahoo.co.jp> | 2014-01-14 23:43:31 +0400 |
commit | ec81feab6649c70e43cfab4e8bda268815b8af2b (patch) | |
tree | d4ee82df18fe93a3ddcbd1e6bb90fce3612eaa5a | |
parent | 9351ac0d8577a2c76c238bbf2c365d811e986209 (diff) |
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.
-rw-r--r-- | build_files/cmake/Modules/FindOpenEXR.cmake | 31 |
1 files changed, 12 insertions, 19 deletions
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) |