CMake works on all our supported platforms, like MSVC, Mingw, GCC, Clang, and many more. It allows for a single way of doing things, so no longer we need shell scripts and vbs scripts to work on all our supported platforms. Additionally, CMake allows to generate project files for like MSVC, KDevelop, etc. This heavily reduces the lines of code we need to support multiple platforms from a project perspective. Addtiionally, this heavily improves our detection of libraries, etc.
		
			
				
	
	
		
			15 lines
		
	
	
		
			393 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			393 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
# Set static linking if the platform requires it.
 | 
						|
#
 | 
						|
# set_static()
 | 
						|
#
 | 
						|
function(set_static_if_needed)
 | 
						|
     if (MINGW)
 | 
						|
        # Let exectutables run outside MinGW environment
 | 
						|
        # Force searching static libs
 | 
						|
        set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" PARENT_SCOPE)
 | 
						|
 | 
						|
        # Force static linking
 | 
						|
        link_libraries(-static -static-libgcc -static-libstdc++)
 | 
						|
    endif()
 | 
						|
endfunction()
 |