Initial
This commit is contained in:
30
CMakeLists.txt
Normal file
30
CMakeLists.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(Letnik3Zadnja)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Include FetchContent to download SDL from source
|
||||
include(FetchContent)
|
||||
|
||||
# Download SDL2 from source
|
||||
FetchContent_Declare(
|
||||
SDL2
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
||||
GIT_TAG release-2.30.3
|
||||
)
|
||||
|
||||
# Make SDL available
|
||||
FetchContent_MakeAvailable(SDL2)
|
||||
|
||||
# Collect all source files from src/ and nested directories
|
||||
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS "src/*.cpp")
|
||||
|
||||
# Create the executable
|
||||
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
|
||||
# Include headers from include/
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE include)
|
||||
|
||||
# Link SDL2 to the executable
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2)
|
||||
Reference in New Issue
Block a user