diff options
| -rw-r--r-- | ports/openjpeg/CONTROL | 2 | ||||
| -rw-r--r-- | ports/openjpeg/portfile.cmake | 15 |
2 files changed, 11 insertions, 6 deletions
diff --git a/ports/openjpeg/CONTROL b/ports/openjpeg/CONTROL index cd2f0aaa8..15a56452e 100644 --- a/ports/openjpeg/CONTROL +++ b/ports/openjpeg/CONTROL @@ -1,3 +1,3 @@ Source: openjpeg -Version: 2.1.2-1 +Version: 2.1.2-2 Description: JPEG 2000 image library diff --git a/ports/openjpeg/portfile.cmake b/ports/openjpeg/portfile.cmake index f48395997..769f1410e 100644 --- a/ports/openjpeg/portfile.cmake +++ b/ports/openjpeg/portfile.cmake @@ -18,11 +18,16 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -# Handle debug cmake config files (see https://github.com/Microsoft/vcpkg/issues/77) -file(READ ${CURRENT_PACKAGES_DIR}/debug/share/openjpeg/OpenJPEGTargets-debug.cmake OPENJPEG_DEBUG_MODULE) -string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" OPENJPEG_DEBUG_MODULE "${OPENJPEG_DEBUG_MODULE}") -file(WRITE ${CURRENT_PACKAGES_DIR}/share/openjpeg/OpenJPEGTargets-debug.cmake "${OPENJPEG_DEBUG_MODULE}") -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +vcpkg_fixup_cmake_targets() + +file(READ ${CURRENT_PACKAGES_DIR}/include/openjpeg-2.1/openjpeg.h OPENJPEG_H) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined(OPJ_STATIC)" "1" OPENJPEG_H "${OPENJPEG_H}") +else() + string(REPLACE "defined(OPJ_STATIC)" "0" OPENJPEG_H "${OPENJPEG_H}") +endif() +string(REPLACE "defined(DLL_EXPORT)" "0" OPENJPEG_H "${OPENJPEG_H}") +file(WRITE ${CURRENT_PACKAGES_DIR}/include/openjpeg-2.1/openjpeg.h "${OPENJPEG_H}") # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openjpeg) |
