diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a32742daf9c..b08ee065e1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -522,17 +522,23 @@ if(UNIX AND NOT APPLE) endif() if(WITH_OPENIMAGEIO) + + # temp, update if(CYCLES_OIIO) - set(OPENIMAGEIO ${CYCLES_OIIO} CACHE PATH "OpenImageIO Directory") + set(OPENIMAGEIO_ROOT_DIR ${CYCLES_OIIO}) unset(CYCLES_OIIO CACHE) - else() - set(OPENIMAGEIO "/usr" CACHE PATH "OpenImageIO Directory") endif() - set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO}/include) - set(OPENIMAGEIO_LIBRARY OpenImageIO ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES}) - set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib) + find_package(OpenImageIO) + + set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES}) + set(OPENIMAGEIO_LIBPATH) # TODO, remove and reference the absolute path everywhere set(OPENIMAGEIO_DEFINITIONS) + + if(NOT OPENIMAGEIO_FOUND) + set(WITH_OPENIMAGEIO OFF) + endif() + endif() # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed @@ -843,10 +849,10 @@ elseif(WIN32) endif() if(WITH_OPENIMAGEIO) - set(OPENIMAGEIO ${LIBDIR}/openimageio) - set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO}/include) - set(OPENIMAGEIO_LIBRARY OpenImageIO) - set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib) + set(OPENIMAGEIO_ROOT_DIR ${LIBDIR}/openimageio) + set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_ROOT_DIR}/include) + set(OPENIMAGEIO_LIBRARIES OpenImageIO) + set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO_ROOT_DIR}/lib) set(OPENIMAGEIO_DEFINITIONS) endif() @@ -978,10 +984,10 @@ elseif(WIN32) endif() if(WITH_OPENIMAGEIO) - set(OPENIMAGEIO ${LIBDIR}/openimageio) - set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO}/include) - set(OPENIMAGEIO_LIBRARY OpenImageIO) - set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib) + set(OPENIMAGEIO_ROOT_DIR ${LIBDIR}/openimageio) + set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_ROOT_DIR}/include) + set(OPENIMAGEIO_LIBRARIES OpenImageIO) + set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO_ROOT_DIR}/lib) set(OPENIMAGEIO_DEFINITIONS) endif() @@ -1205,9 +1211,9 @@ elseif(APPLE) if(WITH_OPENIMAGEIO) set(OPENIMAGEIO ${LIBDIR}/openimageio) - set(OPENIMAGEIO_INCLUDE_DIR ${OPENIMAGEIO}/include) - set(OPENIMAGEIO_LIBRARY OpenImageIO ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES}) - set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib ${JPEG_LIBPATH} ${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH}) + set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_ROOT_DIR}/include) + set(OPENIMAGEIO_LIBRARIES OpenImageIO ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES}) + set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO_ROOT_DIR}/lib ${JPEG_LIBPATH} ${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH}) set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD") endif() @@ -1529,6 +1535,7 @@ if(FIRST_RUN) info_cfg_option(WITH_IMAGE_OPENJPEG) info_cfg_option(WITH_IMAGE_REDCODE) info_cfg_option(WITH_IMAGE_TIFF) + info_cfg_option(WITH_OPENIMAGEIO) info_cfg_text("Audio:") info_cfg_option(WITH_OPENAL) |