Skip to content

Commit

Permalink
Added DCMTK port (microsoft#3491)
Browse files Browse the repository at this point in the history
* added dcmtk port

* [dcmtk] Cleanup and use vcpkg_from_github()
  • Loading branch information
sarthakpati authored and Kwizatz committed Aug 26, 2018
1 parent 778bf47 commit 8e7f4cd
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ports/dcmtk/CONTROL
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Source: dcmtk
Version: 3.6.3
Description: This DICOM ToolKit (DCMTK) package consists of source code, documentation and installation instructions for a set of software libraries and applications implementing part of the DICOM/MEDICOM Standard.
15 changes: 15 additions & 0 deletions ports/dcmtk/dcmtk.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git "a/CMake/dcmtkPrepare.cmake" "b/CMake/dcmtkPrepare.cmake"
--- a/CMake/dcmtkPrepare.cmake 2018-02-05 12:58:13.000000000 -0500
+++ b/CMake/dcmtkPrepare.cmake 2018-04-25 15:07:12.927851000 -0400
@@ -192,9 +192,9 @@
# CMake's files (DCMTKTarget.cmake, DCMTKConfigVersion.cmake and DCMTKConfig.cmake) are installed
# to different installation paths under Unix- and Windows-based systems
IF(UNIX)
- SET(DCMTK_INSTALL_CMKDIR "${CMAKE_INSTALL_LIBDIR}/cmake/dcmtk")
+ SET(DCMTK_INSTALL_CMKDIR "share/dcmtk")
ELSEIF(WIN32)
- SET(DCMTK_INSTALL_CMKDIR "cmake")
+ SET(DCMTK_INSTALL_CMKDIR "share/dcmtk")
ENDIF(UNIX)

#-----------------------------------------------------------------------------
49 changes: 49 additions & 0 deletions ports/dcmtk/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
include(vcpkg_common_functions)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
message("DCMTK only supports static library linkage")
set(VCPKG_LIBRARY_LINKAGE static)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO DCMTK/dcmtk
REF DCMTK-3.6.3
SHA512 5863d0c05f046075b998bced7c8c71bf8e969dd366f26d48cdf26012ea744ae4a22784a5c3c12e12b0f188e997c93a6890ef0c3c336865ea93f13c45f70b258d
HEAD_REF master
PATCHES ${CMAKE_CURRENT_LIST_DIR}/dcmtk.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DDCMTK_WITH_DOXYGEN=OFF
-DDCMTK_WITH_ZLIB=OFF
-DDCMTK_WITH_OPENSSL=OFF
-DDCMTK_WITH_PNG=OFF
-DDCMTK_WITH_TIFF=OFF
-DDCMTK_WITH_XML=OFF
-DDCMTK_WITH_ICONV=OFF
-DDCMTK_FORCE_FPIC_ON_UNIX=ON
-DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS=OFF
-DDCMTK_ENABLE_BUILTIN_DICTIONARY=ON
-DDCMTK_ENABLE_PRIVATE_TAGS=ON
-DBUILD_APPS=OFF
-DDCMTK_ENABLE_CXX11=ON
-DCMAKE_DEBUG_POSTFIX="d"
OPTIONS_DEBUG
-DINSTALL_HEADERS=OFF
-DINSTALL_OTHER=OFF
)

vcpkg_install_cmake()
vcpkg_copy_pdbs()

vcpkg_fixup_cmake_targets()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/dcmtk RENAME copyright)

0 comments on commit 8e7f4cd

Please sign in to comment.