diff options
Diffstat (limited to 'scripts/CMakeLists.txt')
-rw-r--r-- | scripts/CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 40a7ab0..c90c78e 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,6 +1,20 @@ project(pugixml) cmake_minimum_required(VERSION 2.6) +IF (MSVC) + + option(STATIC_CRT "Use static CRT libraries" ON) + + if(STATIC_CRT) + foreach(flag_var + 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() +ENDIF() option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF) option(BUILD_TESTS "Build tests" OFF) |