[Bf-blender-cvs] [ec81fea] master: CMake: Fix libname handling of OpenEXR 2.1. The library built with Autotools was not found.
IRIE Shinsuke
noreply at git.blender.org
Tue Jan 14 20:43:36 CET 2014
Commit: ec81feab6649c70e43cfab4e8bda268815b8af2b
Author: IRIE Shinsuke
Date: Wed Jan 15 04:36:53 2014 +0900
https://developer.blender.org/rBec81feab6649c70e43cfab4e8bda268815b8af2b
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.
===================================================================
M build_files/cmake/Modules/FindOpenEXR.cmake
===================================================================
diff --git a/build_files/cmake/Modules/FindOpenEXR.cmake b/build_files/cmake/Modules/FindOpenEXR.cmake
index 166ef05..79997cf 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)
More information about the Bf-blender-cvs
mailing list