Files
punchie-engine/CMakeLists.txt
T

80 lines
1.6 KiB
CMake

cmake_minimum_required(VERSION 3.10)
project(Punchie)
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(DEBUG_ENGINE ON)
endif()
configure_file(engine_build_config.h.in engine_build_config.h)
# VARIABLES
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(BUILD_SHARED_LIBS ON)
if(CMAKE_HOST_WIN32)
# Export both *.lib and *.dll on Windows
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../lib")
# TARGETS
add_library(${PROJECT_NAME} SHARED
src/GameEngine.c
src/Window.c
src/Renderer.c
src/ObjectStore.c
src/AssetManager.c
src/BitmapFont.c
src/reusable_ids.c
src/math_utils.c
)
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_BINARY_DIR}
include
intern/pakrd
extern/SDL2/SDL/include
extern/SDL2/SDL_mixer/include
extern/SDL2/SDL_image
extern/SDL2/SDL_ttf
)
target_link_directories(${PROJECT_NAME} PUBLIC intern/pakrd)
target_link_libraries(${PROJECT_NAME} PUBLIC
pakrd
SDL2
SDL2_image
SDL2_mixer
SDL2_ttf
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/engine_build_config.h
include/aliases.h
include/constants.h
include/GameEngine.h
include/Window.h
include/Renderer.h
include/ObjectStore.h
include/AssetManager.h
include/BitmapFont.h
include/reusable_ids.h
include/math_utils.h
intern/pakrd/pak.h
CONFIGURATIONS Release
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(TARGETS ${PROJECT_NAME}
CONFIGURATIONS Release
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
# SUB-DIRECTORIES
add_subdirectory(extern)