procedural-3d-engine/examples/CMakeLists.txt

103 lines
2.3 KiB
Text
Raw Normal View History

# Function for building single example
function(buildExample EXAMPLE_NAME)
SET(EXAMPLE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE_NAME})
message(STATUS "Generating project file for example in ${EXAMPLE_FOLDER}")
# Main
file(GLOB SOURCE *.cpp ${BASE_HEADERS} ${EXAMPLE_FOLDER}/*.cpp)
SET(MAIN_CPP ${EXAMPLE_FOLDER}/${EXAMPLE_NAME}.cpp)
if(EXISTS ${EXAMPLE_FOLDER}/main.cpp)
SET(MAIN_CPP ${EXAMPLE_FOLDER}/main.cpp)
ENDIF()
# imgui example requires additional source files
IF(${EXAMPLE_NAME} STREQUAL "imgui")
file(GLOB ADD_SOURCE "../external/imgui/*.cpp")
SET(SOURCE ${SOURCE} ${ADD_SOURCE})
ENDIF()
# Add shaders
set(SHADER_DIR "../data/shaders/${EXAMPLE_NAME}")
file(GLOB SHADERS "${SHADER_DIR}/*.vert" "${SHADER_DIR}/*.frag" "${SHADER_DIR}/*.comp" "${SHADER_DIR}/*.geom" "${SHADER_DIR}/*.tesc" "${SHADER_DIR}/*.tese")
source_group("Shaders" FILES ${SHADERS})
if(WIN32)
add_executable(${EXAMPLE_NAME} WIN32 ${MAIN_CPP} ${SOURCE} ${SHADERS})
target_link_libraries(${EXAMPLE_NAME} base ${Vulkan_LIBRARY} ${ASSIMP_LIBRARIES} ${WINLIBS})
else(WIN32)
add_executable(${EXAMPLE_NAME} ${MAIN_CPP} ${SOURCE} ${SHADERS})
target_link_libraries(${EXAMPLE_NAME} base )
endif(WIN32)
if(RESOURCE_INSTALL_DIR)
install(TARGETS ${EXAMPLE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
endfunction(buildExample)
# Build all examples
function(buildExamples)
foreach(EXAMPLE ${EXAMPLES})
buildExample(${EXAMPLE})
endforeach(EXAMPLE)
endfunction(buildExamples)
set(EXAMPLES
bloom
computecloth
computecullandlod
computeheadless
computenbody
computeparticles
computeshader
debugmarker
deferred
deferredmultisampling
deferredshadows
displacement
distancefieldfonts
dynamicuniformbuffer
gears
geometryshader
hdr
imgui
indirectdraw
instancing
mesh
multisampling
multithreading
occlusionquery
offscreen
parallaxmapping
particlefire
pbrbasic
pbribl
pbrtexture
pipelines
pipelinestatistics
pushconstants
radialblur
raytracing
renderheadless
scenerendering
screenshot
shadowmapping
shadowmappingomni
skeletalanimation
specializationconstants
sphericalenvmapping
ssao
stencilbuffer
subpasses
terraintessellation
tessellation
textoverlay
texture
texture3d
texturearray
texturecubemap
texturemipmapgen
texturesparseresidency
timestampquery
triangle
viewportarray
vulkanscene
)
buildExamples()