mirror of
				https://github.com/nicbarker/clay.git
				synced 2025-11-04 00:26:17 +00:00 
			
		
		
		
	[CMake] Make Examples Optional in CMAKE (#216)
This commit is contained in:
		
							parent
							
								
									c0dac38c87
								
							
						
					
					
						commit
						ea6109bd0b
					
				| 
						 | 
					@ -3,17 +3,38 @@ project(clay)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 | 
					list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					option(CLAY_INCLUDE_ALL_EXAMPLES "Build all examples" ON)
 | 
				
			||||||
 | 
					option(CLAY_INCLUDE_DEMOS "Build video demo and website" OFF)
 | 
				
			||||||
 | 
					option(CLAY_INCLUDE_CPP_EXAMPLE "Build C++ example" OFF)
 | 
				
			||||||
 | 
					option(CLAY_INCLUDE_RAYLIB_EXAMPLES "Build raylib examples" OFF)
 | 
				
			||||||
 | 
					option(CLAY_INCLUDE_SDL2_EXAMPLES "Build SDL 2 examples" OFF)
 | 
				
			||||||
 | 
					option(CLAY_INCLUDE_SDL3_EXAMPLES "Build SDL 3 examples" OFF)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					message(STATUS "CLAY_INCLUDE_DEMOS: ${CLAY_INCLUDE_DEMOS}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(APPLE)
 | 
					if(APPLE)
 | 
				
			||||||
  enable_language(OBJC)
 | 
					  enable_language(OBJC)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_subdirectory("examples/cpp-project-example")
 | 
					if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_CPP_EXAMPLE)
 | 
				
			||||||
add_subdirectory("examples/raylib-multi-context")
 | 
					  add_subdirectory("examples/cpp-project-example")
 | 
				
			||||||
add_subdirectory("examples/raylib-sidebar-scrolling-container")
 | 
					endif()
 | 
				
			||||||
#  add_subdirectory("examples/cairo-pdf-rendering") Some issue with github actions populating cairo, disable for now
 | 
					if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_DEMOS)
 | 
				
			||||||
if(NOT MSVC)
 | 
					  if(NOT MSVC)
 | 
				
			||||||
    add_subdirectory("examples/clay-official-website")
 | 
					    add_subdirectory("examples/clay-official-website")
 | 
				
			||||||
 | 
					  endif()
 | 
				
			||||||
 | 
					  add_subdirectory("examples/introducing-clay-video-demo")
 | 
				
			||||||
 | 
					endif ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_RAYLIB_EXAMPLES)
 | 
				
			||||||
 | 
					  add_subdirectory("examples/raylib-multi-context")
 | 
				
			||||||
 | 
					  add_subdirectory("examples/raylib-sidebar-scrolling-container")
 | 
				
			||||||
 | 
					endif ()
 | 
				
			||||||
 | 
					if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_SDL2_EXAMPLES)
 | 
				
			||||||
 | 
					  add_subdirectory("examples/SDL2-video-demo")
 | 
				
			||||||
 | 
					endif ()
 | 
				
			||||||
 | 
					if(NOT MSVC AND (CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_SDL3_EXAMPLES))
 | 
				
			||||||
    add_subdirectory("examples/SDL3-simple-demo")
 | 
					    add_subdirectory("examples/SDL3-simple-demo")
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
add_subdirectory("examples/introducing-clay-video-demo")
 | 
					
 | 
				
			||||||
add_subdirectory("examples/SDL2-video-demo")
 | 
					#  add_subdirectory("examples/cairo-pdf-rendering") Some issue with github actions populating cairo, disable for now
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue