checkin everything to test build on windows
This commit is contained in:
parent
875b0b2f88
commit
b1f5d882f0
16 changed files with 250 additions and 0 deletions
50
CMakeLists.txt
Normal file
50
CMakeLists.txt
Normal file
|
@ -0,0 +1,50 @@
|
|||
# Set the minimum version of CMake that can be used
|
||||
# To find the cmake version run
|
||||
# $ cmake --version
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
|
||||
# Set the project name
|
||||
project(Witch-Game)
|
||||
|
||||
|
||||
#find_package(SDL3 REQUIRED)
|
||||
#find_package(SDL3_image REQUIRED)
|
||||
|
||||
#download SDL if not installed
|
||||
#use git ls-remote --tags https://github.com/libsdl-org/SDL.git | tail -n 1
|
||||
#to get the newest git-tag
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
SDL3
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
||||
GIT_TAG f6864924f76e1a0b4abaefc76ae2ed22b1a8916e # release-3.2.8
|
||||
FIND_PACKAGE_ARGS NAMES SDL3
|
||||
)
|
||||
FetchContent_Declare(
|
||||
SDL3_image
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL_image.git
|
||||
GIT_TAG 11154afb7855293159588b245b446a4ef09e574f # release-3.2.4
|
||||
FIND_PACKAGE_ARGS NAMES SDL3_image
|
||||
)
|
||||
FetchContent_Declare(
|
||||
SDL3_ttf
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL_ttf.git
|
||||
GIT_TAG 3675de381020a719c37f7c79f6564cf52c8f4dcc # release-3.2.0
|
||||
FIND_PACKAGE_ARGS NAMES SDL3_ttf
|
||||
)
|
||||
FetchContent_MakeAvailable(SDL3 SDL3_image SDL3_ttf)
|
||||
|
||||
#list all files in Actors folder
|
||||
set(ACTORS src/Actors/Actor.cpp)
|
||||
|
||||
add_executable(Witch-Game main.cpp src/Game.cpp ${ACTORS})
|
||||
|
||||
target_compile_features(Witch-Game PRIVATE cxx_std_17)
|
||||
target_link_libraries(Witch-Game SDL3 SDL3_image SDL3_ttf)
|
||||
|
||||
#set compiler flags for warnings
|
||||
if(MSVC)
|
||||
target_compile_options(Witch-Game PRIVATE /W4 /WX)
|
||||
else()
|
||||
target_compile_options(Witch-Game PRIVATE -Wall -Wextra -Wpedantic)
|
||||
endif()
|
Loading…
Add table
Add a link
Reference in a new issue