CDoom/CMakeLists.txt

27 lines
702 B
CMake

cmake_minimum_required(VERSION 3.10)
project(CDoom)
set(CMAKE_CXX_STANDARD 17)
# Include directory for header files
include_directories(${PROJECT_SOURCE_DIR}/src/include)
# Automatically find all .cpp files in src/ and subdirectories
file(GLOB_RECURSE SOURCES "src/*.cpp")
# Find SDL2 library
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIRS})
# Find SDL2_ttf library
find_package(SDL2_ttf REQUIRED)
include_directories(${SDL2_TTF_INCLUDE_DIRS})
set(SDL2_TTF_LIBRARIES "/usr/lib/libSDL2_ttf.so")
# Create executable with all source files
add_executable(CDoom ${SOURCES})
# Link SDL2 and SDL2_ttf libraries
target_link_libraries(CDoom ${SDL2_LIBRARIES} ${SDL2_TTF_LIBRARIES})