conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
971 stars 1.79k forks source link

[package] dcmtk/3.6.8: Character set conversion library is not set correctly #25974

Closed cschreib-ibex closed 1 week ago

cschreib-ibex commented 1 week ago

Description

Starting from DCMTK 3.6.8, upstream added a new alternative implementation for character set conversions which doesn't require libiconv or ICU. They call it oficonv. The CMake scripts now use this by default, and it is not possible to switch to libiconv or ICU with the Conan recipe.

Details: In DCMTK 3.6.7 and earlier, the CMake scripts would automatically set the DCMTK_ENABLE_CHARSET_CONVERSION variable to the right implementation (libiconv or ICU) based on the available third-party libraries, i.e., based on whether DCMTK_WITH_ICONV or DCMTK_WITH_ICU are set. The Conan recipe is currently relying on this mechanism to select the right implementation.

In 3.6.8, the CMake scripts defaults DCMTK_ENABLE_CHARSET_CONVERSION to oficonv regardless of the value of DCMTK_WITH_ICONV and DCMTK_WITH_ICU. To select another implementation, one needs to explicitly set DCMTK_ENABLE_CHARSET_CONVERSION. The Conan recipe does not do that, therefore the implementation is always set to oficonv.

Package and Environment Details

Conan profile

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=clang
compiler.version=16
compiler.libcxx=libstdc++11
cppstd=20
build_type=Release
[options]
[conf]
[build_requires]
[env]
CC=clang-16
CXX=clang++-16

Steps to reproduce

conan install conanfile.py --update --build=missing

conanfile.py (excerpt):

    def requirements(self):
        # ...
        self.requires("dcmtk/3.6.8")

    def configure(self):
        # ... 
        self.options["dcmtk"].charset_conversion = "libiconv"
cat ~/.conan/data/dcmtk/3.6.8/_/_/package/24561d6d33912ce692e57c704102b76fa7f249ad/include/dcmtk/config/osconfig.h | grep DCMTK_ENABLE_CHARSET_CONVERSION

Logs

Output of cat command above:

#define DCMTK_ENABLE_CHARSET_CONVERSION DCMTK_CHARSET_CONVERSION_OFICONV
jcar87 commented 1 week ago

Thanks @cschreib-ibex - We've tested this and it should now be fixed in https://github.com/conan-io/conan-center-index/pull/25994 - thanks for reporting this!

cschreib-ibex commented 1 week ago

Thank you for the quick fix!