diff --git a/src/cmake/cuda_macros.cmake b/src/cmake/cuda_macros.cmake index ca3230e48..c15aa1246 100644 --- a/src/cmake/cuda_macros.cmake +++ b/src/cmake/cuda_macros.cmake @@ -20,7 +20,7 @@ function ( NVCC_COMPILE cuda_src ptx_generated extra_nvcc_args ) "-I${PROJECT_SOURCE_DIR}/src/include" "-I${PROJECT_SOURCE_DIR}/src/cuda_common" "-I${OPENIMAGEIO_INCLUDES}" - "-I${ILMBASE_INCLUDES}" + "-I${IMATH_INCLUDES}" "-I${Boost_INCLUDE_DIRS}" "-DFMT_DEPRECATED=\"\"" ${LLVM_COMPILE_FLAGS} diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake index 12b09a393..fb659598f 100644 --- a/src/cmake/externalpackages.cmake +++ b/src/cmake/externalpackages.cmake @@ -89,6 +89,12 @@ checked_find_package (OpenEXR REQUIRED "OpenEXR 2.2 is the oldest version our CI tests against, and the minimum that supports DWA compression" PRINT IMATH_INCLUDES ) +# Force Imath includes to be before everything else to ensure that we have +# the right Imath/OpenEXR version, not some older version in the system +# library. This shoudn't be necessary, except for the common case of people +# building against Imath/OpenEXR 3.x when there is still a system-level +# install version of 2.x. +include_directories(BEFORE ${IMATH_INCLUDES}) if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3) # clang C++ >= 11 doesn't like 'register' keyword in old exr headers add_compile_options (-Wno-deprecated-register) diff --git a/src/liboslexec/CMakeLists.txt b/src/liboslexec/CMakeLists.txt index eb12231cb..79c722f41 100644 --- a/src/liboslexec/CMakeLists.txt +++ b/src/liboslexec/CMakeLists.txt @@ -187,7 +187,7 @@ target_include_directories (${local_lib} PUBLIC ${CMAKE_INSTALL_FULL_INCLUDEDIR} ${OPENIMAGEIO_INCLUDES} - ${ILMBASE_INCLUDES} + ${IMATH_INCLUDES} PRIVATE "${CMAKE_SOURCE_DIR}/src/liboslcomp" ) diff --git a/src/liboslquery/CMakeLists.txt b/src/liboslquery/CMakeLists.txt index d94ff69fe..ee9959bb7 100644 --- a/src/liboslquery/CMakeLists.txt +++ b/src/liboslquery/CMakeLists.txt @@ -13,12 +13,12 @@ target_include_directories (${local_lib} PUBLIC ${CMAKE_INSTALL_FULL_INCLUDEDIR} ${OPENIMAGEIO_INCLUDES} - ${ILMBASE_INCLUDES} + ${IMATH_INCLUDES} PRIVATE ../liboslexec) target_link_libraries (${local_lib} PUBLIC - ${OPENIMAGEIO_LIBRARIES} ${ILMBASE_LIBRARIES} + ${OPENIMAGEIO_LIBRARIES} ${IMATH_LIBRARIES} PRIVATE ${Boost_LIBRARIES} )