]> granicus.if.org Git - graphviz/commitdiff
CMake: enable 'smyrna'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 21 Mar 2022 04:02:58 +0000 (21:02 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 29 Mar 2022 23:44:36 +0000 (16:44 -0700)
Gitlab: #1836, #1854

CMakeLists.txt
cmd/CMakeLists.txt
cmd/smyrna/CMakeLists.txt [new file with mode: 0644]
share/CMakeLists.txt [new file with mode: 0644]
share/examples/CMakeLists.txt [new file with mode: 0644]
share/gui/CMakeLists.txt [new file with mode: 0644]

index e77e87c547c886cb99aaab04aa4cdf72dc1ac72d..b9deb33db0e61d40b7677327e42edb844df59dbe 100644 (file)
@@ -71,6 +71,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
   set(MAN_INSTALL_DIR     "${CMAKE_INSTALL_MANDIR}")
   set(libdir              "${CMAKE_INSTALL_FULL_LIBDIR}")
   set(includedir          "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
+  set(DATA_INSTALL_DIR    "${CMAKE_INSTALL_FULL_DATAROOTDIR}")
 else()
   set(BINARY_INSTALL_DIR  bin)
   set(LIBRARY_INSTALL_DIR lib)
@@ -78,6 +79,7 @@ else()
   set(MAN_INSTALL_DIR     share/man)
   set(libdir              "${CMAKE_INSTALL_PREFIX}/${LIBRARY_INSTALL_DIR}")
   set(includedir          "${CMAKE_INSTALL_PREFIX}/include")
+  set(DATA_INSTALL_DIR    "${CMAKE_INSTALL_PREFIX}/share")
 endif()
 
 set(PLUGIN_INSTALL_DIR      ${LIBRARY_INSTALL_DIR}/graphviz)
@@ -283,6 +285,7 @@ add_subdirectory(contrib/diffimg)
 add_subdirectory(lib)
 add_subdirectory(plugin)
 add_subdirectory(cmd)
+add_subdirectory(share)
 if(with_cxx_tests)
   add_subdirectory(tests)
 endif()
index 2cead10fc2aad72f7bebf288f687a48d5ae4940f..b4338d508805648cd46c3621523a236af96c3322 100644 (file)
@@ -2,4 +2,5 @@ add_subdirectory(dot)
 add_subdirectory(edgepaint)
 add_subdirectory(gvpr)
 add_subdirectory(mingle)
+add_subdirectory(smyrna)
 add_subdirectory(tools)
diff --git a/cmd/smyrna/CMakeLists.txt b/cmd/smyrna/CMakeLists.txt
new file mode 100644 (file)
index 0000000..59fa5a8
--- /dev/null
@@ -0,0 +1,150 @@
+if(with_smyrna)
+
+  if(with_expat)
+    find_package(EXPAT REQUIRED)
+  endif()
+  find_package(Freetype REQUIRED)
+  find_package(GLUT REQUIRED)
+  find_package(GTK2 REQUIRED COMPONENTS gtk glade)
+  find_package(PkgConfig REQUIRED)
+  pkg_check_modules(FONTCONFIG REQUIRED fontconfig)
+  pkg_check_modules(GTKGLEXT REQUIRED gtkglext-1.0)
+  pkg_check_modules(GTS REQUIRED gts)
+  pkg_check_modules(XRENDER REQUIRED xrender)
+
+  add_definitions(-DSMYRNA_PATH="${DATA_INSTALL_DIR}/graphviz/smyrna")
+
+  add_executable(smyrna
+    arcball.h
+    draw.h
+    glexpose.h
+    glmotion.h
+    gltemplate.h
+    glutrender.h
+    gui/appmouse.h
+    gui/callbacks.h
+    gui/datalistcallbacks.h
+    gui/frmobjectui.h
+    gui/glcompui.h
+    gui/gui.h
+    gui/menucallbacks.h
+    gui/toolboxcallbacks.h
+    gui/topviewsettings.h
+    gvprpipe.h
+    hier.h
+    hotkeymap.h
+    polytess.h
+    selectionfuncs.h
+    smyrna_utils.h
+    smyrnadefs.h
+    support.h
+    topfisheyeview.h
+    topviewfuncs.h
+    tvnodes.h
+    viewport.h
+    viewportcamera.h
+
+    arcball.c
+    draw.c
+    glexpose.c
+    glmotion.c
+    gltemplate.c
+    gui/appmouse.c
+    gui/callbacks.c
+    gui/datalistcallbacks.c
+    gui/frmobjectui.c
+    gui/glcompui.c
+    gui/gui.c
+    gui/menucallbacks.c
+    gui/toolboxcallbacks.c
+    gui/topviewsettings.c
+    glutrender.c
+    gvprpipe.c
+    hier.c
+    hotkeymap.c
+    main.c
+    polytess.c
+    selectionfuncs.c
+    smyrna_utils.c
+    topfisheyeview.c
+    topviewfuncs.c
+    tvnodes.c
+    viewport.c
+    viewportcamera.c
+  )
+
+  target_include_directories(smyrna PRIVATE
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${GRAPHVIZ_LIB_DIR}
+    ${GRAPHVIZ_LIB_DIR}/cdt
+    ${GRAPHVIZ_LIB_DIR}/cgraph
+    ${GRAPHVIZ_LIB_DIR}/common
+    ${GRAPHVIZ_LIB_DIR}/gvc
+    ${GRAPHVIZ_LIB_DIR}/gvpr
+    ${GRAPHVIZ_LIB_DIR}/pathplan
+    ${GRAPHVIZ_LIB_DIR}/xdot
+    gui
+  )
+
+  target_include_directories(smyrna SYSTEM PRIVATE
+    ${EXPAT_INCLUDE_DIRS}
+    ${FONTCONFIG_INCLUDE_DIRS}
+    ${Freetype_INCLUDE_DIRS}
+    ${GLUT_INCLUDE_DIRS}
+    ${GTK2_INCLUDE_DIRS}
+    ${GTKGLEXT_INCLUDE_DIRS}
+    ${GTS_INCLUDE_DIRS}
+    ${XRENDER_INCLUDE_DIRS}
+  )
+
+  target_link_libraries(smyrna
+    cdt
+    cgraph
+    expr
+    glcomp
+    gvc
+    gvpr
+    ingraphs
+    neatogen
+    pathplan
+    topfish
+    xdot
+    ${EXPAT_LIBRARIES}
+    ${FONTCONFIG_LIBRARIES}
+    ${Freetype_LIBRARIES}
+    ${GLUT_LIBRARIES}
+    ${GTK2_LIBRARIES}
+    ${GTKGLEXT_LIBRARIES}
+    ${GTS_LIBRARIES}
+    ${MATH_LIB}
+    ${XRENDER_LIBRARIES}
+  )
+
+  install(
+    TARGETS smyrna
+    RUNTIME DESTINATION ${BINARY_INSTALL_DIR}
+    LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
+    ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR}
+  )
+
+  if(GZIP)
+    add_custom_target(man-smyrna ALL DEPENDS smyrna.1.gz
+                      COMMENT "smyrna man page")
+    add_custom_command(
+      OUTPUT smyrna.1.gz
+      COMMAND ${GZIP} -9 --no-name --to-stdout smyrna.1
+        >"${CMAKE_CURRENT_BINARY_DIR}/smyrna.1.gz"
+      MAIN_DEPENDENCY smyrna.1
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+      COMMENT "compress smyrna man page")
+    install(
+      FILES ${CMAKE_CURRENT_BINARY_DIR}/smyrna.1.gz
+      DESTINATION ${MAN_INSTALL_DIR}/man1)
+  else()
+    install(
+      FILES smyrna.1
+      DESTINATION ${MAN_INSTALL_DIR}/man1
+    )
+  endif()
+
+endif()
diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4ea52ed
--- /dev/null
@@ -0,0 +1,2 @@
+add_subdirectory(examples)
+add_subdirectory(gui)
diff --git a/share/examples/CMakeLists.txt b/share/examples/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d995710
--- /dev/null
@@ -0,0 +1,9 @@
+if(with_smyrna)
+
+  install(
+    FILES
+      4elt.gv
+      world.gv
+    DESTINATION ${DATA_INSTALL_DIR}/graphviz/examples)
+
+endif()
diff --git a/share/gui/CMakeLists.txt b/share/gui/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8379b51
--- /dev/null
@@ -0,0 +1,38 @@
+if(with_smyrna)
+
+  install(
+    FILES
+      2D.png
+      3D.png
+      arial.tga
+      attr_widgets.dot
+      attrs.txt
+      center.png
+      cursor.png
+      details.png
+      fisheye.png
+      fisheye.raw
+      fit_to_screen.png
+      mod_3D.png
+      mod_fisheye.png
+      mouse_actions.txt
+      move.png
+      new_delete.png
+      no_fisheye.png
+      pan.png
+      pan.raw
+      selectr.png
+      selectx.png
+      single_select.png
+      smyrna.glade
+      template.dot
+      zoom.png
+      zoom.png
+      zoom.raw
+      zoom_in.png
+      zoom_out.png
+      zoomin.png
+      zoomout.png
+    DESTINATION ${DATA_INSTALL_DIR}/graphviz/smyrna)
+
+endif()