Project

General

Profile

Actions

Bug #842

closed

CMake does not permit the user to select /MT or /MD build model on Windows

Added by Marco Eichelberg about 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Start date:
2018-08-10
Due date:
% Done:

100%

Estimated time:
Module:
Operating System:
Windows
Compiler:

Description

When compiling with the Visual Studio compilers on Windows, the user needs to decide whether to use the "Multithread Static" runtime (/MT) or the "Multithread DLL" runtime (/MD). All object files and libraries that are linked into an executable have to be compiled with the same setting. For this reason, the external libraries for Windows are available in an /MT and an /MD version.

The CMake build infrastructure for Windows does not permit the user to explicitly select the /MT or /MD build model. By default, CMake's own preference is selected and it is assumed that this is /MD, which is the case on most, but not all platforms. Alternatively the user can compile with -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS, in which case /MT and a completely hard-coded set of parameters is used. This is mostly a backward-compatibility option emulating the CMake behaviour of older DCMTK releases.

What is really needed is an option that permits the user to select between /MT and /MD but still allows CMake to freely choose all other compiler options, which may vary between Visual Studio versions. A proposal how to implement this by modifying the compiler options selected by CMake can be found on Stackoverflow:

https://stackoverflow.com/questions/14172856/cmake-compile-with-mt-instead-of-md

Something like this should be implemented in DCMTK and made available as a selectable option in the CMake GUI.

Actions #1

Updated by Jörg Riesmeier almost 7 years ago

  • Target version changed from 3.6.4 to 3.6.6
Actions #2

Updated by Marco Eichelberg about 6 years ago

  • Status changed from New to Closed
  • Assignee set to Marco Eichelberg
  • % Done changed from 0 to 100

Closed by commit #63f954032.

Actions #3

Updated by Michael Onken over 5 years ago

  • Target version deleted (3.6.6)
Actions

Also available in: Atom PDF