summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-08-23 13:38:27 -0500
committersanine <sanine.not@pm.me>2022-08-23 13:38:27 -0500
commit3afbf2a13b2dada445fb667bf25600407fea480a (patch)
tree551329e6f74fc9f177616de0d6739e8b5331ae96 /CMakeLists.txt
parent261e3f991221fbad6bbf262f5e65b773e4b6c73e (diff)
parent25ed7eb9f84e9a822f698ad803901fbb2a5354cf (diff)
:wMerge branch 'gl-window' into main
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt63
1 files changed, 31 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf0ee15..ea8fca3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,48 +1,47 @@
cmake_minimum_required(VERSION 3.2)
-project(honey_engine_demo)
+project(honey_engine)
-set(CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic")
-set(CMAKE_C_FLAGS "-g")
+if (UNIX)
+ set(CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic")
+ set(CMAKE_C_FLAGS "-g")
+endif()
find_package(OpenGL REQUIRED)
-find_package(Lua51 REQUIRED)
set(SRC_ROOT ${CMAKE_SOURCE_DIR}/src)
set(LIB_ROOT ${CMAKE_SOURCE_DIR}/libs)
include_directories(
- ${LUA_INCLUDE_DIR}
+ ${LIB_ROOT}/lua-5.1.5/src
${CMAKE_SOURCE_DIR}/src
- ${CMAKE_SOURCE_DIR}/libs/honeysuckle/src
+ ${LIB_ROOT}/honeysuckle/src
+ ${LIB_ROOT}/glfw-3.3.8/include
+ ${LIB_ROOT}/cglm/include
)
+# disable byte-alignment in cglm
+add_definitions(-DCGLM_ALL_UNALIGNED)
+
# link to third-party included libraries
link_directories(${LIB_ROOT}/assimp/lib)
link_directories(${LIB_ROOT}/honeysuckle)
+link_directories(${LIB_ROOT}/glfw-3.3.8/src)
-# add_library(glad ${SRC_ROOT}/gl/glad/glad.c)
-# add_library(stb_image src/stb_image/stb_image.c)
-add_subdirectory(${LIB_ROOT}/assimp)
+add_subdirectory(${LIB_ROOT}/lua-5.1.5)
+#add_subdirectory(${LIB_ROOT}/assimp)
add_subdirectory(${LIB_ROOT}/honeysuckle)
add_subdirectory(${LIB_ROOT}/cglm)
+add_subdirectory(${LIB_ROOT}/glfw-3.3.8)
-set(HONEY_LIB_FILES
- ${SRC_ROOT}/logging/logging.c
-)
+set(HONEY_SOURCE ${SRC_ROOT}/main.c)
+add_executable(honey ${HONEY_SOURCE})
-set(SOURCE_FILES
- ${SRC_ROOT}/main.c
- ${HONEY_LIB_FILES}
- )
-
-add_executable(honey ${SOURCE_FILES})
-
-set(LIBRARIES ${LUA_LIBRARIES} honeysuckle assimp glad cairo m)
+set(LIBRARIES lua5.1 honeysuckle glfw)
if (WIN32)
- set(LIBRARIES ${LIBRARIES} glfw3 opengl32)
+ set(LIBRARIES ${LIBRARIES} opengl32)
else()
- set(LIBRARIES ${LIBRARIES} glfw GL dl)
+ set(LIBRARIES ${LIBRARIES} GL dl m)
endif()
target_link_libraries(honey ${LIBRARIES})
@@ -52,16 +51,16 @@ target_link_libraries(honey ${LIBRARIES})
string(LENGTH "${CMAKE_SOURCE_DIR}/" SOURCE_PATH_SIZE)
add_definitions("-DSOURCE_PATH_SIZE=${SOURCE_PATH_SIZE}")
-set(TEST_SOURCES
- ${SRC_ROOT}/test/lily-test.c
- ${SRC_ROOT}/test/honey-test.c
-
- ${SRC_ROOT}/logging/logging.test.c
- ${SRC_ROOT}/gl/window.test.c
-)
-
-add_executable(test EXCLUDE_FROM_ALL ${TEST_SOURCES})
+add_executable(test EXCLUDE_FROM_ALL)
set_target_properties(test PROPERTIES
C_STANDARD 99
CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic")
-target_link_libraries(test ${LUA_LIBRARIES} honeysuckle)
+target_link_libraries(test lua5.1 honeysuckle glfw dl)
+
+
+add_subdirectory(${SRC_ROOT}/gl)
+add_subdirectory(${SRC_ROOT}/logging)
+add_subdirectory(${SRC_ROOT}/image)
+add_subdirectory(${SRC_ROOT}/util)
+add_subdirectory(${SRC_ROOT}/test)
+add_subdirectory(${SRC_ROOT}/glm)