• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1##  Copyright (c) 2015 The WebM project authors. All Rights Reserved.
2##
3##  Use of this source code is governed by a BSD-style license
4##  that can be found in the LICENSE file in the root of the source
5##  tree. An additional intellectual property rights grant can be found
6##  in the file PATENTS.  All contributing project authors may
7##  be found in the AUTHORS file in the root of the source tree.
8cmake_minimum_required(VERSION 2.8)
9
10if (MSVC)
11  # CMake defaults to producing code linked to the DLL MSVC runtime. In libwebm
12  # static is typically desired. Force static code generation unless the user
13  # running CMake set MSVC_RUNTIME to dll.
14  if (NOT "${MSVC_RUNTIME}" STREQUAL "dll")
15    foreach (flag_var
16             CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
17             CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
18      if (${flag_var} MATCHES "/MD")
19        string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
20      endif (${flag_var} MATCHES "/MD")
21    endforeach (flag_var)
22  endif ()
23endif ()
24