mirror of
https://git.shylie.info/shylie/glerminal.git
synced 2024-11-09 11:50:04 +00:00
65 lines
1.2 KiB
CMake
65 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.28)
|
|
|
|
project(glerminal
|
|
VERSION 0.1.0
|
|
LANGUAGES C CXX
|
|
)
|
|
|
|
option(GLERMINAL_OPENGL_DEBUG_CONTEXT "" OFF)
|
|
set(GLERMINAL_GRID_WIDTH 40 CACHE STRING "")
|
|
set(GLERMINAL_GRID_HEIGHT 25 CACHE STRING "")
|
|
set(GLERMINAL_LAYER_COUNT 64 CACHE STRING "")
|
|
set(GLERMINAL_CELL_SCALE 4 CACHE STRING "")
|
|
|
|
configure_file(source/glerminal-config.h.in glerminal-config.h @ONLY)
|
|
|
|
add_subdirectory(glfw)
|
|
|
|
add_library(glerminal STATIC
|
|
${CMAKE_CURRENT_BINARY_DIR}/glerminal-config.h
|
|
include/glerminal.h
|
|
|
|
source/glerminal-private.h
|
|
source/glerminal.cpp
|
|
|
|
source/glad/glad.h
|
|
source/KHR/khrplatform.h
|
|
source/glad.c
|
|
)
|
|
|
|
set_target_properties(glerminal
|
|
PROPERTIES
|
|
CXX_STANDARD 11
|
|
)
|
|
|
|
target_include_directories(glerminal
|
|
PUBLIC
|
|
include
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
PRIVATE
|
|
source
|
|
)
|
|
|
|
target_link_libraries(glerminal
|
|
PRIVATE
|
|
glfw
|
|
)
|
|
|
|
target_compile_definitions(glerminal
|
|
PUBLIC
|
|
GLERMINAL_VERSION=${PROJECT_VERSION}
|
|
GLERMINAL_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}
|
|
GLERMINAL_VERSION_MINOR=${PROJECT_VERSION_MINOR}
|
|
GLERMINAL_VERSION_PATCH=${PROJECT_VERSION_PATCH}
|
|
)
|
|
|
|
if (MSVC)
|
|
target_link_options(glerminal
|
|
PUBLIC
|
|
"/ENTRY:mainCRTStartup"
|
|
)
|
|
endif()
|
|
|
|
if (PROJECT_IS_TOP_LEVEL)
|
|
add_subdirectory(examples examples)
|
|
endif() |