cmake generating mixed CRT linkage settings

11 views
Skip to first unread message

jwalker

unread,
Oct 24, 2020, 6:56:54 AM10/24/20
to libjpeg-turbo User Discussion/Support
Hi, I've run cmake 3.19.0-rc1 over libjpeg-turbo on a win 10 machine using VD2019 x64. I noticed that if I leave all the config settings as default, I generate a solution with mixed CRT runtime settings across the projects. For example,
  • djpeg has /MD /MDd
  • turbojpeg-static has /MT /MTd
I'm not sure what the ENABLE_SHARED and ENABLE_STATIC settings are doing, because if I just have ENABLED_SHARED ticked, I still get mixed CRT settings e.g.
  • djpeg has /MD /MDd
  • turbojpeg has /MT /MTd
What do the ENABLED_SHARED and ENABLED_STATIC settings actually do? Do they affect the way the libraries statically/dynamically link to the CRT, or do they mean they are creating static/dynamic libraries?

Is there any way to just have all the project files set to either (/MT /MTd) or (/MD /MDd)? Or is there a reason they are set up this way? At the end of the day all I really want is for turbojpeg-static be dynamically linked to the CRT i.e. set to (/MD /MDd). Then i can statically link turbojpeg-static to my C++ app which also has (/MD /MDd) to the CRT. I'm not sure whether I just need to make this change to turbojpeg-static, or to all the projects in the solution - as they may depend on one another.

Thanks for any help.

DRC

unread,
Oct 24, 2020, 10:49:31 AM10/24/20
to libjpeg-t...@googlegroups.com

Passing -DWITH_CRT_DLL=1 to cmake when configuring the build should do what you want.

--
You received this message because you are subscribed to the Google Groups "libjpeg-turbo User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libjpeg-turbo-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libjpeg-turbo-users/ea055921-95eb-4270-a06b-909306e04037n%40googlegroups.com.

jwalker

unread,
Oct 25, 2020, 12:57:37 AM10/25/20
to libjpeg-turbo User Discussion/Support
Thanks for that, it works.
Reply all
Reply to author
Forward
0 new messages