From 12ddcdd391314c6cde363344c3d9bf1b307a4d33 Mon Sep 17 00:00:00 2001 From: ellson Date: Sat, 8 Jul 2006 20:39:48 +0000 Subject: [PATCH] cmake updates --- CMakeLists.txt | 2 +- lib/agraph/CMakeLists.txt | 50 ++++------------------- lib/agraph/sources.cmake | 48 ++++++++++++++++++++++ lib/agutil/CMakeLists.txt | 7 +--- lib/agutil/sources.cmake | 10 +++++ lib/cdt/CMakeLists.txt | 27 ++++--------- lib/cdt/sources.cmake | 24 +++++++++++ lib/common/CMakeLists.txt | 79 +------------------------------------ lib/common/sources.cmake | 83 +++++++++++++++++++++++++++++++++++++++ lib/gd/CMakeLists.txt | 53 ++----------------------- lib/gd/sources.cmake | 51 ++++++++++++++++++++++++ lib/graph/CMakeLists.txt | 29 +++----------- lib/graph/sources.cmake | 29 ++++++++++++++ 13 files changed, 272 insertions(+), 220 deletions(-) create mode 100644 lib/agraph/sources.cmake create mode 100644 lib/agutil/sources.cmake create mode 100644 lib/cdt/sources.cmake create mode 100644 lib/common/sources.cmake create mode 100644 lib/gd/sources.cmake create mode 100644 lib/graph/sources.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 0207bcaf3..2dc43ad22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ PROJECT(graphviz) -SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake +SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) ADD_SUBDIRECTORY(lib) ADD_SUBDIRECTORY(plugin) diff --git a/lib/agraph/CMakeLists.txt b/lib/agraph/CMakeLists.txt index dc63ef6a0..f6d0795e6 100644 --- a/lib/agraph/CMakeLists.txt +++ b/lib/agraph/CMakeLists.txt @@ -2,59 +2,23 @@ ## Process this file with cmake to produce Makefile INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/lib/cdt ) - -########### next target ############### - ADD_CUSTOM_COMMAND( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT grammar.c - OUTPUT grammar.h - DEPENDS grammar.y - COMMAND yacc -dv grammar.y - COMMAND sed "s/yy/aag/g" < y.tab.c > grammar.c - COMMAND sed "s/yy/aag/g" < y.tab.h > grammar.h - COMMAND rm y.tab.c y.tab.h y.output + OUTPUT agraph.pdf + DEPENDS agraph.3 + COMMAND groff -Tps -man agraph.3 | ps2pdf - agraph.pdf ) -ADD_CUSTOM_COMMAND( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT scan.c - DEPENDS scan.l - COMMAND flex -i scan.l - COMMAND sed "s/yy/aag/g" < lex.yy.c > scan.c - COMMAND rm lex.yy.c -) +ADD_DEFINITIONS(-DVERSION='"1.0"') -SET(agraph_SRCS - agerror.c - apply.c - attr.c - edge.c - flatten.c - grammar.c - graph.c - id.c - imap.c - io.c - mem.c - node.c - obj.c - pend.c - rec.c - refstr.c - scan.c - subg.c - utils.c - write.c -) +########### next target ############### -ADD_LIBRARY(agraph STATIC ${agraph_SRCS}) +INCLUDE(${CMAKE_SOURCE_DIR}/lib/agraph/sources.cmake) +ADD_LIBRARY(agraph STATIC ${agraph_SRCS}) ########### install files ############### diff --git a/lib/agraph/sources.cmake b/lib/agraph/sources.cmake new file mode 100644 index 000000000..c5b748018 --- /dev/null +++ b/lib/agraph/sources.cmake @@ -0,0 +1,48 @@ +# $Id$ $Revision$ + +SET(agraph_SRCDIR ${CMAKE_SOURCE_DIR}/lib/agraph) + +INCLUDE_DIRECTORIES(${agraph_SRCDIR}) + +ADD_CUSTOM_COMMAND( + WORKING_DIRECTORY ${agraph_SRCDIR} + OUTPUT grammar.c + OUTPUT grammar.h + DEPENDS grammar.y + COMMAND yacc -dv grammar.y + COMMAND sed "s/yy/aag/g" < y.tab.c > grammar.c + COMMAND sed "s/yy/aag/g" < y.tab.h > grammar.h + COMMAND rm y.tab.c y.tab.h y.output +) + +ADD_CUSTOM_COMMAND( + WORKING_DIRECTORY ${agraph_SRCDIR} + OUTPUT scan.c + DEPENDS scan.l + COMMAND flex -i scan.l + COMMAND sed "s/yy/aag/g" < lex.yy.c > scan.c + COMMAND rm lex.yy.c +) + +SET(agraph_SRCS + ${agraph_SRCDIR}/agerror.c + ${agraph_SRCDIR}/apply.c + ${agraph_SRCDIR}/attr.c + ${agraph_SRCDIR}/edge.c + ${agraph_SRCDIR}/flatten.c + ${agraph_SRCDIR}/grammar.c + ${agraph_SRCDIR}/graph.c + ${agraph_SRCDIR}/id.c + ${agraph_SRCDIR}/imap.c + ${agraph_SRCDIR}/io.c + ${agraph_SRCDIR}/mem.c + ${agraph_SRCDIR}/node.c + ${agraph_SRCDIR}/obj.c + ${agraph_SRCDIR}/pend.c + ${agraph_SRCDIR}/rec.c + ${agraph_SRCDIR}/refstr.c + ${agraph_SRCDIR}/scan.c + ${agraph_SRCDIR}/subg.c + ${agraph_SRCDIR}/utils.c + ${agraph_SRCDIR}/write.c +) diff --git a/lib/agutil/CMakeLists.txt b/lib/agutil/CMakeLists.txt index 03fcdb293..c8e051466 100644 --- a/lib/agutil/CMakeLists.txt +++ b/lib/agutil/CMakeLists.txt @@ -2,19 +2,14 @@ ## Process this file with cmake to produce Makefile INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/lib/agraph ${CMAKE_SOURCE_DIR}/lib/cdt ) - ########### next target ############### -SET(agutil_SRCS - dynattr.c - nodeq.c -) +INCLUDE(${CMAKE_SOURCE_DIR}/lib/agutil/sources.cmake) ADD_LIBRARY(agutil STATIC ${agutil_SRCS}) diff --git a/lib/agutil/sources.cmake b/lib/agutil/sources.cmake new file mode 100644 index 000000000..f20d66088 --- /dev/null +++ b/lib/agutil/sources.cmake @@ -0,0 +1,10 @@ +# $Id$ $Revision$ + +SET(agutil_SRCDIR ${CMAKE_SOURCE_DIR}/lib/agutil) + +INCLUDE_DIRECTORIES(${agutil_SRCDIR}) + +SET(agutil_SRCS + ${agutil_SRCDIR}/dynattr.c + ${agutil_SRCDIR}/nodeq.c +) diff --git a/lib/cdt/CMakeLists.txt b/lib/cdt/CMakeLists.txt index 0f7140ba4..d586aa7ad 100644 --- a/lib/cdt/CMakeLists.txt +++ b/lib/cdt/CMakeLists.txt @@ -2,34 +2,21 @@ ## Process this file with cmake to produce Makefile INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ) +ADD_CUSTOM_COMMAND( + OUTPUT cdt.pdf + DEPENDS cdt.3 + COMMAND groff -Tps -man cdt.3 | ps2pdf - cdt.pdf +) + ########### next target ############### -SET(cdt_SRCS - dtclose.c - dtdisc.c - dtextract.c - dtflatten.c - dthash.c - dtlist.c - dtmethod.c - dtopen.c - dtrenew.c - dtrestore.c - dtsize.c - dtstat.c - dtstrhash.c - dttree.c - dtview.c - dtwalk.c -) +INCLUDE(${CMAKE_SOURCE_DIR}/lib/cdt/sources.cmake) ADD_LIBRARY(cdt STATIC ${cdt_SRCS}) - ########### install files ############### INSTALL_FILES(FILES diff --git a/lib/cdt/sources.cmake b/lib/cdt/sources.cmake new file mode 100644 index 000000000..79c7aea7e --- /dev/null +++ b/lib/cdt/sources.cmake @@ -0,0 +1,24 @@ +# $Id$ $Revision$ + +SET(cdt_SRCDIR ${CMAKE_SOURCE_DIR}/lib/cdt) + +INCLUDE_DIRECTORIES(${cdt_SRCDIR}) + +SET(cdt_SRCS + ${cdt_SRCDIR}/dtclose.c + ${cdt_SRCDIR}/dtdisc.c + ${cdt_SRCDIR}/dtextract.c + ${cdt_SRCDIR}/dtflatten.c + ${cdt_SRCDIR}/dthash.c + ${cdt_SRCDIR}/dtlist.c + ${cdt_SRCDIR}/dtmethod.c + ${cdt_SRCDIR}/dtopen.c + ${cdt_SRCDIR}/dtrenew.c + ${cdt_SRCDIR}/dtrestore.c + ${cdt_SRCDIR}/dtsize.c + ${cdt_SRCDIR}/dtstat.c + ${cdt_SRCDIR}/dtstrhash.c + ${cdt_SRCDIR}/dttree.c + ${cdt_SRCDIR}/dtview.c + ${cdt_SRCDIR}/dtwalk.c +) diff --git a/lib/common/CMakeLists.txt b/lib/common/CMakeLists.txt index 5d3cb32d3..98e92cc0f 100644 --- a/lib/common/CMakeLists.txt +++ b/lib/common/CMakeLists.txt @@ -2,7 +2,6 @@ ## Process this file with cmake to produce Makefile INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/lib/gvc ${CMAKE_SOURCE_DIR}/lib/pack @@ -13,88 +12,12 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/lib/gd ) - ########### next target ############### -SET(common_SRCS - arrows.c - colxlate.c - fontmetrics.c - args.c - memory.c - globals.c - htmllex.c - htmltable.c - input.c - pointset.c - postproc.c - routespl.c - splines.c - psusershape.c - timing.c - labels.c - ns.c - shapes.c - utils.c - geom.c - output.c - emit.c -) - -SET(codegen_SRCS - diagen.c - figgen.c - gdgen.c - hpglgen.c - mapgen.c - mifgen.c - mpgen.c - picgen.c - psgen.c - svggen.c - vrmlgen.c - vtxgen.c - xdgen.c -) - -set(generated_SRCS - colortbl.h - htmlparse.h - htmlparse.c - ps.h -) +INCLUDE(${CMAKE_SOURCE_DIR}/lib/common/sources.cmake) ADD_LIBRARY(common STATIC ${generated_SRCS} ${common_SRCS} ${codegen_SRCS} ) -ADD_CUSTOM_COMMAND( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT htmlparse.c - OUTPUT htmlparse.h - DEPENDS htmlparse.y - COMMAND yacc -dv htmlparse.y - COMMAND sed "s/yy/html/g" < y.tab.c > htmlparse.c - COMMAND sed "s/yy/html/g" < y.tab.h > htmlparse.h - COMMAND rm y.tab.c y.tab.h y.output -) - -ADD_CUSTOM_COMMAND( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT ps.h - DEPENDS ps.txt - COMMAND awk -f ${CMAKE_SOURCE_DIR}/awk/stringize.awk ps.txt > ps.h -) - -ADD_CUSTOM_COMMAND( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT colortbl.h - DEPENDS color_names - DEPENDS brewer_colors - COMMAND LC_COLLATE=C sort color_names > color_lib - COMMAND awk -f ${CMAKE_SOURCE_DIR}/awk/brewer.awk brewer_colors >> color_lib - COMMAND awk -f ${CMAKE_SOURCE_DIR}/awk/colortbl.awk color_lib > colortbl.h - COMMAND rm color_lib -) - ########### install files ############### diff --git a/lib/common/sources.cmake b/lib/common/sources.cmake new file mode 100644 index 000000000..fd061d8d2 --- /dev/null +++ b/lib/common/sources.cmake @@ -0,0 +1,83 @@ +# $Id$ $Revision$ + +SET(common_SRCDIR ${CMAKE_SOURCE_DIR}/lib/common) + +INCLUDE_DIRECTORIES(${common_SRCDIR}) + +ADD_CUSTOM_COMMAND( + WORKING_DIRECTORY ${common_SRCDIR} + OUTPUT htmlparse.c + OUTPUT htmlparse.h + DEPENDS htmlparse.y + COMMAND yacc -dv htmlparse.y + COMMAND sed "s/yy/html/g" < y.tab.c > htmlparse.c + COMMAND sed "s/yy/html/g" < y.tab.h > htmlparse.h + COMMAND rm y.tab.c y.tab.h y.output +) + +ADD_CUSTOM_COMMAND( + WORKING_DIRECTORY ${common_SRCDIR} + OUTPUT ps.h + DEPENDS ps.txt + COMMAND awk -f ${CMAKE_SOURCE_DIR}/awk/stringize.awk ps.txt > ps.h +) + +ADD_CUSTOM_COMMAND( + WORKING_DIRECTORY ${common_SRCDIR} + OUTPUT colortbl.h + DEPENDS color_names + DEPENDS brewer_colors + COMMAND LC_COLLATE=C sort color_names > color_lib + COMMAND awk -f ${CMAKE_SOURCE_DIR}/awk/brewer.awk brewer_colors >> color_lib + COMMAND awk -f ${CMAKE_SOURCE_DIR}/awk/colortbl.awk color_lib > colortbl.h + COMMAND rm color_lib +) + +SET(common_base_SRCS + ${common_SRCDIR}/arrows.c + ${common_SRCDIR}/colxlate.c + ${common_SRCDIR}/fontmetrics.c + ${common_SRCDIR}/args.c + ${common_SRCDIR}/memory.c + ${common_SRCDIR}/globals.c + ${common_SRCDIR}/htmllex.c + ${common_SRCDIR}/htmltable.c + ${common_SRCDIR}/input.c + ${common_SRCDIR}/pointset.c + ${common_SRCDIR}/postproc.c + ${common_SRCDIR}/routespl.c + ${common_SRCDIR}/splines.c + ${common_SRCDIR}/psusershape.c + ${common_SRCDIR}/timing.c + ${common_SRCDIR}/labels.c + ${common_SRCDIR}/ns.c + ${common_SRCDIR}/shapes.c + ${common_SRCDIR}/utils.c + ${common_SRCDIR}/geom.c + ${common_SRCDIR}/output.c + ${common_SRCDIR}/emit.c +) + +SET(common_codegen_SRCS + ${common_SRCDIR}/diagen.c + ${common_SRCDIR}/figgen.c + ${common_SRCDIR}/hpglgen.c + ${common_SRCDIR}/mifgen.c + ${common_SRCDIR}/mpgen.c + ${common_SRCDIR}/picgen.c + ${common_SRCDIR}/vtxgen.c + ${common_SRCDIR}/xdgen.c +) + +set(common_generated_SRCS + ${common_SRCDIR}/colortbl.h + ${common_SRCDIR}/htmlparse.h + ${common_SRCDIR}/htmlparse.c + ${common_SRCDIR}/ps.h +) + +set(common_SRCS + ${common_base_SRCS} + ${common_codegen_SRCS} + ${common_generated_SRCS} +) diff --git a/lib/gd/CMakeLists.txt b/lib/gd/CMakeLists.txt index 7b25fbc5c..8af529b24 100644 --- a/lib/gd/CMakeLists.txt +++ b/lib/gd/CMakeLists.txt @@ -1,60 +1,15 @@ # $Id$ $Revision$ ## Process this file with cmake to produce Makefile -INCLUDE( UsePkgConfig ) - -INCLUDE( FindJPEG ) -INCLUDE( FindPNG ) -INCLUDE( FindZLIB ) - -PKGCONFIG( freetype2 FREETYPE_INCLUDE_DIR FREETYPE_LIB_DIR FREETYPE_LINK_FLAGS FREETYPE_CFLAGS ) -PKGCONFIG( fontconfig FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIB_DIR FONTCONFIG_LINK_FLAGS FONTCONFIG_CFLAGS ) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR} - ${FREETYPE_INCLUDE_DIR} - ${FONTCONFIG_INCLUDE_DIR} -) - - +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) ########### next target ############### -ADD_DEFINITIONS(${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS}) -SET(gvgd_SRCS - gdtables.c - gd.c - gdfx.c - gd_security.c - gd_gd.c - gd_gd2.c - gd_io.c - gd_io_dp.c - gd_gif_in.c - gd_gif_out.c - gd_io_file.c - gd_io_ss.c - gd_jpeg.c - gd_png.c - gd_ss.c - gd_topal.c - gd_wbmp.c - gdcache.c - gdfontg.c - gdfontl.c - gdfontmb.c - gdfonts.c - gdfontt.c - gdft.c - gdhelpers.c - gdkanji.c - gdxpm.c - wbmp.c -) +INCLUDE(${CMAKE_SOURCE_DIR}/lib/gd/sources.cmake) -ADD_LIBRARY(gvgd STATIC ${gvgd_SRCS}) +SET(gvgd_SRCS ${gd_SRCS}) +ADD_LIBRARY(gvgd STATIC ${gvgd_SRCS}) ########### install files ############### diff --git a/lib/gd/sources.cmake b/lib/gd/sources.cmake new file mode 100644 index 000000000..d57647524 --- /dev/null +++ b/lib/gd/sources.cmake @@ -0,0 +1,51 @@ +# $Id$ $Revision$ + +SET(gd_SRCDIR ${CMAKE_SOURCE_DIR}/lib/gd) + +INCLUDE( UsePkgConfig ) + +INCLUDE( FindJPEG ) +INCLUDE( FindPNG ) +INCLUDE( FindZLIB ) + +PKGCONFIG( freetype2 FREETYPE_INCLUDE_DIR FREETYPE_LIB_DIR FREETYPE_LINK_FLAGS FREETYPE_CFLAGS ) +PKGCONFIG( fontconfig FONTCONFIG_INCLUDE_DIR FONTCONFIG_LIB_DIR FONTCONFIG_LINK_FLAGS FONTCONFIG_CFLAGS ) + +INCLUDE_DIRECTORIES( + ${gd_SRCDIR} + ${FREETYPE_INCLUDE_DIR} + ${FONTCONFIG_INCLUDE_DIR} +) + +ADD_DEFINITIONS(${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS}) + +SET(gd_SRCS + ${gd_SRCDIR}/gdtables.c + ${gd_SRCDIR}/gd.c + ${gd_SRCDIR}/gdfx.c + ${gd_SRCDIR}/gd_security.c + ${gd_SRCDIR}/gd_gd.c + ${gd_SRCDIR}/gd_gd2.c + ${gd_SRCDIR}/gd_io.c + ${gd_SRCDIR}/gd_io_dp.c + ${gd_SRCDIR}/gd_gif_in.c + ${gd_SRCDIR}/gd_gif_out.c + ${gd_SRCDIR}/gd_io_file.c + ${gd_SRCDIR}/gd_io_ss.c + ${gd_SRCDIR}/gd_jpeg.c + ${gd_SRCDIR}/gd_png.c + ${gd_SRCDIR}/gd_ss.c + ${gd_SRCDIR}/gd_topal.c + ${gd_SRCDIR}/gd_wbmp.c + ${gd_SRCDIR}/gdcache.c + ${gd_SRCDIR}/gdfontg.c + ${gd_SRCDIR}/gdfontl.c + ${gd_SRCDIR}/gdfontmb.c + ${gd_SRCDIR}/gdfonts.c + ${gd_SRCDIR}/gdfontt.c + ${gd_SRCDIR}/gdft.c + ${gd_SRCDIR}/gdhelpers.c + ${gd_SRCDIR}/gdkanji.c + ${gd_SRCDIR}/gdxpm.c + ${gd_SRCDIR}/wbmp.c +) diff --git a/lib/graph/CMakeLists.txt b/lib/graph/CMakeLists.txt index 13ab33327..6a2439b67 100644 --- a/lib/graph/CMakeLists.txt +++ b/lib/graph/CMakeLists.txt @@ -2,36 +2,19 @@ ## Process this file with cmake to produce Makefile INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/lib/cdt ) -########### next target ############### - ADD_CUSTOM_COMMAND( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - OUTPUT parser.c - OUTPUT parser.h - DEPENDS parser.y - COMMAND yacc -dv parser.y - COMMAND sed "s/yy/ag/g" < y.tab.c > parser.c - COMMAND sed "s/yy/ag/g" < y.tab.h > parser.h - COMMAND rm y.tab.c y.tab.h y.output + OUTPUT graph.pdf + DEPENDS graph.3 + COMMAND groff -Tps -man graph.3 | ps2pdf - graph.pdf ) -SET(graph_SRCS - attribs.c - agxbuf.c - edge.c - graph.c - graphio.c - lexer.c - node.c - parser.c - refstr.c - trie.c -) +########### next target ############### + +INCLUDE(${CMAKE_SOURCE_DIR}/lib/graph/sources.cmake) ADD_LIBRARY(graph STATIC ${graph_SRCS}) diff --git a/lib/graph/sources.cmake b/lib/graph/sources.cmake new file mode 100644 index 000000000..5ada35d2c --- /dev/null +++ b/lib/graph/sources.cmake @@ -0,0 +1,29 @@ +# $Id$ $Revision$ + +SET(graph_SRCDIR ${CMAKE_SOURCE_DIR}/lib/graph) + +INCLUDE_DIRECTORIES(${graph_SRCDIR}) + +ADD_CUSTOM_COMMAND( + WORKING_DIRECTORY ${graph_SRCDIR} + OUTPUT parser.c + OUTPUT parser.h + DEPENDS parser.y + COMMAND yacc -dv parser.y + COMMAND sed "s/yy/ag/g" < y.tab.c > parser.c + COMMAND sed "s/yy/ag/g" < y.tab.h > parser.h + COMMAND rm y.tab.c y.tab.h y.output +) + +SET(graph_SRCS + ${graph_SRCDIR}/attribs.c + ${graph_SRCDIR}/agxbuf.c + ${graph_SRCDIR}/edge.c + ${graph_SRCDIR}/graph.c + ${graph_SRCDIR}/graphio.c + ${graph_SRCDIR}/lexer.c + ${graph_SRCDIR}/node.c + ${graph_SRCDIR}/parser.c + ${graph_SRCDIR}/refstr.c + ${graph_SRCDIR}/trie.c +) -- 2.40.0