summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
author0scar <qgt268@alumni.ku.dk>2024-01-29 12:43:52 +0000
committer0scar <qgt268@alumni.ku.dk>2024-02-01 21:15:26 +0000
commitd549e96032614b275fab7b2810638bf9b360fcf2 (patch)
tree15492a158461e6e9e849d6c14fcc260344b13ee1 /CMakeLists.txt
parent5caf58e76f085b80bb2b17f4ff6781fafc2f222c (diff)
Intialize GLFW and GLEW
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 15 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f6f35a..47625f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,7 @@ else()
endif()
include(CMakeDependentOption)
+include(FetchContent)
option(ASAN "Enable address sanitizer. Only enabled when DAW_BUILD_DEBUG=ON")
option(UBSAN "Enable undefined behaviour sanitizer. Only enabled when DAW_BUILD_DEBUG=ON")
@@ -68,7 +69,7 @@ execute_process(COMMAND
OUTPUT_STRIP_TRAILING_WHITESPACE
)
-#
+## Versioning
string(TIMESTAMP COMPILATION_DATE "%F")
set(ENGINE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
@@ -77,7 +78,16 @@ set(ENGINE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(ENGINE_VERSION_TWEAK ${GIT_SHA})
string(TOLOWER "${CMAKE_BUILD_TYPE}" ENGINE_BUILD_TYPE)
-##
+## Packages
+find_package(glfw3 3.3 REQUIRED)
+find_package(GLEW 2.2 REQUIRED)
+FetchContent_Declare(cglm
+ GIT_REPOSITORY https://github.com/recp/cglm.git
+ GIT_TAG v0.9.2
+)
+FetchContent_MakeAvailable(cglm)
+
+## Compilation information
set(ENGINE_SOURCES
src/btree.c
@@ -108,6 +118,9 @@ target_include_directories(daw PUBLIC
target_link_libraries(${PROJECT_NAME}
SDL2 SDL2_image SDL2_ttf
+ glfw
+ GLEW
+ cglm
$<$<NOT:$<PLATFORM_ID:Windows>>:m>
$<$<BOOL:${DAW_BUILD_HOTRELOAD}>:dl>
$<$<AND:$<NOT:$<C_COMPILER_ID:MSVC>>,$<BOOL:${DAW_BUILD_UBSAN}>>:ubsan>