summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2011-07-15 15:42:08 +0100
committerJosé Fonseca <jfonseca@vmware.com>2011-07-15 15:42:08 +0100
commit81469c15be2a5abc49616fd6e51b74dba2b1fbb7 (patch)
tree6f33b69d49946e1e54237836ef1473a45705b559
parentbed6d2bdd630fee36e6f1320ea8d2b7f251b8e09 (diff)
Use static MSVC runtime.
Avoids having to install the MSVC redistributable runtime.
-rw-r--r--src/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 981179d..217b52a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -38,6 +38,17 @@ else ()
add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
add_definitions (-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
+
+ # Use static runtime
+ # http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F
+ foreach (flag_var
+ CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
+ )
+ if (${flag_var} MATCHES "/MD")
+ string (REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+ endif (${flag_var} MATCHES "/MD")
+ endforeach (flag_var)
endif ()
set (GLEXT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/glext)