glerminal/CMakeLists.txt

82 lines
1.5 KiB
CMake
Raw Normal View History

2024-05-09 19:42:12 +00:00
cmake_minimum_required(VERSION 3.28)
project(glerminal
VERSION 0.1.0
LANGUAGES C CXX
)
2024-05-24 01:33:15 +00:00
option(GLERMINAL_OPENGL_DEBUG_CONTEXT "" OFF)
option(GLERMINAL_TEST "" OFF)
2024-05-24 01:33:15 +00:00
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)
2024-05-09 19:42:12 +00:00
add_subdirectory(glfw)
2024-05-29 22:53:47 +00:00
add_subdirectory(Lua)
2024-05-09 19:42:12 +00:00
2024-05-29 22:53:47 +00:00
add_library(glerminallib STATIC
2024-05-24 01:33:15 +00:00
${CMAKE_CURRENT_BINARY_DIR}/glerminal-config.h
2024-05-09 19:42:12 +00:00
include/glerminal.h
2024-05-29 22:53:47 +00:00
source/stb_image.h
2024-05-09 19:42:12 +00:00
source/glerminal-private.h
source/glerminal.cpp
source/glad/glad.h
source/KHR/khrplatform.h
source/glad.c
)
2024-05-29 22:53:47 +00:00
set_target_properties(glerminallib
2024-05-09 19:42:12 +00:00
PROPERTIES
CXX_STANDARD 11
)
2024-05-29 22:53:47 +00:00
target_include_directories(glerminallib
2024-05-09 19:42:12 +00:00
PUBLIC
include
2024-05-24 01:33:15 +00:00
${CMAKE_CURRENT_BINARY_DIR}
2024-05-09 19:42:12 +00:00
PRIVATE
source
)
2024-05-29 22:53:47 +00:00
target_link_libraries(glerminallib
PUBLIC
2024-05-09 19:42:12 +00:00
glfw
)
2024-05-29 22:53:47 +00:00
target_compile_definitions(glerminallib
2024-05-09 19:42:12 +00:00
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)
2024-05-29 22:53:47 +00:00
target_link_options(glerminallib
2024-05-09 19:42:12 +00:00
PUBLIC
"/ENTRY:mainCRTStartup"
)
endif()
2024-05-29 22:53:47 +00:00
add_executable(glerminal WIN32
source/glerminal-main.cpp
)
target_link_libraries(glerminal
PRIVATE
glerminallib
lua_static
)
2024-05-09 19:42:12 +00:00
if (PROJECT_IS_TOP_LEVEL)
add_subdirectory(examples examples)
2024-05-26 03:16:23 +00:00
endif()
if (GLERMINAL_TEST)
2024-05-26 03:16:23 +00:00
add_subdirectory(tests tests)
2024-05-09 19:42:12 +00:00
endif()