default to a RelWithDebInfo build if cmake is invoked without setting CMAKE_BUILD_TYPE
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
		
							parent
							
								
									2a67df48fc
								
							
						
					
					
						commit
						9bd0a519fc
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -11,6 +11,17 @@
 | 
			
		|||
#
 | 
			
		||||
cmake_minimum_required(VERSION 3.6)
 | 
			
		||||
 | 
			
		||||
# Set a default build type if none was specified
 | 
			
		||||
set(default_build_type "RelWithDebInfo")
 | 
			
		||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
 | 
			
		||||
  message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
 | 
			
		||||
  set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
 | 
			
		||||
      STRING "Choose the type of build." FORCE)
 | 
			
		||||
  # Set the possible values of build type for cmake-gui
 | 
			
		||||
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
 | 
			
		||||
    "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
FUNCTION(PREPEND var prefix)
 | 
			
		||||
   SET(listVar "")
 | 
			
		||||
   FOREACH(f ${ARGN})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue