if CMAKE_BUILD_TYPE is an empty string, we should also set it to Debug.
Signed-off-by: Kefu Chai <kchai@redhat.com>
endif()
endif(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
-if(NOT DEFINED CMAKE_BUILD_TYPE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
+if(NOT CMAKE_BUILD_TYPE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(default_build_type "Debug")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Default BUILD_TYPE is Debug, other options are: RelWithDebInfo, Release, and MinSizeRel." FORCE)