]> git.proxmox.com Git - libgit2.git/commitdiff
Leave CMAKE_BUILD_TYPE absent on those generators which don't use it.
authorPaul Thompson <p.r.thompson@ieee.org>
Sat, 27 Oct 2012 23:21:28 +0000 (10:21 +1100)
committerPaul Thompson <p.r.thompson@ieee.org>
Sat, 27 Oct 2012 23:21:28 +0000 (10:21 +1100)
CMakeLists.txt

index fdced6148cab927f49fcbc391fd4caf6be9d743c..59c6b4388bd8b39369664a154fd49bce9df56407 100644 (file)
@@ -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)