50 lines
1.3 KiB
CMake
50 lines
1.3 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
|
|
project(lightkeeper LANGUAGES CXX C)
|
|
|
|
set(GAME_SRC
|
|
src/main.cpp
|
|
|
|
src/Lightkeeper.cpp
|
|
)
|
|
|
|
add_executable(lightkeeper ${GAME_SRC})
|
|
|
|
set_target_properties(lightkeeper PROPERTIES
|
|
CXX_STANDARD 20
|
|
CXX_EXTENSIONS OFF
|
|
)
|
|
|
|
#target_add_extra_warnings(lightkeeper)
|
|
|
|
target_include_directories(lightkeeper PRIVATE "${CMAKE_CURRENT_LIST_DIR}/include")
|
|
|
|
|
|
target_link_libraries(lightkeeper PRIVATE destrum::destrum)
|
|
|
|
set(ASSETS_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/assets_src")
|
|
set(ASSETS_RUNTIME_DIR "${CMAKE_CURRENT_LIST_DIR}/assets_runtime")
|
|
set(OUTPUT_GAME_ASSETS_DIR "${CMAKE_BINARY_DIR}/assets/game")
|
|
|
|
add_custom_command(TARGET lightkeeper POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${OUTPUT_GAME_ASSETS_DIR}"
|
|
COMMAND ${CMAKE_COMMAND} -E rm -rf "${OUTPUT_GAME_ASSETS_DIR}"
|
|
COMMAND ${CMAKE_COMMAND} -E create_symlink "${ASSETS_RUNTIME_DIR}" "${OUTPUT_GAME_ASSETS_DIR}"
|
|
VERBATIM
|
|
)
|
|
|
|
add_custom_target(_internal_clean_game_assets
|
|
COMMAND TheChef
|
|
--input "${ASSETS_SRC_DIR}"
|
|
--output "${ASSETS_RUNTIME_DIR}"
|
|
--clean
|
|
)
|
|
|
|
add_custom_target(_internal_cook_game_assets ALL
|
|
COMMAND TheChef
|
|
--input "${ASSETS_SRC_DIR}"
|
|
--output "${ASSETS_RUNTIME_DIR}"
|
|
DEPENDS TheChef
|
|
)
|
|
|