39 lines
1.1 KiB
CMake
39 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.22.1)
|
|
|
|
project (Hydrangea)
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
set(OUT_NAME game)
|
|
|
|
# Includes for SDL2
|
|
find_package(SDL2 REQUIRED)
|
|
include_directories(${SDL2_INCLUDE_DIRS})
|
|
|
|
# Includes for SDL2_gpu
|
|
include_directories (${SDL_gpu_SOURCE_DIR})
|
|
link_directories (${SDL_gpu_SOURCE_DIR}/src)
|
|
set(SDL_GPU_LIBS SDL2_gpu ${GL_LIBRARIES})
|
|
|
|
# Then bring in the local source files and headers into the project
|
|
include_directories(include)
|
|
|
|
file(GLOB_RECURSE SOURCES "src/*.cpp") # Base engine source files
|
|
file(GLOB_RECURSE BOX2D_SOURCES "src/box2d/*.cpp") # box2d Physics engine
|
|
file(GLOB_RECURSE FMT_SOURCES "src/fmt/*.cc") # fmt String formatter lib
|
|
|
|
add_executable( ${OUT_NAME}
|
|
${SOURCES}
|
|
${BOX2D_SOURCES}
|
|
${FMT_SOURCES}
|
|
)
|
|
|
|
target_link_libraries(${OUT_NAME} ${SDL2_LIBRARIES})
|
|
target_link_libraries(${OUT_NAME} ${SDL_GPU_LIBS})
|
|
|
|
get_target_property(OUT ${OUT_NAME} LINK_LIBRARIES)
|
|
message(STATUS ${OUT})
|
|
|
|
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
|
|
foreach(dir ${dirs})
|
|
message(STATUS "Include dirs: '${dir}'")
|
|
endforeach() |