aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authordcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2015-03-19 19:25:42 +0000
committerdcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2015-03-19 19:25:42 +0000
commit22f5121b5e5e6465044a81abe75ab1551b413bc1 (patch)
treeee0ab22a13397f8aa06099ff8f1bcb59539ca860 /CMakeLists.txt
parent5b824d4ed2b4d9035efa5c82b1d02d618f4d66ad (diff)
Allow the executables and libraries outside of the sharedlib/ directory to be linked against msvcr*.dll instead of libcmt*.lib. This is reported to be necessary when building libjpeg-turbo for use with C#.
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1538 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 12 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f8eaa4..39efdf3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,14 +119,18 @@ else()
endif()
if(MSVC)
- # Use the static C library for all build types
- foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
- CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
- if(${var} MATCHES "/MD")
- string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
- endif()
- endforeach()
-
+ option(WITH_CRT_DLL
+ "Link all libjpeg-turbo libraries and executables with the C run-time DLL (msvcr*.dll) instead of the static C run-time library (libcmt*.lib.) The default is to use the C run-time DLL only with the libraries and executables that need it."
+ FALSE)
+ if(NOT WITH_CRT_DLL)
+ # Use the static C library for all build types
+ foreach(var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
+ if(${var} MATCHES "/MD")
+ string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
+ endif()
+ endforeach()
+ endif()
add_definitions(-W3 -wd4996)
endif()