How to query DCMTK version

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
kingcrimson-biubiu
Posts: 2
Joined: Thu, 2018-01-25, 13:46

How to query DCMTK version

#1 Post by kingcrimson-biubiu » Fri, 2018-09-14, 00:35

Dear forum,
May I know if there's a function in DCMTK that can return the API version (such as "3.6.3")? I searched the source repository in the 3.6.3 branch but didn't manage to find one. Thank you! 8)

J. Riesmeier
DCMTK Developer
Posts: 2023
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: How to query DCMTK version

#2 Post by J. Riesmeier » Fri, 2018-09-14, 08:06

There is a macro OFFIS_DCMTK_VERSION in "dcmtk/dcmdata/dcuid.h".

kingcrimson-biubiu
Posts: 2
Joined: Thu, 2018-01-25, 13:46

Re: How to query DCMTK version

#3 Post by kingcrimson-biubiu » Wed, 2018-10-17, 20:47

J. Riesmeier wrote:There is a macro OFFIS_DCMTK_VERSION in "dcmtk/dcmdata/dcuid.h".
Thanks for your reply, J. Riesmeier.

It appears that OFFIS_DCMTK_VERSION is an alias to PACKAGE_VERSION_SUFFIX, which is defined in dcmtk/config/osconfig.h

My 2 cents: It would be more convenient to users if, instead of being a preprocessor macro alone, the version number is made a return value of an API global function (say std::string GetVersionString()). It would also be helpful if it is accessible in CMake (say DCMTK_VERSION).

J. Riesmeier
DCMTK Developer
Posts: 2023
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: How to query DCMTK version

#4 Post by J. Riesmeier » Wed, 2018-10-17, 21:41

It appears that OFFIS_DCMTK_VERSION is an alias to PACKAGE_VERSION_SUFFIX, which is defined in dcmtk/config/osconfig.h
No, OFFIS_DCMTK_VERSION is defined as a concatenation of PACKAGE_VERSION and PACKAGE_VERSION_SUFFIX, e.g. "3.6.3+"
... the version number is made a return value of an API global function (say std::string GetVersionString()). It would also be helpful if it is accessible in CMake (say DCMTK_VERSION).
I am not a friend of global functions but what would be the advantage compared to a preprocessor macro; is it type safety?
What is wrong with the CMake variable DCMTK_PACKAGE_VERSION?

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot] and 1 guest