From d501fbe741079e560838b4fdbe8323976da10a9b Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Wed, 3 Oct 2018 09:37:12 +0200 Subject: [PATCH] Set CMAKE_BUILD_TYPE default on win32 too --- CMakeLists.txt | 16 +++++++--------- appveyor.yml | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bac090..8374c41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,13 @@ # vim: et ts=4 sts=4 sw=4 tw=0 CMAKE_MINIMUM_REQUIRED(VERSION 3.1) + +# Ensures that CMAKE_BUILD_TYPE has a default value +IF(NOT DEFINED CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage.") +ENDIF() + PROJECT(jsoncpp) ENABLE_TESTING() @@ -12,15 +19,6 @@ OPTION(JSONCPP_WITH_PKGCONFIG_SUPPORT "Generate and install .pc files" ON) OPTION(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" ON) OPTION(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF) -# Ensures that CMAKE_BUILD_TYPE is visible in cmake-gui on Unix -IF(NOT WIN32) - IF(NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE Release CACHE STRING - "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage." - FORCE) - ENDIF() -ENDIF() - # Enable runtime search path support for dynamic libraries on OSX IF(APPLE) SET(CMAKE_MACOSX_RPATH 1) diff --git a/appveyor.yml b/appveyor.yml index 5d497de..a723fca 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,7 +10,7 @@ environment: build_script: - cmake --version - cd c:\projects\jsoncpp - - cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%CD:\=/%/install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON . + - cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%CD:\=/%/install -DBUILD_SHARED_LIBS=ON . - cmake --build . --config Release --target install deploy: