summaryrefslogtreecommitdiff
path: root/scripts/CMakeLists.txt
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-12-30 23:58:03 +0300
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2015-12-30 23:58:03 +0300
commit03b1b6a5c3658381c86dad332907270ae8f0b450 (patch)
tree0ec1fba9790d5ba2c2daa1a17e6d1614e81ac714 /scripts/CMakeLists.txt
parent6a22a28730c0c621d432197627f3d6c43d9b11ee (diff)
scripts: Fix default value for STATIC_CRT option
Also refactor to use the same case and run after common options.
Diffstat (limited to 'scripts/CMakeLists.txt')
-rw-r--r--scripts/CMakeLists.txt15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index c90c78e..82f7adb 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -1,10 +1,15 @@
project(pugixml)
cmake_minimum_required(VERSION 2.6)
-IF (MSVC)
- option(STATIC_CRT "Use static CRT libraries" ON)
+option(BUILD_SHARED_LIBS "Build shared instead of static library" OFF)
+option(BUILD_TESTS "Build tests" OFF)
+set(BUILD_DEFINES "" CACHE STRING "Build defines")
+
+if(MSVC)
+ option(STATIC_CRT "Use static CRT libraries" OFF)
+ # Rewrite command line flags to use /MT if necessary
if(STATIC_CRT)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
@@ -14,11 +19,7 @@ IF (MSVC)
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)
-set(BUILD_DEFINES "" CACHE STRING "Build defines")
+endif()
# Pre-defines standard install locations on *nix systems.
include(GNUInstallDirs)