CMAKE_BUILD_TYPE set to Release by default: improved
authorVitaliy Kirsanov <krokoziabla@yandex-team.ru>
Tue, 30 Apr 2019 11:46:12 +0000 (14:46 +0300)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sat, 4 May 2019 01:41:48 +0000 (11:41 +1000)
CMakeLists.txt

index 3d2b030..fe41183 100644 (file)
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.0)
 
-if(NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE Release)
+if(NOT (CMAKE_BUILD_TYPE OR CMAKE_CONFIGURATION_TYPES OR DEFINED ENV{CFLAGS} OR DEFINED ENV{CXXFLAGS}))
+    set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo")
 endif()
 
 project(FLAC VERSION 1.3.2) # HOMEPAGE_URL "https://www.xiph.org/flac/")