From 8e66150aae1b2b79118cb8dc23dcc3f02df337da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 1 Oct 2019 14:25:27 +0200 Subject: [PATCH] Add cglm to project --- CMakeLists.txt | 5 +++-- cglm/CMakeLists.txt | 14 ++++++++++++++ src/main.c | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 cglm/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 24ddff4..c93e9dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ find_package(OpenCL REQUIRED) add_subdirectory(glade) +add_subdirectory(cglm) include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${OPENCL_INCLUDE_DIRS}) link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS}) @@ -25,9 +26,9 @@ aux_source_directory("src" SOURCES) add_compile_options(-Wall) add_executable(${PROJECT_NAME} ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/glade/resources.c) -add_dependencies(${PROJECT_NAME} glib-resources) +add_dependencies(${PROJECT_NAME} glib-resources cglm) SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/glade/resources.c PROPERTIES GENERATED 1) -target_link_libraries(${PROJECT_NAME} ${GLIB_LDFLAGS} ${GTK3_LDFLAGS} ${CAIRO_LDFLAGS} m pthread ${OPENCL_LIBRARIES} epoxy) +target_link_libraries(${PROJECT_NAME} ${GLIB_LDFLAGS} ${GTK3_LDFLAGS} ${CAIRO_LDFLAGS} m pthread ${OPENCL_LIBRARIES} epoxy cglm) install (TARGETS ${PROJECT_NAME} DESTINATION bin) message(STATUS "OpenCL found: ${OPENCL_FOUND}") diff --git a/cglm/CMakeLists.txt b/cglm/CMakeLists.txt new file mode 100644 index 0000000..bac8874 --- /dev/null +++ b/cglm/CMakeLists.txt @@ -0,0 +1,14 @@ +project(cglm) +cmake_minimum_required(VERSION 2.8) + +include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${OPENCL_INCLUDE_DIRS}) +link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS}) +add_definitions(${GLIB2_CFLAGS_OTHER}) + +aux_source_directory("cglm/src" SOURCES) +add_library(${PROJECT_NAME} STATIC ${SOURCES}) +add_compile_options(-Wall -std=gnu99 -O3 -Wstrict-aliasing=2 -fstrict-aliasing -pedantic) +target_include_directories(${PROJECT_NAME} PUBLIC "cglm/include") + +target_link_libraries(${PROJECT_NAME} m) + diff --git a/src/main.c b/src/main.c index 2f51706..1bf4254 100644 --- a/src/main.c +++ b/src/main.c @@ -7,6 +7,7 @@ #include #include #include +#include static const char * const vertex_shader = "#version 330 core\n \ layout (location = 0) in vec3 aPos;\n \