diff options
| author | James Chang <twmr7@outlook.com> | 2018-12-12 02:01:05 +0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-12-11 10:01:05 -0800 |
| commit | 9b8cc8095323a550ecd7a184881bd5802b5a313f (patch) | |
| tree | 2e44c1b53a7b8c1483e97c9d4af96679705c27e0 | |
| parent | 5295c8fdeb8fd2332bfce7a897465fdf9391d99a (diff) | |
| download | vcpkg-9b8cc8095323a550ecd7a184881bd5802b5a313f.tar.gz vcpkg-9b8cc8095323a550ecd7a184881bd5802b5a313f.zip | |
[gdcm2] fix improper cmake file setup (#4880)
* move cmake files to proper location, and modify path in contents accordingly
* workaround cmake script to find openjpeg package, and include openjpeg in Build-Depends list
* [gdcm2] Use vcpkg_fixup_cmake_targets()
| -rw-r--r-- | ports/gdcm2/CONTROL | 4 | ||||
| -rw-r--r-- | ports/gdcm2/find-openjpeg.patch | 48 | ||||
| -rw-r--r-- | ports/gdcm2/portfile.cmake | 10 | ||||
| -rw-r--r-- | ports/gdcm2/socketxx.patch | 11 |
4 files changed, 57 insertions, 16 deletions
diff --git a/ports/gdcm2/CONTROL b/ports/gdcm2/CONTROL index d3ff62aa7..a3a083ed8 100644 --- a/ports/gdcm2/CONTROL +++ b/ports/gdcm2/CONTROL @@ -1,4 +1,4 @@ Source: gdcm2 -Version: 2.8.8 +Version: 2.8.8-2 Description: Grassroots DICOM library -Build-Depends: zlib, expat +Build-Depends: zlib, expat, openjpeg 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 diff --git a/ports/gdcm2/portfile.cmake b/ports/gdcm2/portfile.cmake index 3bddfeff6..a6aad4e11 100644 --- a/ports/gdcm2/portfile.cmake +++ b/ports/gdcm2/portfile.cmake @@ -4,7 +4,8 @@ vcpkg_from_github( REPO malaterre/GDCM REF v2.8.8 SHA512 92efa1b85e38a5e463933c36a275e1392608c9da4d7c3ab17acfa70bfa112bc03e8705086eaac4a3ad5153fde5116ccc038093adaa8598b18000f403f39db738 - PATCHES socketxx.patch + HEAD_REF master + PATCHES find-openjpeg.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -22,17 +23,20 @@ vcpkg_configure_cmake( -DGDCM_INSTALL_INCLUDE_DIR=include -DGDCM_USE_SYSTEM_EXPAT=ON -DGDCM_USE_SYSTEM_ZLIB=ON - ${ADDITIONAL_OPTIONS} + -DGDCM_USE_SYSTEM_OPENJPEG=ON + -DGDCM_BUILD_TESTING=OFF ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/gdcm-2.8 TARGET_PATH share/gdcm) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() diff --git a/ports/gdcm2/socketxx.patch b/ports/gdcm2/socketxx.patch deleted file mode 100644 index 0142910b1..000000000 --- a/ports/gdcm2/socketxx.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Utilities/socketxx/socket++/CMakeLists.txt -+++ b/Utilities/socketxx/socket++/CMakeLists.txt -@@ -76,7 +76,7 @@ - endif() - set_target_properties(${SOCKETXX_LIBRARY_NAME} PROPERTIES ${SOCKETXX_LIBRARY_PROPERTIES}) - if(BUILD_SHARED_LIBS) -- set_target_properties(${SOCKETXX_LIBRARY_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES "" LINK_INTERFACE_LIBRARIES "") -+ set_target_properties(${SOCKETXX_LIBRARY_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES "") - endif() - - # Install library |
