Open JenusL opened 5 months ago
FYI, recent Imath ships with its own CMake config files which should already take care of adding the IMATH_DLL
compile definition to the imported Imath::Imath
target. E.g. on MinGW I have this in lib/cmake/Imath/ImathTargets.cmake
:
set_target_properties(Imath::Imath PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "IMATH_DLL"
INTERFACE_COMPILE_FEATURES "cxx_std_11"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "Imath::ImathConfig;m"
)
So this could be MSVC specific, as there is no intervention needed to build OCIO w/ shared Imath on MinGW.
Hi! When building OCIO with shared libs on windows it fails to link correctly with Imath. I get the following when building with Imath 3.1.10, OpenExr 3.2.1 and OpenColorIO 2.3.2
This seem to be a common issue with Imath and I think the solution is to define IMATH_DLL when needed, but I'm not sure where or with what logic it should be defined, but I guess only when building shared on Windows. In my test to see if I could work around it I just added the define to FindImath.cmake and then it builds correctly. More info in this Imath ticket https://github.com/AcademySoftwareFoundation/Imath/issues/212#issuecomment-1502764231