aboutsummaryrefslogtreecommitdiff
path: root/ports/gdcm2/find-openjpeg.patch
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2018-12-13 11:13:43 -0800
committerPhil Christensen <philc@microsoft.com>2018-12-13 11:13:43 -0800
commit5fc3a10651dc80201b4a870043a0cef6b3c72ff3 (patch)
tree22a3a9073a29a555540539f1c5f6c0f5360b506d /ports/gdcm2/find-openjpeg.patch
parent9e773bd912e42a413f87e9fb1a6712461e10c4bf (diff)
parente04b4ed5b5ff5c1b61e5ce3d70ac101ffe3237c4 (diff)
downloadvcpkg-5fc3a10651dc80201b4a870043a0cef6b3c72ff3.tar.gz
vcpkg-5fc3a10651dc80201b4a870043a0cef6b3c72ff3.zip
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/4914
Diffstat (limited to 'ports/gdcm2/find-openjpeg.patch')
-rw-r--r--ports/gdcm2/find-openjpeg.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/ports/gdcm2/find-openjpeg.patch b/ports/gdcm2/find-openjpeg.patch
new file mode 100644
index 000000000..c3fff18f5
--- /dev/null
+++ b/ports/gdcm2/find-openjpeg.patch
@@ -0,0 +1,48 @@
+--- a/CMake/FindOpenJPEG.cmake
++++ b/CMake/FindOpenJPEG.cmake
+@@ -20,14 +20,38 @@
+
+ # Try with pkg-config first
+ find_package(PkgConfig)
+-pkg_check_modules(OPENJPEG libopenjp2)
++if (PKG_CONFIG_FOUND)
++ pkg_check_modules(OPENJPEG libopenjp2)
++ include(FindPackageHandleStandardArgs)
++ find_package_handle_standard_args(OpenJPEG REQUIRED_VARS
++ OPENJPEG_LIBRARIES
++ OPENJPEG_INCLUDE_DIRS
++ VERSION_VAR OPENJPEG_VERSION
++ )
++endif()
+
+-include(FindPackageHandleStandardArgs)
+-find_package_handle_standard_args(OpenJPEG REQUIRED_VARS
+- OPENJPEG_LIBRARIES
+- OPENJPEG_INCLUDE_DIRS
+- VERSION_VAR OPENJPEG_VERSION
+-)
++find_path(OPENJPEG_INCLUDE_DIR NAMES openjpeg.h)
++find_library(OPENJPEG_LIBRARY NAMES openjp2)
++if (OPENJPEG_LIBRARY)
++ string(FIND ${OPENJPEG_LIBRARY} debug _debug_substrpos)
++ if (_debug_substrpos EQUAL -1)
++ set(OPENJPEG_LIBRARY_RELEASE ${OPENJPEG_LIBRARY})
++ string(REPLACE "/lib" "/debug/lib" OPENJPEG_LIBRARY_DEBUG ${OPENJPEG_LIBRARY_RELEASE})
++ else()
++ set(OPENJPEG_LIBRARY_DEBUG ${OPENJPEG_LIBRARY})
++ string(REPLACE "/debug/lib" "/lib" OPENJPEG_LIBRARY_RELEASE ${OPENJPEG_LIBRARY_DEBUG})
++ endif()
++ set(OPENJPEG_LIBRARY optimized ${OPENJPEG_LIBRARY_RELEASE} debug ${OPENJPEG_LIBRARY_DEBUG})
++ set(OPENJPEG_FOUND TRUE)
++endif()
++
++if (OPENJPEG_FOUND)
++ set(OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY})
++ set(OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR})
++ message(STATUS "Found OPENJPEG library ${OPENJPEG_LIBRARIES}")
++else()
++ message(FATAL_ERROR "NOT found OPENJPEG")
++endif()
+
+ mark_as_advanced(
+ OPENJPEG_LIBRARIES