Skip to content

Commit

Permalink
Adsk Contrib - Remove the useless cmake target on oiiotool (AcademySo…
Browse files Browse the repository at this point in the history
…ftwareFoundation#1477)

* Adsk Contrib - REmove the useless cmake target on oiiotool

Signed-off-by: Patrick Hodoul <[email protected]>

* Improve the OIIO Util library support

Signed-off-by: hodoulp <[email protected]>
  • Loading branch information
hodoulp authored Sep 16, 2021
1 parent 7d704f6 commit 9bc9711
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions share/cmake/modules/FindOpenImageIO.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ if (OpenImageIO_FOUND)
message ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDE_DIR}" )
message ( STATUS "OpenImageIO libraries = ${OPENIMAGEIO_LIBRARIES}" )
message ( STATUS "OpenImageIO library_dirs = ${OPENIMAGEIO_LIBRARY_DIRS}" )
message ( STATUS "OpenImageIO oiiotool = ${OIIOTOOL_BIN}" )
endif ()

if (NOT TARGET OpenImageIO::OpenImageIO)
Expand All @@ -118,18 +117,14 @@ if (OpenImageIO_FOUND)
IMPORTED_LOCATION "${OPENIMAGEIO_LIBRARIES}")
endif ()

if (NOT TARGET OpenImageIO::OpenImageIO_Util AND EXISTS "${OPENIMAGEIO_UTIL_LIBRARY}")
# Starting with OIIO v2.3, some utility classes are now only declared in OpenImageIO_Util
# (and not in both libraries like in older versions).
if (${OPENIMAGEIO_VERSION} VERSION_GREATER_EQUAL "2.3" AND NOT TARGET OpenImageIO::OpenImageIO_Util)
add_library(OpenImageIO::OpenImageIO_Util UNKNOWN IMPORTED)
set_target_properties(OpenImageIO::OpenImageIO_Util PROPERTIES
IMPORTED_LOCATION "${OPENIMAGEIO_UTIL_LIBRARY}")
target_link_libraries(OpenImageIO::OpenImageIO INTERFACE OpenImageIO::OpenImageIO_Util)
endif ()

if (NOT TARGET OpenImageIO::oiiotool AND EXISTS "${OIIOTOOL_BIN}")
add_executable(OpenImageIO::oiiotool IMPORTED)
set_target_properties(OpenImageIO::oiiotool PROPERTIES
IMPORTED_LOCATION "${OIIOTOOL_BIN}")
endif ()
endif ()

mark_as_advanced (
Expand Down

0 comments on commit 9bc9711

Please sign in to comment.