| 
									
										
										
										
											2021-01-04 08:24:02 +01:00
										 |  |  | cmake_minimum_required(VERSION 3.12)
 | 
					
						
							| 
									
										
										
										
											2020-08-26 00:38:01 -07:00
										 |  |  | project(blah)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # C++ version
 | 
					
						
							|  |  |  | set(CMAKE_CXX_STANDARD 17)
 | 
					
						
							|  |  |  | set(CMAKE_CXX_STANDARD_REQUIRED ON)
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | add_library(blah | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-31 13:43:23 -08:00
										 |  |  | 	src/core/app.cpp
 | 
					
						
							|  |  |  | 	src/core/filesystem.cpp
 | 
					
						
							| 
									
										
										
										
											2021-03-20 19:23:20 -07:00
										 |  |  | 	src/core/common.cpp
 | 
					
						
							| 
									
										
										
										
											2020-12-31 13:43:23 -08:00
										 |  |  | 	src/core/time.cpp
 | 
					
						
							| 
									
										
										
										
											2021-03-22 16:53:27 -07:00
										 |  |  | 	
 | 
					
						
							|  |  |  | 	src/graphics/batch.cpp
 | 
					
						
							| 
									
										
										
										
											2020-12-31 13:43:23 -08:00
										 |  |  | 	src/graphics/blend.cpp
 | 
					
						
							|  |  |  | 	src/graphics/framebuffer.cpp
 | 
					
						
							|  |  |  | 	src/graphics/material.cpp
 | 
					
						
							|  |  |  | 	src/graphics/mesh.cpp
 | 
					
						
							|  |  |  | 	src/graphics/renderpass.cpp
 | 
					
						
							|  |  |  | 	src/graphics/shader.cpp
 | 
					
						
							| 
									
										
										
										
											2021-03-22 16:53:27 -07:00
										 |  |  | 	src/graphics/spritefont.cpp
 | 
					
						
							|  |  |  | 	src/graphics/subtexture.cpp
 | 
					
						
							| 
									
										
										
										
											2020-12-31 13:43:23 -08:00
										 |  |  | 	src/graphics/texture.cpp
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	src/input/input.cpp
 | 
					
						
							| 
									
										
										
										
											2021-03-20 19:23:20 -07:00
										 |  |  | 	src/input/binding.cpp
 | 
					
						
							|  |  |  | 	src/input/binding_registry.cpp
 | 
					
						
							| 
									
										
										
										
											2020-10-24 17:34:20 -07:00
										 |  |  | 	
 | 
					
						
							| 
									
										
										
										
											2020-12-31 13:43:23 -08:00
										 |  |  | 	src/containers/str.cpp
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	src/images/aseprite.cpp
 | 
					
						
							|  |  |  | 	src/images/font.cpp
 | 
					
						
							|  |  |  | 	src/images/image.cpp
 | 
					
						
							|  |  |  | 	src/images/packer.cpp
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	src/math/calc.cpp
 | 
					
						
							|  |  |  | 	src/math/circle.cpp
 | 
					
						
							|  |  |  | 	src/math/color.cpp
 | 
					
						
							|  |  |  | 	src/math/line.cpp
 | 
					
						
							|  |  |  | 	src/math/mat3x2.cpp
 | 
					
						
							|  |  |  | 	src/math/mat4x4.cpp
 | 
					
						
							|  |  |  | 	src/math/point.cpp
 | 
					
						
							|  |  |  | 	src/math/quad.cpp
 | 
					
						
							|  |  |  | 	src/math/rect.cpp
 | 
					
						
							|  |  |  | 	src/math/rectI.cpp
 | 
					
						
							|  |  |  | 	src/math/stopwatch.cpp
 | 
					
						
							|  |  |  | 	src/math/vec2.cpp
 | 
					
						
							| 
									
										
										
										
											2020-08-26 00:38:01 -07:00
										 |  |  | 	
 | 
					
						
							| 
									
										
										
										
											2020-12-31 13:43:23 -08:00
										 |  |  | 	src/streams/bufferstream.cpp	
 | 
					
						
							|  |  |  | 	src/streams/filestream.cpp
 | 
					
						
							|  |  |  | 	src/streams/memorystream.cpp
 | 
					
						
							|  |  |  | 	src/streams/stream.cpp
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	src/internal/graphics_backend_gl.cpp
 | 
					
						
							|  |  |  | 	src/internal/graphics_backend_d3d11.cpp
 | 
					
						
							|  |  |  | 	src/internal/graphics_backend_dummy.cpp
 | 
					
						
							|  |  |  | 	src/internal/platform_backend_sdl2.cpp
 | 
					
						
							| 
									
										
										
										
											2021-03-23 01:56:53 -07:00
										 |  |  | 	src/internal/platform_backend_win32.cpp
 | 
					
						
							| 
									
										
										
										
											2020-12-26 14:44:48 -08:00
										 |  |  | )
 | 
					
						
							| 
									
										
										
										
											2020-08-26 00:38:01 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-28 18:31:06 -08:00
										 |  |  | target_include_directories(blah  | 
					
						
							| 
									
										
										
										
											2020-08-26 00:38:01 -07:00
										 |  |  | 	PUBLIC
 | 
					
						
							| 
									
										
										
										
											2020-12-31 13:43:23 -08:00
										 |  |  | 	$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
 | 
					
						
							| 
									
										
										
										
											2020-08-26 00:38:01 -07:00
										 |  |  | 	PRIVATE
 | 
					
						
							| 
									
										
										
										
											2020-12-31 13:43:23 -08:00
										 |  |  | 	$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
 | 
					
						
							| 
									
										
										
										
											2020-08-26 00:38:01 -07:00
										 |  |  | )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Platform Variables
 | 
					
						
							| 
									
										
										
										
											2021-03-23 01:56:53 -07:00
										 |  |  | set(PLATFORM_SDL2 true CACHE BOOL "Use SDL2 Platform Backend")
 | 
					
						
							|  |  |  | set(PLATFORM_WIN32 false CACHE BOOL "Use Win32 Platform Backend")
 | 
					
						
							|  |  |  | set(GRAPHICS_OPENGL true CACHE BOOL "Use OpenGL Graphics Backend")
 | 
					
						
							|  |  |  | set(GRAPHICS_D3D11 false CACHE BOOL "Use D3D11 Graphics Backend")
 | 
					
						
							| 
									
										
										
										
											2020-12-28 18:31:06 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | set(LIBS "")
 | 
					
						
							| 
									
										
										
										
											2020-08-26 00:38:01 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-23 01:56:53 -07:00
										 |  |  | # use the OpenGL Graphics Backend
 | 
					
						
							|  |  |  | if (GRAPHICS_OPENGL)
 | 
					
						
							|  |  |  | 	add_compile_definitions(BLAH_GRAPHICS_OPENGL)
 | 
					
						
							| 
									
										
										
										
											2020-08-26 00:38:01 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-23 01:56:53 -07:00
										 |  |  | # use the D3D11 Graphics Backend
 | 
					
						
							|  |  |  | elseif (GRAPHICS_D3D11)
 | 
					
						
							|  |  |  | 	add_compile_definitions(BLAH_GRAPHICS_D3D11)
 | 
					
						
							| 
									
										
										
										
											2020-12-28 18:31:06 -08:00
										 |  |  | 	set(LIBS ${LIBS} d3d11.lib dxguid.lib D3Dcompiler.lib)
 | 
					
						
							|  |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-23 01:56:53 -07:00
										 |  |  | # use the SDL2 Platform Backend
 | 
					
						
							|  |  |  | # Link and create SDL2 Definition
 | 
					
						
							|  |  |  | if (PLATFORM_SDL2)
 | 
					
						
							|  |  |  | 	add_compile_definitions(BLAH_PLATFORM_SDL2)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-04 00:58:24 -08:00
										 |  |  | 	if (${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
 | 
					
						
							|  |  |  |   		set_target_properties(blah PROPERTIES COMPILE_FLAGS "-s USE_SDL=2")
 | 
					
						
							|  |  |  | 	else()
 | 
					
						
							|  |  |  | 		if (NOT DEFINED SDL2_INCLUDE_DIRS OR NOT DEFINED SDL2_LIBRARIES)
 | 
					
						
							|  |  |  | 			find_package(SDL2 REQUIRED)
 | 
					
						
							|  |  |  | 		endif()
 | 
					
						
							|  |  |  | 		
 | 
					
						
							|  |  |  | 		target_include_directories(blah PUBLIC "$<BUILD_INTERFACE:${SDL2_INCLUDE_DIRS}>")
 | 
					
						
							|  |  |  | 		set(LIBS ${LIBS} ${SDL2_LIBRARIES})
 | 
					
						
							| 
									
										
										
										
											2021-01-03 00:10:53 -08:00
										 |  |  | 	endif()
 | 
					
						
							| 
									
										
										
										
											2021-03-23 01:56:53 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | # use the Win32 Platform Backend
 | 
					
						
							|  |  |  | elseif (PLATFORM_WIN32)
 | 
					
						
							|  |  |  | 	add_compile_definitions(BLAH_PLATFORM_WIN32)
 | 
					
						
							| 
									
										
										
										
											2020-12-28 18:31:06 -08:00
										 |  |  | endif()
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-04 08:24:02 +01:00
										 |  |  | target_link_libraries(blah PUBLIC ${LIBS})
 |