CXX11 Inferred in latest snapshots

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
konis
Posts: 28
Joined: Mon, 2015-11-23, 16:05

CXX11 Inferred in latest snapshots

#1 Post by konis » Tue, 2019-06-25, 18:02

While updating my version of DCMTK I noticed that the default value for CMake flag DCMTK_ENABLE_CXX11 is now INFERRED.

Can someone tell me what that means in terms of C++ 11 usage within the toolkit? Also, what are the supported values for this and related CXX flags?

Thanks.

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: CXX11 Inferred in latest snapshots

#2 Post by Jan Schlamelcher » Wed, 2019-06-26, 16:50

New versions of CMake now natively support detecting the supported C++ standard. This means you can now use the official way of setting CXX_STANDARD and related variables to chose a C++ version while building DCMTK. DCMTK_ENABLE_CXX11 exists for legacy reasons, e.g. if you have a build script that sets it to ON, this will still work, but if you decide to use the CXX_STANDARD variable it will infer the value based on the information that CMake provides after running the appropriate tests.

konis
Posts: 28
Joined: Mon, 2015-11-23, 16:05

Re: CXX11 Inferred in latest snapshots

#3 Post by konis » Thu, 2019-06-27, 13:23

And what is the recommended value for CXX_STANDARD? 11, 14 or 17 ?

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: CXX11 Inferred in latest snapshots

#4 Post by Jan Schlamelcher » Thu, 2019-06-27, 13:29

Well, 20, of course! It will become 23 in a few years, though ;-).

What I mean to say is: this depends on your project. E.g. if you are using C++17 in your code, set it to 17 for building a compatible DCMTK and to enable some features that require it. If this does not apply, e.g. if you are a package maintainer for a Linux distribution you should instead look at other packages, e.g. if the QT libraries are built with C++17 support, then perhaps that should also apply for DCMTK.

konis
Posts: 28
Joined: Mon, 2015-11-23, 16:05

Re: CXX11 Inferred in latest snapshots

#5 Post by konis » Thu, 2019-06-27, 13:36

I hear you :D .

Thanks Jan.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest