Last active
October 30, 2021 02:10
-
-
Save AkBKukU/c382a7cb3dd64e8fbadc47a5fe7bab24 to your computer and use it in GitHub Desktop.
A CMake file for use with linux for https://vulkan-tutorial.com/Development_environment#page_Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CMake file for Vulkan Tutorial | |
# by Shelby Jueden (AkBKukU) | |
cmake_minimum_required(VERSION 3.1) | |
project(VKDemo) | |
# Set the name of the ouput binary | |
set( | |
BIN_NAME | |
"vkdemo" | |
) | |
# Add all files from a src folder | |
file(GLOB SOURCES "src/*.cpp") | |
# Add vulkan dependencies using enviornment variable from LunarG SDK Setup | |
include_directories("$ENV{VULKAN_SDK}/include") | |
link_directories("$ENV{VULKAN_SDK}/lib") | |
link_directories("$ENV{VULKAN_SDK}/etc/explicit_layer.d") | |
# Add GLFW | |
find_package(glfw3 3.2 REQUIRED) | |
# Flags for debug build | |
set( | |
CMAKE_CXX_FLAGS_DEBUG | |
"${CMAKE_CXX_FLAGS_DEBUG} -d -Wall" | |
) | |
# Flags for Release build | |
set( | |
CMAKE_CXX_FLAGS_RELEASE | |
"${CMAKE_CXX_FLAGS_RELEASE} -Wall" | |
) | |
# Set C++11 | |
set (CMAKE_CXX_STANDARD 11) | |
# Setup binary output | |
add_executable(${BIN_NAME} ${SOURCES}) | |
# Link dependencies | |
target_link_libraries(${BIN_NAME} glfw) | |
target_link_libraries(${BIN_NAME} vulkan) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment