-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
274 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
diff --git a/CMake/3rdparty.cmake b/CMake/3rdparty.cmake | ||
index c355922..33ddc73 100644 | ||
--- a/CMake/3rdparty.cmake | ||
+++ b/CMake/3rdparty.cmake | ||
@@ -1,3 +1,11 @@ | ||
+set(CMAKE_REQUIRE_FIND_PACKAGE_Iconv "${DCMTK_WITH_ICONV}") | ||
+set(CMAKE_REQUIRE_FIND_PACKAGE_ICU "${DCMTK_WITH_ICU}") | ||
+set(CMAKE_REQUIRE_FIND_PACKAGE_LibXml2 "${DCMTK_WITH_XML}") | ||
+set(CMAKE_REQUIRE_FIND_PACKAGE_OpenSSL "${DCMTK_WITH_OPENSSL}") | ||
+set(CMAKE_REQUIRE_FIND_PACKAGE_PNG "${DCMTK_WITH_PNG}") | ||
+set(CMAKE_REQUIRE_FIND_PACKAGE_TIFF "${DCMTK_WITH_TIFF}") | ||
+set(CMAKE_REQUIRE_FIND_PACKAGE_ZLIB "${DCMTK_WITH_ZLIB}") | ||
+ | ||
set(USE_FIND_PACKAGE_DOCS "Control whether libraries are searched via CMake's find_package() mechanism or a Windows specific fallback") | ||
# Advanced user (eg. vcpkg) may want to override this: | ||
if(NOT DEFINED DCMTK_USE_FIND_PACKAGE_WIN_DEFAULT) | ||
@@ -42,7 +50,7 @@ if(DCMTK_USE_FIND_PACKAGE) | ||
message(STATUS "Info: DCMTK TIFF support will be enabled") | ||
include_directories(${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR}) | ||
endif() | ||
- set(LIBTIFF_LIBS ${TIFF_LIBRARY} ${TIFF_EXTRA_LIBS_STATIC} ${JPEG_LIBRARY}) | ||
+ set(LIBTIFF_LIBS ${TIFF_LIBRARIES}) | ||
endif() | ||
endif() | ||
|
||
@@ -57,7 +65,7 @@ if(DCMTK_USE_FIND_PACKAGE) | ||
message(STATUS "Info: DCMTK PNG support will be enabled") | ||
set(WITH_LIBPNG 1) | ||
include_directories(${PNG_INCLUDE_DIR}) | ||
- set(LIBPNG_LIBS ${PNG_LIBRARY}) | ||
+ set(LIBPNG_LIBS ${PNG_LIBRARIES}) | ||
endif() | ||
endif() | ||
|
||
@@ -102,7 +110,7 @@ if(DCMTK_USE_FIND_PACKAGE) | ||
else() | ||
message(STATUS "Info: DCMTK XML support will be enabled") | ||
set(WITH_LIBXML 1) | ||
- include_directories(${LIBXML2_INCLUDE_DIR}) | ||
+ include_directories(${LIBXML2_INCLUDE_DIRS}) | ||
set(LIBXML_LIBS ${LIBXML2_LIBRARIES} ${LIBXML2_EXTRA_LIBS_STATIC}) | ||
endif() | ||
endif() | ||
@@ -140,7 +148,10 @@ if(DCMTK_USE_FIND_PACKAGE) | ||
# Find libiconv | ||
if(DCMTK_WITH_ICONV) | ||
find_package(Iconv QUIET) | ||
- find_package(LIBCHARSET QUIET) | ||
+ set(ICONV_FOUND 1) | ||
+ if(CHARSET_LIBRARIES) | ||
+ set(LIBCHARSET_FOUND 1) | ||
+ endif() | ||
if(ICONV_FOUND) | ||
if(NOT Iconv_IS_BUILT_IN) | ||
set(LIBICONV_FOUND ${ICONV_FOUND}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff --git a/CMake/dcmtkUseWine.cmake b/CMake/dcmtkUseWine.cmake | ||
index 6dbd7dc..cf529e2 100644 | ||
--- a/CMake/dcmtkUseWine.cmake | ||
+++ b/CMake/dcmtkUseWine.cmake | ||
@@ -1,3 +1,14 @@ | ||
+if(CMAKE_HOST_WIN32) | ||
+ function(DCMTK_SETUP_WINE) | ||
+ endfunction() | ||
+ function(WINE_COMMAND) | ||
+ message(FATAL_ERROR "Not implemented") | ||
+ endfunction() | ||
+ function(WINE_DETACHED) | ||
+ message(FATAL_ERROR "Not implemented") | ||
+ endfunction() | ||
+ return() | ||
+endif() | ||
# | ||
# Functions for detection and usage of Wine | ||
# Used when cross compiling |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index bef673f..284d40e 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -21,6 +21,7 @@ target_include_directories(config INTERFACE | ||
$<BUILD_INTERFACE:${DCMTK_BINARY_DIR}/config/include> | ||
$<INSTALL_INTERFACE:include> | ||
) | ||
+target_compile_options(config INTERFACE "\$<\$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus>") | ||
install(TARGETS config EXPORT DCMTKTargets) | ||
|
||
# Include directories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 284d40e..8f8acfd 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -158,7 +158,12 @@ endif() | ||
|
||
if(DCMTK_WITH_ICONV) | ||
# libiconv does not provide a .pc file | ||
- set(PKGCONF_LIBS_PRIV "${PKGCONF_LIBS_PRIV} ${Iconv_LIBRARY} ${LIBCHARSET_LIBRARY}") | ||
+ if(Iconv_LIBRARIES) | ||
+ string(APPEND PKGCONF_LIBS_PRIV " -liconv") | ||
+ endif() | ||
+ if(CHARSET_LIBRARIES) | ||
+ string(APPEND PKGCONF_LIBS_PRIV " -lcharset") | ||
+ endif() | ||
endif() | ||
|
||
if(DCMTK_WITH_ICU) | ||
@@ -200,6 +205,41 @@ endif() | ||
|
||
get_property(DCMTK_LIBRARY_TARGETS GLOBAL PROPERTY DCMTK_LIBRARY_TARGETS) | ||
|
||
+foreach(lib IN LISTS WIN32_STD_LIBRARIES) | ||
+ string(APPEND PKGCONF_LIBS_PRIV " -l${lib}") | ||
+endforeach() | ||
+configure_file("${DCMTK_SOURCE_DIR}/CMake/dcmtk.pc.in" "${DCMTK_BINARY_DIR}/dcmtk-deps.pc" @ONLY) | ||
+install(FILES "${DCMTK_BINARY_DIR}/dcmtk-deps.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) | ||
+set(PKGCONF_LIBS "") | ||
+set(PKGCONF_LIBS_PRIV "") | ||
+set(PKGCONF_REQ_PUB dcmtk-deps) | ||
+set(PKGCONF_REQ_PRIV "") | ||
+ | ||
+foreach(lib IN ITEMS | ||
+ dcmfg # for dcmseg, dcmpmap, dcmect | ||
+ dcmiod # for dcmpstat, dcmfg, dcmseg | ||
+ dcmdsig # for dcmpstat | ||
+ dcmtls # for dcmpstat | ||
+ dcmqrdb # for dcmpstat | ||
+ dcmsr # for cmr | ||
+ dcmnet # for dcmtls, dcmwlm, dcmqrdb | ||
+ dcmtkcharls # for dcmjpls | ||
+ ijg8 # for dcmjpeg | ||
+ ijg12 # fpr dcmjpeg | ||
+ ijg16 # for dcmjpeg | ||
+ dcmimage # for dcmjpeg etc. | ||
+ dcmimgle # for dcmimage etc. | ||
+ dcmxml # for i2d | ||
+ dcmdata # fpr dcmxml, dcmimgle, etc. | ||
+ oflog # for most libs | ||
+ ofstd # for oflog | ||
+ oficonv # for ofstd | ||
+ ) | ||
+ if(lib IN_LIST DCMTK_LIBRARY_TARGETS) | ||
+ list(REMOVE_ITEM DCMTK_LIBRARY_TARGETS ${lib}) | ||
+ list(APPEND DCMTK_LIBRARY_TARGETS ${lib}) | ||
+ endif() | ||
+endforeach() | ||
foreach(T ${DCMTK_LIBRARY_TARGETS}) | ||
set(PKGCONF_LIBS "${PKGCONF_LIBS} -l${T}") | ||
endforeach() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,9 @@ | ||
The package dcmtk provides CMake targets: | ||
dcmtk provides CMake targets: | ||
|
||
find_package(DCMTK CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE DCMTK::DCMTK) | ||
# You may also need one or more of the following targets: | ||
# DCMTK::cmr DCMTK::i2d DCMTK::ijg8 DCMTK::config DCMTK::ofstd | ||
# DCMTK::oflog DCMTK::dcmdata DCMTK::dcmimgle DCMTK::dcmimage | ||
# DCMTK::dcmjpeg DCMTK::ijg12 DCMTK::ijg16 DCMTK::dcmjpls | ||
# DCMTK::dcmtkcharls DCMTK::dcmtls DCMTK::dcmnet DCMTK::dcmsr | ||
# DCMTK::dcmdsig DCMTK::dcmwlm DCMTK::dcmqrdb DCMTK::dcmpstat | ||
# DCMTK::dcmrt DCMTK::dcmiod DCMTK::dcmfg DCMTK::dcmseg | ||
# DCMTK::dcmtract DCMTK::dcmpmap DCMTK::dcmect | ||
find_package(DCMTK CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE DCMTK::DCMTK) | ||
# You may also select specific modules using DCMTK::<module>. | ||
|
||
Add the following cmake code to your CMakeLists.txt to create definitions for DCMTK | ||
if ("${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" STREQUAL "/") | ||
message(WARNING "No vcpkg install dir found, DCMTK definitions are not set") | ||
else() | ||
target_compile_definitions(main | ||
PUBLIC | ||
"DCMTK_PREFIX=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" | ||
"DCM_DICT_DEFAULT_PATH=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/dcmtk-@VERSION@/dicom.dic:${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/dcmtk-@VERSION@/private.dic" | ||
"DEFAULT_CONFIGURATION_DIR=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/etc/dcmtk-@VERSION@/" | ||
"DEFAULT_SUPPORT_DATA_DIR=${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/share/dcmtk-@VERSION@/" | ||
) | ||
endif() | ||
dcmtk provides pkg-config modules: | ||
|
||
dcmtk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) | ||
|
||
vcpkg_find_acquire_program(PKGCONFIG) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${CURRENT_PORT_DIR}/project" | ||
OPTIONS | ||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" | ||
) | ||
vcpkg_cmake_build() |
Oops, something went wrong.