2020-03-31 23:44:16 +02:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
project(gtkgraphview LANGUAGES C)
|
|
|
|
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_search_module(GLIB REQUIRED glib-2.0)
|
|
|
|
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
|
2020-04-02 00:32:11 +02:00
|
|
|
pkg_check_modules(EPOXY REQUIRED epoxy)
|
2020-03-31 23:44:16 +02:00
|
|
|
|
|
|
|
add_compile_options(-Wall -Wextra -Wold-style-declaration -Wuninitialized -Wmaybe-uninitialized -Wunused-parameter)
|
|
|
|
aux_source_directory("src" SRC_DIR)
|
|
|
|
|
2020-06-27 22:08:34 +02:00
|
|
|
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
message("${Yellow}Debug mode for shader locations used!${ColorReset}")
|
|
|
|
add_definitions(-DSHADER_DIRECTORY=\"${CMAKE_CURRENT_BINARY_DIR}/shaders\")
|
|
|
|
message("${BoldMagenta}${CMAKE_CURRENT_BINARY_DIR}/shaders used as shader directory${ColorReset}")
|
|
|
|
else(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
message("Global shader directory used. Make sure files in /usr/share/gtk-graph-view/shaders are available")
|
|
|
|
add_definitions(-DSHADER_DIRECTORY=\"/usr/share/gtk-graph-view/shaders\")
|
|
|
|
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
|
|
|
|
|
2020-03-31 23:44:16 +02:00
|
|
|
add_library(${PROJECT_NAME} SHARED ${SRC_DIR})
|
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
2020-04-02 00:32:11 +02:00
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE ${EPOXY_INCLUDE_DIRS})
|
2020-06-24 23:43:13 +02:00
|
|
|
target_link_libraries(${PROJECT_NAME} PUBLIC ${GLIB_LDFLAGS} ${GTK3_LDFLAGS} ${EPOXY_LDFLAGS} shimatta-opengl)
|
2020-04-02 00:32:11 +02:00
|
|
|
target_link_directories(${PROJECT_NAME} PUBLIC ${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${EPOXY_LINK_DIRS})
|
2020-03-31 23:44:16 +02:00
|
|
|
target_include_directories(${PROJECT_NAME} PUBLIC ${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS})
|
2020-06-27 22:08:34 +02:00
|
|
|
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shaders/passthrough3d.vertex.glsl"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/shaders/passthrough3d.vertex.glsl" COPYONLY)
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shaders/monochrome.fragment.glsl"
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/shaders/monochrome.fragment.glsl" COPYONLY)
|
|
|
|
|
|
|
|
|