Add preview rendering skeleton

This commit is contained in:
Mario Hüttel 2022-04-18 14:17:21 +02:00
parent 8b1f667819
commit f42d61192a
6 changed files with 29 additions and 3 deletions

View File

@ -1,3 +1,7 @@
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)
project(gds-render LANGUAGES C)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@ -24,7 +28,7 @@ if(NOT WIN32)
set(BoldWhite "${Esc}[1;37m")
endif()
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)
find_package(PkgConfig REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
@ -81,6 +85,12 @@ set(FORT_ENABLE_TESTING OFF CACHE INTERNAL "")
add_subdirectory(3rdparty/libfort)
if(OPENGL_PREVIEW)
message("${Green}OpenGL preview activated${ColorReset}")
add_definitions(-DGDS_RENDER_OPGENGL_PREVIEW)
add_subdirectory(preview-rendering)
endif(OPENGL_PREVIEW)
link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS})
add_definitions(${GLIB2_CFLAGS_OTHER})
@ -88,6 +98,10 @@ add_executable(${PROJECT_NAME} ${SOURCE} ${SOURCE_GENERATED})
add_dependencies(${PROJECT_NAME} glib-resources)
add_dependencies(${PROJECT_NAME} version)
add_dependencies(${PROJECT_NAME} translations)
if(OPENGL_PREVIEW)
add_dependencies(${PROJECT_NAME} opengl-preview)
target_link_libraries(${PROJECT_NAME} opengl-preview)
endif(OPENGL_PREVIEW)
install (TARGETS ${PROJECT_NAME}
RUNTIME

View File

@ -1,2 +1,3 @@
add_subdirectory(plugin-example)
add_custom_target(plugins DEPENDS pluginexample)
cmake_minimum_required(VERSION 3.0)

View File

@ -1,5 +1,5 @@
project(pluginexample)
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)
find_package(PkgConfig REQUIRED)
pkg_search_module(PYTHON REQUIRED python3)

View File

@ -0,0 +1,7 @@
project(opengl-preview)
cmake_minimum_required(VERSION 3.0)
aux_source_directory("src" SRCS)
add_library(${PROJECT_NAME} STATIC ${SRCS})
target_include_directories(${PROJECT_NAME} PUBLIC "include")

View File

@ -0,0 +1,4 @@
int foobar(void)
{
return 42;
}

View File

@ -1,4 +1,5 @@
project(gds-render-test)
cmake_minimum_required(VERSION 3.0)
add_custom_target(test "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}" "-r compact" "-s" DEPENDS ${PROJECT_NAME})
@ -22,7 +23,6 @@ if(NOT WIN32)
set(BoldWhite "${Esc}[1;37m")
endif()
cmake_minimum_required(VERSION 2.8)
find_package(PkgConfig REQUIRED)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/catch-framework")