From 88149fae9f004733b0b9829a1296afa5b3593c77 Mon Sep 17 00:00:00 2001 From: Paul Thompson Date: Sun, 28 Oct 2012 10:21:28 +1100 Subject: [PATCH] Leave CMAKE_BUILD_TYPE absent on those generators which don't use it. --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdced6148..59c6b4388 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,10 +110,15 @@ ELSE () ENDIF () ENDIF() -# Build Debug by default -IF (NOT CMAKE_BUILD_TYPE) - SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) -ENDIF () +IF( NOT CMAKE_CONFIGURATION_TYPES ) + # Build Debug by default + IF (NOT CMAKE_BUILD_TYPE) + SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) + ENDIF () +ELSE() + # Using a multi-configuration generator eg MSVC or Xcode + # that uses CMAKE_CONFIGURATION_TYPES and not CMAKE_BUILD_TYPE +ENDIF() IF (OPENSSL_FOUND) ADD_DEFINITIONS(-DGIT_SSL)