mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
CMake: Update OpenEXR package handling to use new targets
This commit is contained in:
parent
e8f3565af2
commit
6ea1e8d65c
@ -1,88 +0,0 @@
|
|||||||
# Filename: FindOpenEXR.cmake
|
|
||||||
# Authors: CFSworks (5 Nov, 2018)
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# find_package(OpenEXR [REQUIRED] [QUIET])
|
|
||||||
#
|
|
||||||
# Once done this will define:
|
|
||||||
# OPENEXR_FOUND - system has OpenEXR
|
|
||||||
# OPENEXR_INCLUDE_DIR - the include directory containing OpenEXR header files
|
|
||||||
# OPENEXR_LIBRARIES - the path to the OpenEXR libraries
|
|
||||||
#
|
|
||||||
|
|
||||||
find_path(OPENEXR_INCLUDE_DIR
|
|
||||||
"ImfVersion.h"
|
|
||||||
PATH_SUFFIXES "OpenEXR")
|
|
||||||
|
|
||||||
mark_as_advanced(OPENEXR_INCLUDE_DIR)
|
|
||||||
|
|
||||||
find_library(OPENEXR_imf_LIBRARY
|
|
||||||
NAMES "IlmImf")
|
|
||||||
|
|
||||||
if(OPENEXR_imf_LIBRARY)
|
|
||||||
get_filename_component(_imf_dir "${OPENEXR_imf_LIBRARY}" DIRECTORY)
|
|
||||||
find_library(OPENEXR_imfutil_LIBRARY
|
|
||||||
NAMES "IlmImfUtil"
|
|
||||||
PATHS "${_imf_dir}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
find_library(OPENEXR_ilmthread_LIBRARY
|
|
||||||
NAMES "IlmThread"
|
|
||||||
PATHS "${_imf_dir}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
find_library(OPENEXR_iex_LIBRARY
|
|
||||||
NAMES "Iex"
|
|
||||||
PATHS "${_imf_dir}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
find_library(OPENEXR_iexmath_LIBRARY
|
|
||||||
NAMES "IexMath"
|
|
||||||
PATHS "${_imf_dir}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
find_library(OPENEXR_imath_LIBRARY
|
|
||||||
NAMES "Imath"
|
|
||||||
PATHS "${_imf_dir}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
find_library(OPENEXR_half_LIBRARY
|
|
||||||
NAMES "Half"
|
|
||||||
PATHS "${_imf_dir}"
|
|
||||||
NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
unset(_imf_dir)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mark_as_advanced(
|
|
||||||
OPENEXR_imf_LIBRARY
|
|
||||||
OPENEXR_imfutil_LIBRARY
|
|
||||||
OPENEXR_ilmthread_LIBRARY
|
|
||||||
OPENEXR_iex_LIBRARY
|
|
||||||
OPENEXR_iexmath_LIBRARY
|
|
||||||
OPENEXR_imath_LIBRARY
|
|
||||||
OPENEXR_half_LIBRARY
|
|
||||||
)
|
|
||||||
|
|
||||||
set(OPENEXR_LIBRARIES
|
|
||||||
${OPENEXR_imf_LIBRARY}
|
|
||||||
${OPENEXR_imfutil_LIBRARY}
|
|
||||||
${OPENEXR_ilmthread_LIBRARY}
|
|
||||||
${OPENEXR_iex_LIBRARY}
|
|
||||||
${OPENEXR_iexmath_LIBRARY}
|
|
||||||
${OPENEXR_imath_LIBRARY}
|
|
||||||
${OPENEXR_half_LIBRARY}
|
|
||||||
)
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
find_package_handle_standard_args(OpenEXR DEFAULT_MSG
|
|
||||||
OPENEXR_INCLUDE_DIR OPENEXR_LIBRARIES
|
|
||||||
|
|
||||||
OPENEXR_imf_LIBRARY
|
|
||||||
OPENEXR_imfutil_LIBRARY
|
|
||||||
OPENEXR_ilmthread_LIBRARY
|
|
||||||
OPENEXR_iex_LIBRARY
|
|
||||||
OPENEXR_iexmath_LIBRARY
|
|
||||||
OPENEXR_imath_LIBRARY
|
|
||||||
OPENEXR_half_LIBRARY
|
|
||||||
)
|
|
@ -377,9 +377,17 @@ package_option(TIFF "Enable support for loading .tif images.")
|
|||||||
package_status(TIFF "libtiff")
|
package_status(TIFF "libtiff")
|
||||||
|
|
||||||
# OpenEXR
|
# OpenEXR
|
||||||
find_package(OpenEXR QUIET MODULE)
|
find_package(OpenEXR QUIET)
|
||||||
|
|
||||||
package_option(OpenEXR "Enable support for loading .exr images.")
|
if (TARGET OpenEXR::IlmImf AND NOT TARGET OpenEXR::OpenEXR)
|
||||||
|
package_option(OpenEXR
|
||||||
|
"Enable support for loading .exr images."
|
||||||
|
IMPORTED_AS OpenEXR::IlmImf)
|
||||||
|
else()
|
||||||
|
package_option(OpenEXR
|
||||||
|
"Enable support for loading .exr images."
|
||||||
|
IMPORTED_AS OpenEXR::OpenEXR)
|
||||||
|
endif()
|
||||||
|
|
||||||
package_status(OpenEXR "OpenEXR")
|
package_status(OpenEXR "OpenEXR")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user