summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt43
1 files changed, 20 insertions, 23 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25064f6..3dec1d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,33 +2,29 @@ cmake_minimum_required(VERSION 3.2)
project(honey_engine_demo)
set(CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic")
+set(CMAKE_C_FLAGS "-g")
find_package(OpenGL REQUIRED)
find_package(Lua51 REQUIRED)
include_directories(${LUA_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src)
-set(CMAKE_C_FLAGS "-g")
+set(SRC_ROOT ${CMAKE_SOURCE_DIR}/src)
-add_library(glad src/glad/glad.c)
-add_library(stb_image src/stb_image/stb_image.c)
+add_library(glad ${SRC_ROOT}/gl/glad/glad.c)
+# add_library(stb_image src/stb_image/stb_image.c)
+
+
+
+set(HONEY_LIB_FILES
+ ${SRC_ROOT}/logging/logging.c
+ ${SRC_ROOT}/gl/honey_gl.c
+ )
-set(SRC_ROOT ${CMAKE_SOURCE_DIR}/src)
set(SOURCE_FILES
${SRC_ROOT}/main.c
- ${SRC_ROOT}/cairo_bindings.c
- ${SRC_ROOT}/glm_bindings.c
- ${SRC_ROOT}/glm_vec3_bindings.c
- ${SRC_ROOT}/glm_vec4_bindings.c
- ${SRC_ROOT}/glm_mat3_bindings.c
- ${SRC_ROOT}/glm_mat4_bindings.c
- ${SRC_ROOT}/honey.c
- ${SRC_ROOT}/input.c
- ${SRC_ROOT}/honey_lua.c
- ${SRC_ROOT}/mesh.c
- ${SRC_ROOT}/shader.c
- ${SRC_ROOT}/texture.c
- ${SRC_ROOT}/window.c)
+ ${HONEY_LIB_FILES}
+ )
add_executable(honey ${SOURCE_FILES})
@@ -43,16 +39,17 @@ target_link_libraries(honey ${LIBRARIES})
# build tests (optional)
-set(TEST_ROOT ${CMAKE_SOURCE_DIR}/src/test)
set(TEST_SOURCES
- ${TEST_ROOT}/test_main.c
- ${TEST_ROOT}/mock_queue.c
+ ${SRC_ROOT}/test/test_main.c
+ ${HONEY_LIB_FILES}
- ${TEST_ROOT}/mock_queue_tests.c
- ${TEST_ROOT}/logging/logging_tests.c
+ ${SRC_ROOT}/test/mock_queue.c
+ ${SRC_ROOT}/test/mock_queue.test.c
- ${SRC_ROOT}/logging/logging.c
+ ${SRC_ROOT}/logging/logging.test.c
+ ${SRC_ROOT}/gl/honey_gl.test.c
)
+
add_executable(test EXCLUDE_FROM_ALL ${TEST_SOURCES})
set_target_properties(test PROPERTIES
C_STANDARD 99