cmake_minimum_required(VERSION 3.28) project(glerminal VERSION 0.1.0 LANGUAGES C CXX ) option(GLERMINAL_OPENGL_DEBUG_CONTEXT "" OFF) option(GLERMINAL_TEST "" 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_subdirectory(Lua) add_library(glerminallib STATIC ${CMAKE_CURRENT_BINARY_DIR}/glerminal-config.h include/glerminal.h source/stb_image.h source/glerminal-private.h source/glerminal.cpp source/glad/glad.h source/KHR/khrplatform.h source/glad.c source/miniaudio.h source/miniaudio.c ) set_target_properties(glerminallib PROPERTIES CXX_STANDARD 11 ) target_include_directories(glerminallib PUBLIC include ${CMAKE_CURRENT_BINARY_DIR} PRIVATE source ) target_link_libraries(glerminallib PUBLIC glfw ) target_compile_definitions(glerminallib 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(glerminallib PUBLIC "/ENTRY:mainCRTStartup" ) endif() add_executable(glerminal WIN32 source/glerminal-main.cpp ) target_link_libraries(glerminal PRIVATE glerminallib lua_static ) if (PROJECT_IS_TOP_LEVEL) add_subdirectory(examples examples) endif() if (GLERMINAL_TEST) add_subdirectory(tests tests) endif()