Skip to content

Commit 396828e

Browse files
committed
Set CMAKE_BUILD_TYPE default on win32 too
1 parent 2d5245e commit 396828e

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

CMakeLists.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# vim: et ts=4 sts=4 sw=4 tw=0
22

33
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
4+
5+
# Ensures that CMAKE_BUILD_TYPE has a default value
6+
IF(NOT DEFINED CMAKE_BUILD_TYPE)
7+
SET(CMAKE_BUILD_TYPE Release CACHE STRING
8+
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage.")
9+
ENDIF()
10+
411
PROJECT(jsoncpp)
512
ENABLE_TESTING()
613

@@ -12,15 +19,6 @@ OPTION(JSONCPP_WITH_PKGCONFIG_SUPPORT "Generate and install .pc files" ON)
1219
OPTION(JSONCPP_WITH_CMAKE_PACKAGE "Generate and install cmake package files" ON)
1320
OPTION(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF)
1421

15-
# Ensures that CMAKE_BUILD_TYPE is visible in cmake-gui on Unix
16-
IF(NOT WIN32)
17-
IF(NOT CMAKE_BUILD_TYPE)
18-
SET(CMAKE_BUILD_TYPE Release CACHE STRING
19-
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage."
20-
FORCE)
21-
ENDIF()
22-
ENDIF()
23-
2422
# Enable runtime search path support for dynamic libraries on OSX
2523
IF(APPLE)
2624
SET(CMAKE_MACOSX_RPATH 1)

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ environment:
1010
build_script:
1111
- cmake --version
1212
- cd c:\projects\jsoncpp
13-
- cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%CD:\=/%/install -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON .
13+
- cmake -G "%CMAKE_GENERATOR%" -DCMAKE_INSTALL_PREFIX=%CD:\=/%/install -DBUILD_SHARED_LIBS=ON .
1414
- cmake --build . --config Release --target install
1515

1616
deploy:

0 commit comments

Comments
 (0)