Hook up examples to CMake

This commit is contained in:
sfan5
2021-04-22 09:43:53 +02:00
parent 3152a6cc46
commit 5411ec4f03
5 changed files with 61 additions and 14 deletions

45
examples/CMakeLists.txt Normal file
View File

@ -0,0 +1,45 @@
set(IRREXAMPLES
01.HelloWorld
02.Quake3Map
03.CustomSceneNode
04.Movement
05.UserInterface
06.2DGraphics
07.Collision
08.SpecialFX
09.Meshviewer
10.Shaders
11.PerPixelLighting
12.TerrainRendering
13.RenderToTexture
15.LoadIrrFile
16.Quake3MapShader
18.SplitScreen
19.MouseAndJoystick
20.ManagedLights
21.Quake3Explorer
22.MaterialViewer
23.SMeshHandling
24.CursorControl
25.XmlHandling
26.OcclusionQuery
27.PostProcessing
28.CubeMapping
30.Profiling
)
if(WIN32)
list(APPEND IRREXAMPLES 14.Win32Window)
endif()
foreach(exname IN ITEMS ${IRREXAMPLES})
file(GLOB sources "${CMAKE_CURRENT_SOURCE_DIR}/${exname}/*.cpp")
add_executable(${exname} ${sources})
target_include_directories(${exname} PRIVATE
${CMAKE_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/${exname}
)
target_link_libraries(${exname} IrrlichtMt)
endforeach()

View File

@ -1,8 +0,0 @@
DIRS = $(wildcard [0123]* Demo)
all: $(DIRS)
$(DIRS):
-@cd $@ && make clean && make
.PHONY: $(DIRS)