]> granicus.if.org Git - graphviz/commitdiff
Add plugin/core to CMake build
authorErwin Janssen <erwinjanssen@outlook.com>
Tue, 14 Mar 2017 20:53:58 +0000 (21:53 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Thu, 6 Apr 2017 19:38:02 +0000 (21:38 +0200)
The dynamic library 'gvplugin_core' is the first library from `plugin`
added to the CMake build. It has no dependencies outside the libraries
in `lib`.

CMakeLists.txt
plugin/CMakeLists.txt [new file with mode: 0644]
plugin/core/CMakeLists.txt [new file with mode: 0644]

index cd1b8bc9506a8eb7847904a2eaa2a013d3ca6fbe..82b4d0a5de17f973b7d9ebdcaa94b487aecf157c 100644 (file)
@@ -136,3 +136,4 @@ include(CPack)
 
 # ======================= Specify subdirectories to build ======================
 add_subdirectory(lib)
+add_subdirectory(plugin)
diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ad6d478
--- /dev/null
@@ -0,0 +1 @@
+add_subdirectory(core)
diff --git a/plugin/core/CMakeLists.txt b/plugin/core/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ffe3906
--- /dev/null
@@ -0,0 +1,64 @@
+include_directories(
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_BINARY_DIR}
+    ${TOP_SOURCE_DIR}
+    ${GRAPHVIZ_LIB_DIR}/ast
+    ${GRAPHVIZ_LIB_DIR}/cdt
+    ${GRAPHVIZ_LIB_DIR}/cgraph
+    ${GRAPHVIZ_LIB_DIR}/common
+    ${GRAPHVIZ_LIB_DIR}/expr
+    ${GRAPHVIZ_LIB_DIR}/gvc
+    ${GRAPHVIZ_LIB_DIR}/gvpr
+    ${GRAPHVIZ_LIB_DIR}/pathplan
+    ${GRAPHVIZ_LIB_DIR}/sfio
+    ${GRAPHVIZ_LIB_DIR}/vmalloc
+    ${GRAPHVIZ_LIB_DIR}/xdot
+)
+
+# Generate ps.h from ps.txt
+add_custom_command(
+    OUTPUT ps.h
+    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ps.txt
+    COMMAND ${AWK_EXECUTABLE} -f ${TOP_SOURCE_DIR}/awk/stringize.awk
+            ${CMAKE_CURRENT_SOURCE_DIR}/ps.txt > ${CMAKE_CURRENT_BINARY_DIR}/ps.h
+)
+
+add_library(gvplugin_core SHARED
+    # Header files
+    ps.h
+
+    # Source files
+       gvloadimage_core.c
+       gvplugin_core.c
+       gvrender_core_dot.c
+       gvrender_core_json.c
+       gvrender_core_fig.c
+       gvrender_core_map.c
+       gvrender_core_mp.c
+       gvrender_core_pic.c
+       gvrender_core_pov.c
+       gvrender_core_ps.c
+       gvrender_core_svg.c
+       gvrender_core_tk.c
+       gvrender_core_vml.c
+)
+
+target_link_libraries(gvplugin_core
+    cdt
+    cgraph
+    gvc
+)
+
+# Installation location of library files
+install(
+    TARGETS gvplugin_core
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+    LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+)
+
+# Specify library version and soversion
+set_target_properties(gvplugin_core PROPERTIES
+    VERSION 6.0.0
+    SOVERSION 6
+)