]> granicus.if.org Git - graphviz/commitdiff
CMake: enable lib/glcomp
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 20 Mar 2022 23:37:07 +0000 (16:37 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Mar 2022 05:31:13 +0000 (22:31 -0700)
Interestingly enabling this revealed that lib/glcomp also depends on Pango,
something unexpressed in either the Autotools or MS Build build systems.

Gitlab: #1836

lib/CMakeLists.txt
lib/glcomp/CMakeLists.txt [new file with mode: 0644]

index 1a311df5667055cab05106785c29ed5c5105c556..6eccf6cdab99b9aaee845410e331a070fbd55e87 100644 (file)
@@ -7,6 +7,7 @@ add_subdirectory(dotgen)
 add_subdirectory(edgepaint)
 add_subdirectory(expr)
 add_subdirectory(fdpgen)
+add_subdirectory(glcomp)
 add_subdirectory(gvpr)
 add_subdirectory(ingraphs)
 add_subdirectory(label)
diff --git a/lib/glcomp/CMakeLists.txt b/lib/glcomp/CMakeLists.txt
new file mode 100644 (file)
index 0000000..89ea35c
--- /dev/null
@@ -0,0 +1,66 @@
+if(with_smyrna)
+
+  find_package(Freetype)
+  find_package(GLUT)
+  find_package(GTK2 COMPONENTS gtk glade)
+  find_package(PANGOCAIRO)
+  find_package(PkgConfig)
+  if(PKG_CONFIG_FOUND)
+    pkg_check_modules(XRENDER xrender)
+  endif()
+
+  if(Freetype_FOUND AND GLUT_FOUND AND GTK2_FOUND AND PANGOCAIRO_FOUND
+     AND XRENDER_FOUND)
+
+    add_library(glcomp
+      glcompbutton.h
+      glcompdefs.h
+      glcompfont.h
+      glcompimage.h
+      glcomplabel.h
+      glcompmouse.h
+      glcomppanel.h
+      glcompset.h
+      glcomptextpng.h
+      glcomptexture.h
+      glpangofont.h
+      glutils.h
+
+      glcompbutton.c
+      glcompfont.c
+      glcompimage.c
+      glcomplabel.c
+      glcompmouse.c
+      glcomppanel.c
+      glcompset.c
+      glcomptextpng.c
+      glcomptexture.c
+      glpangofont.c
+      glutils.c
+    )
+
+    target_include_directories(glcomp PRIVATE
+      ${GRAPHVIZ_LIB_DIR}
+      ${GRAPHVIZ_LIB_DIR}/common
+    )
+
+    target_include_directories(glcomp SYSTEM PRIVATE
+      ${Freetype_INCLUDE_DIRS}
+      ${GLUT_INCLUDE_DIRS}
+      ${GTK2_INCLUDE_DIRS}
+      ${PANGOCAIRO_INCLUDE_DIRS}
+      ${XRENDER_INCLUDE_DIRS}
+    )
+
+    target_link_libraries(glcomp PRIVATE
+      ${Freetype_LIBRARIES}
+      ${GLUT_LIBRARIES}
+      ${GTK2_LIBRARIES}
+      ${MATH_LIB}
+      ${PANGOCAIRO_LIBRARIES}
+      ${XRENDER_LIBRARIES}
+    )
+
+  endif()
+
+endif()