Files
punchie-engine/CMakeLists.txt
T

64 lines
1.2 KiB
CMake

cmake_minimum_required(VERSION 3.10)
project(Engine)
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/Game.c
src/Window.c
src/Renderer.c
)
target_include_directories(${PROJECT_NAME} PUBLIC
${CMAKE_CURRENT_BINARY_DIR}
include
extern/SDL2/SDL/include
extern/SDL2/SDL_mixer/include
extern/SDL2/SDL_image
extern/SDL2/SDL_ttf
)
target_link_libraries(${PROJECT_NAME} PUBLIC
SDL2
SDL2_image
SDL2_mixer
SDL2_ttf
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/engine_build_config.h
include/constants.h
include/Game.h
include/Window.h
include/Renderer.h
include/ObjectStore.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)