From 1eb2df5aa219a819153bb891dc4488875259fb28 Mon Sep 17 00:00:00 2001 From: Kimball Thurston Date: Thu, 7 Nov 2019 21:06:01 +1300 Subject: [PATCH] Fix issue with defines not being set correctly for win32 we always build shared libraries now, so even if the default is to build static, the python bindings are forced to build shared, which means they need to set the defines to export the symbols appropriately, add extra variable set Signed-off-by: Kimball Thurston --- PyIlmBase/config/ModuleDefine.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/PyIlmBase/config/ModuleDefine.cmake b/PyIlmBase/config/ModuleDefine.cmake index 57e2eaf1e7..a127ecba1d 100644 --- a/PyIlmBase/config/ModuleDefine.cmake +++ b/PyIlmBase/config/ModuleDefine.cmake @@ -23,19 +23,21 @@ function(PYILMBASE_ADD_LIBRARY_PRIV libname) OUTPUT_NAME "${PYILMBASE_CURLIB_OUTROOT}${libname}${PYILMBASE_LIB_SUFFIX}" ) target_compile_features(${libname} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD}) - if(PYILMBASE_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS) + # we are always building shared, so don't check for that + if(PYILMBASE_CURLIB_PRIV_EXPORT) target_compile_definitions(${libname} PRIVATE ${PYILMBASE_CURLIB_PRIV_EXPORT}) - if(WIN32) - target_compile_definitions(${libname} PUBLIC OPENEXR_DLL) - endif() endif() + target_compile_definitions(${libname} PUBLIC OPENEXR_DLL) + if(PYILMBASE_CURLIB_CURDIR) target_include_directories(${libname} PUBLIC $) endif() if(PYILMBASE_CURLIB_CURBINDIR) target_include_directories(${libname} PRIVATE $) endif() - target_include_directories(${libname} PUBLIC ${Boost_INCLUDE_DIR}) + if(Boost_INCLUDE_DIR) + target_include_directories(${libname} PUBLIC ${Boost_INCLUDE_DIR}) + endif() target_link_libraries(${libname} PUBLIC ${PYILMBASE_CURLIB_DEPENDENCIES}) if(PYILMBASE_CURLIB_PRIVATE_DEPS) target_link_libraries(${libname} PRIVATE ${PYILMBASE_CURLIB_PRIVATE_DEPS})