Finally managed to switch to all static for OpenEXR

This commit is contained in:
Olivier Prat 2019-03-28 10:58:58 +01:00
parent eb0e1d5f93
commit c480f36dd4
2 changed files with 7 additions and 10 deletions

View file

@ -41,8 +41,8 @@ macro(TARGET_OPENEXR)
# using both versioned and unversioned names.
find_library(OPENEXR_${OPENEXR_LIB}_LIBRARY_RELEASE
NAMES
${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}
${OPENEXR_LIB}
${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}_s
${OPENEXR_LIB}_s
PATHS ${VCPKG_INSTALL_ROOT}/lib NO_DEFAULT_PATH
)
@ -56,8 +56,8 @@ macro(TARGET_OPENEXR)
# using both versioned and unversioned names.
find_library(OPENEXR_${OPENEXR_LIB}_LIBRARY_DEBUG
NAMES
${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}_d
${OPENEXR_LIB}_d
${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}_s_d
${OPENEXR_LIB}_s_d
PATHS ${VCPKG_INSTALL_ROOT}/debug/lib NO_DEFAULT_PATH
)
@ -68,8 +68,5 @@ macro(TARGET_OPENEXR)
endforeach(OPENEXR_LIB)
target_link_libraries(${TARGET_NAME} ${OPENEXR_LIBRARIES})
if (WIN32)
target_compile_definitions(${TARGET_NAME} PUBLIC OPENEXR_DLL)
endif(WIN32)
endif()
endmacro()

View file

@ -12,8 +12,8 @@ vcpkg_from_github(
PATCHES "fix_install_ilmimf.patch"
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" OPENEXR_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" OPENEXR_SHARED)
set(OPENEXR_STATIC ON)
set(OPENEXR_SHARED OFF)
vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
@ -58,7 +58,7 @@ file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/exrstdattr${EXECUTABLE_SUFFIX})
vcpkg_copy_pdbs()
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
if (OPENEXR_STATIC)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()