From 18f5b027d9bd166c7584d9f0b854fd92b61a8cd2 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 20 Mar 2022 16:37:07 -0700 Subject: [PATCH] CMake: enable lib/glcomp 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 | 1 + lib/glcomp/CMakeLists.txt | 66 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 lib/glcomp/CMakeLists.txt diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 1a311df56..6eccf6cda 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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 index 000000000..89ea35c84 --- /dev/null +++ b/lib/glcomp/CMakeLists.txt @@ -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() -- 2.40.0