Project
This commit is contained in:
Executable
+42
@@ -0,0 +1,42 @@
|
||||
cmake_minimum_required(VERSION 4.1)
|
||||
project(cheesesandwich)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
##### Project settings ######
|
||||
|
||||
# Set the assets directory
|
||||
set(ASSETS_DIR "assets")
|
||||
set(SHADERS_DIR "assets/shaders")
|
||||
|
||||
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
else()
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
endif()
|
||||
|
||||
##### Dependencies #####
|
||||
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
|
||||
option(ENABLE_CPP20_MODULE "Enable C++ 20 module support for Vulkan" OFF)
|
||||
file(GLOB CMAKE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/*.cmake")
|
||||
foreach(cmake_file ${CMAKE_FILES})
|
||||
include(${cmake_file})
|
||||
endforeach()
|
||||
|
||||
##### Project actions #####
|
||||
|
||||
# Define out executable
|
||||
file(GLOB SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
||||
file(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h")
|
||||
add_executable(${PROJECT_NAME} ${SRC_FILES} ${HEADER_FILES})
|
||||
|
||||
# Add the shaders dependency
|
||||
add_dependencies(${PROJECT_NAME} slang_shaders)
|
||||
add_dependencies(${PROJECT_NAME} glsl_shaders)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC "${glfw_SOURCE_DIR}/include")
|
||||
|
||||
# Link with libs
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
glfw
|
||||
Vulkan::cppm
|
||||
)
|
||||
Reference in New Issue
Block a user