From 0b1740d11976688157be1e8262e1ab6f052c31c1 Mon Sep 17 00:00:00 2001 From: Shinya Onogi Date: Mon, 20 Mar 2017 02:10:43 +0900 Subject: [PATCH 1/3] add a new port, GDCM --- ports/gdcm2/CONTROL | 4 ++++ ports/gdcm2/gdcm-include-dir.patch | 10 +++++++++ ports/gdcm2/portfile.cmake | 34 ++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 ports/gdcm2/CONTROL create mode 100644 ports/gdcm2/gdcm-include-dir.patch create mode 100644 ports/gdcm2/portfile.cmake diff --git a/ports/gdcm2/CONTROL b/ports/gdcm2/CONTROL new file mode 100644 index 00000000000..b77ad34e606 --- /dev/null +++ b/ports/gdcm2/CONTROL @@ -0,0 +1,4 @@ +Source: gdcm2 +Version: 2.6.7 +Description: Grassroots DICOM library +Build-Depends: zlib, expat diff --git a/ports/gdcm2/gdcm-include-dir.patch b/ports/gdcm2/gdcm-include-dir.patch new file mode 100644 index 00000000000..34d574d47d9 --- /dev/null +++ b/ports/gdcm2/gdcm-include-dir.patch @@ -0,0 +1,10 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -409,6 +409,7 @@ + if(GDCM_USE_SYSTEM_ZLIB) + # If user say so, then this is a requirement ! + find_package(ZLIB REQUIRED) ++ include_directories(${ZLIB_INCLUDE_DIR}) + set(GDCM_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) + else() + set(GDCM_ZLIB_LIBRARIES "gdcmzlib") diff --git a/ports/gdcm2/portfile.cmake b/ports/gdcm2/portfile.cmake new file mode 100644 index 00000000000..851da6172f8 --- /dev/null +++ b/ports/gdcm2/portfile.cmake @@ -0,0 +1,34 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gdcm-2.6.7) +vcpkg_download_distfile(ARCHIVE + URLS "https://downloads.sourceforge.net/project/gdcm/gdcm 2.x/GDCM 2.6.7/gdcm-2.6.7.tar.gz" + FILENAME "gdcm-2.6.7.tar.gz" + SHA512 2eefad47e4d36038db8d120a91dc0a40816d045e3562c711b6dba7aec5788d4b08a00966bf4c82dc354cb1aa654bff4200afff022a42f2ab58bf7baafe69ff05 +) +vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/gdcm-include-dir.patch" +) +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + # PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS + -DGDCM_BUILD_DOCBOOK_MANPAGES=OFF + -DGDCM_BUILD_SHARED_LIBS=ON + -DGDCM_USE_SYSTEM_EXPAT=ON + -DGDCM_USE_SYSTEM_ZLIB=ON + ${ADDITIONAL_OPTIONS} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include + ${CURRENT_PACKAGES_DIR}/debug/share +) + +# Handle copyright +file(INSTALL ${SOURCE_PATH}/Copyright.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gdcm2 RENAME copyright) + +vcpkg_copy_pdbs() From 8e77d829f017652e15faee0a55b610a0159edd55 Mon Sep 17 00:00:00 2001 From: Shinya Onogi Date: Mon, 20 Mar 2017 02:37:58 +0900 Subject: [PATCH 2/3] Added: Selection of library linkage type Selection of library linkage type is added --- ports/gdcm2/portfile.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/gdcm2/portfile.cmake b/ports/gdcm2/portfile.cmake index 851da6172f8..32f2f6f3aa8 100644 --- a/ports/gdcm2/portfile.cmake +++ b/ports/gdcm2/portfile.cmake @@ -10,6 +10,11 @@ vcpkg_apply_patches( SOURCE_PATH ${SOURCE_PATH} PATCHES "${CMAKE_CURRENT_LIST_DIR}/gdcm-include-dir.patch" ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + set(GDCM_BUILD_SHARED_LIBS ON) +else() + set(GDCM_BUILD_SHARED_LIBS OFF) +endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} # PREFER_NINJA # Disable this option if project cannot be built with Ninja @@ -17,7 +22,7 @@ vcpkg_configure_cmake( -DGDCM_BUILD_DOCBOOK_MANPAGES=OFF -DGDCM_BUILD_SHARED_LIBS=ON -DGDCM_USE_SYSTEM_EXPAT=ON - -DGDCM_USE_SYSTEM_ZLIB=ON + -DGDCM_USE_SYSTEM_ZLIB=${GDCM_BUILD_SHARED_LIBS} ${ADDITIONAL_OPTIONS} ) From 33cacd658eb6e0c3e6787ce42999cb2888d04c25 Mon Sep 17 00:00:00 2001 From: Shinya Onogi Date: Mon, 20 Mar 2017 20:13:46 +0900 Subject: [PATCH 3/3] Update portfile.cmake Fixed the location of ${GDCM_BUILD_SHARED_LIBS} --- ports/gdcm2/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/gdcm2/portfile.cmake b/ports/gdcm2/portfile.cmake index 32f2f6f3aa8..74289d394a7 100644 --- a/ports/gdcm2/portfile.cmake +++ b/ports/gdcm2/portfile.cmake @@ -20,9 +20,9 @@ vcpkg_configure_cmake( # PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS -DGDCM_BUILD_DOCBOOK_MANPAGES=OFF - -DGDCM_BUILD_SHARED_LIBS=ON + -DGDCM_BUILD_SHARED_LIBS=${GDCM_BUILD_SHARED_LIBS} -DGDCM_USE_SYSTEM_EXPAT=ON - -DGDCM_USE_SYSTEM_ZLIB=${GDCM_BUILD_SHARED_LIBS} + -DGDCM_USE_SYSTEM_ZLIB=ON ${ADDITIONAL_OPTIONS} )