From 74dfbd9b34a3eb1a2f2298be217825c836e63afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 12 Nov 2019 19:12:57 +0100 Subject: [PATCH] Add preliminary construct for plugin renderers (shared object renderers) --- CMakeLists.txt | 1 + doxygen/CMakeLists.txt | 2 +- plugins/CMakeLists.txt | 2 ++ plugins/python-renderer/CMakeLists.txt | 12 ++++++++++++ plugins/python-renderer/src/plugin-main.c | 7 +++++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 plugins/CMakeLists.txt create mode 100644 plugins/python-renderer/CMakeLists.txt create mode 100644 plugins/python-renderer/src/plugin-main.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bbfb23..3b5541b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ add_compile_options(-Wall -Wextra -Wold-style-declaration -Wuninitialized -Wmayb add_subdirectory(resources) add_subdirectory(doxygen) add_subdirectory(version) +add_subdirectory(plugins) include_directories(${GLIB_INCLUDE_DIRS} ${GTK3_INCLUDE_DIRS} ${CAIRO_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include) link_directories(${GLIB_LINK_DIRS} ${GTK3_LINK_DIRS} ${CAIRO_LINK_DIRS}) diff --git a/doxygen/CMakeLists.txt b/doxygen/CMakeLists.txt index 65b4801..4f06fef 100644 --- a/doxygen/CMakeLists.txt +++ b/doxygen/CMakeLists.txt @@ -6,5 +6,5 @@ if (DOXYGEN_FOUND) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Generating documentation with Doxygen") else (DOXYGEN_FOUND) - message("Doxygen need to be installed to generate the doxygen documentation") + message("Doxygen needs to be installed to generate the doxygen documentation") endif (DOXYGEN_FOUND) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt new file mode 100644 index 0000000..77f6100 --- /dev/null +++ b/plugins/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(python-renderer) +add_custom_target(plugins DEPENDS pythonrenderer) diff --git a/plugins/python-renderer/CMakeLists.txt b/plugins/python-renderer/CMakeLists.txt new file mode 100644 index 0000000..51e804f --- /dev/null +++ b/plugins/python-renderer/CMakeLists.txt @@ -0,0 +1,12 @@ +project(pythonrenderer) +cmake_minimum_required(VERSION 2.8) +find_package(PkgConfig REQUIRED) +pkg_search_module(PYTHON REQUIRED python3) + +aux_source_directory(src SOURCES) + +include_directories(${PYTHON_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include) +link_libraries(${PYTHON_LDFLAGS} version) + +add_library(${PROJECT_NAME} SHARED EXCLUDE_FROM_ALL ${SOURCES}) +add_dependencies(${PROJECT_NAME} version) diff --git a/plugins/python-renderer/src/plugin-main.c b/plugins/python-renderer/src/plugin-main.c new file mode 100644 index 0000000..dbcb3a3 --- /dev/null +++ b/plugins/python-renderer/src/plugin-main.c @@ -0,0 +1,7 @@ +#include +#include + +int a(void) +{ + return 0; +}