mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-22 15:24:34 +00:00
23dcdd59bf
The example triangle now will have a absolute filepath to the shaders. This allows running the exe from directories other than the location of the shaders in the filesystem. Alternative solutions would be to copy/paste the shader binary into the source code.
21 lines
730 B
CMake
21 lines
730 B
CMake
add_executable(vk-bootstrap-triangle triangle.cpp)
|
|
target_link_libraries(vk-bootstrap-triangle
|
|
PRIVATE
|
|
glfw
|
|
vk-bootstrap
|
|
vk-bootstrap-compiler-warnings
|
|
vk-boostrap-vulkan-headers)
|
|
target_include_directories(vk-bootstrap-triangle PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) #path to build directory for shaders
|
|
|
|
add_custom_command(
|
|
TARGET vk-bootstrap-triangle
|
|
POST_BUILD
|
|
COMMAND
|
|
${CMAKE_COMMAND} -E copy_directory
|
|
${CMAKE_SOURCE_DIR}/example/shaders ${CMAKE_CURRENT_BINARY_DIR}
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
configure_file (
|
|
"${PROJECT_SOURCE_DIR}/example/example_config.h.in"
|
|
"${CMAKE_CURRENT_BINARY_DIR}/example_config.h"
|
|
) |