summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlan Antonuk <alan.antonuk@gmail.com>2012-11-06 22:15:07 -0500
committerAlan Antonuk <alan.antonuk@gmail.com>2012-11-06 22:15:07 -0500
commitbca84cad94d295035742e084d3920a0c80b12da1 (patch)
tree9b97d6bfed79be7848fd777d390e6c09389df060 /CMakeLists.txt
parent74dd09f350f5298f10ac0f300c7771f2236c0fa8 (diff)
downloadrabbitmq-c-github-ask-bca84cad94d295035742e084d3920a0c80b12da1.tar.gz
Only set CMAKE_BUILD_TYPE on supported generators
CMAKE_BUILD_TYPE only works with Ninja and Makefile based projects. This we should only set it when we're using that kind of Generator. Also print out a status message if a default is set
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2835dc9..00efc0c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,8 +35,10 @@ elseif (CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${RMQ_C_FLAGS} ${CMAKE_C_FLAGS}")
endif ()
-if (NOT CMAKE_BUILD_TYPE)
+if (CMAKE_GENERATOR MATCHES ".*(Make|Ninja).*"
+ AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
+ message(STATUS "CMAKE_BUILD_TYPE not specified. Using ${CMAKE_BUILD_TYPE} build")
endif()
#find python