From cfe81bafe82a5a396ad7d82c16e3dc229bae2999 Mon Sep 17 00:00:00 2001 From: slothlife Date: Wed, 11 Feb 2015 21:46:00 -0600 Subject: [PATCH 1/2] Remove setting CMAKE_BUILD_TYPE to Debug Setting was causing single-target configurations (ninja, make) to incorrectly link vs debug runtimes on Windows. --- apps/opencs/CMakeLists.txt | 2 -- components/CMakeLists.txt | 1 - 2 files changed, 3 deletions(-) diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index 0b83feb450..b65aee4cfa 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -4,8 +4,6 @@ set (OPENCS_SRC main.cpp opencs_units (. editor) -set (CMAKE_BUILD_TYPE DEBUG) - opencs_units (model/doc document operation saving documentmanager loader runner ) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 6f8352ddbb..a49e54dd3e 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -1,5 +1,4 @@ project (Components) -set (CMAKE_BUILD_TYPE DEBUG) # Version file set (VERSION_HPP_IN ${CMAKE_CURRENT_SOURCE_DIR}/version/version.hpp.cmake) From f1fd27aeaf2585348b46b526e0267fb36443e8f3 Mon Sep 17 00:00:00 2001 From: slothlife Date: Sat, 14 Feb 2015 23:34:43 -0600 Subject: [PATCH 2/2] Select CMAKE_BUILD_TYPE if not specified A suggestion by kcat to ensure CMake selects a reasonable default for the build type if users don't set it themselves. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37f8552cdd..c8682dace6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,12 @@ project(OpenMW) +# If the user doesn't supply a CMAKE_BUILD_TYPE via command line, choose one for them. +IF(NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING + "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." + FORCE) +ENDIF() + if (APPLE) set(APP_BUNDLE_NAME "${CMAKE_PROJECT_NAME}.app")