22 lines
666 B
CMake
22 lines
666 B
CMake
cmake_minimum_required(VERSION 3.22)
|
|
project(sdl_project)
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
# Must set the path to the main.cpp, for example: scripts/main.cpp if it is inside a folder
|
|
add_executable(${PROJECT_NAME} scripts/main.c
|
|
scripts/array.c
|
|
scripts/vector.c
|
|
scripts/matrix.c
|
|
scripts/mesh.c
|
|
scripts/triangle.c
|
|
scripts/light.c
|
|
scripts/display.c)
|
|
|
|
# --- SDL2 SETUP ---
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
|
set(SDL2_PATH "SDL2/x86_64-w64-mingw32")
|
|
|
|
find_package(SDL2 REQUIRED)
|
|
include_directories(${SDL2_INCLUDE_DIR})
|
|
target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARY} ${SDL2_IMAGE_LIBRARIES}) |