From 0144621301d4cf61ac5e4fe9874cafa7a451c25e Mon Sep 17 00:00:00 2001 From: Erwin Janssen Date: Thu, 5 Jan 2017 10:20:19 +0100 Subject: [PATCH] Add lib/fdpgen to CMake build The static library fdpgen has no dependencies. Two additional function checks have been added: drand48 and srand48. --- cmake/config_checks.cmake | 8 +++++--- config-cmake.h.in | 2 ++ lib/CMakeLists.txt | 1 + lib/fdpgen/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 lib/fdpgen/CMakeLists.txt diff --git a/cmake/config_checks.cmake b/cmake/config_checks.cmake index ed4403670..8eb588258 100644 --- a/cmake/config_checks.cmake +++ b/cmake/config_checks.cmake @@ -1,13 +1,15 @@ # Header checks include(CheckIncludeFile) -CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H) +check_include_file(unistd.h HAVE_UNISTD_H) # Function checks include(CheckFunctionExists) -CHECK_FUNCTION_EXISTS( cbrt HAVE_CBRT ) -CHECK_FUNCTION_EXISTS( strcasecmp HAVE_STRCASECMP ) +check_function_exists( drand48 HAVE_DRAND48 ) +check_function_exists( cbrt HAVE_CBRT ) +check_function_exists( srand48 HAVE_SRAND48 ) +check_function_exists( strcasecmp HAVE_STRCASECMP ) # Write check results to config.h header configure_file(config-cmake.h.in config.h) diff --git a/config-cmake.h.in b/config-cmake.h.in index dce248e0d..4480e4928 100644 --- a/config-cmake.h.in +++ b/config-cmake.h.in @@ -5,5 +5,7 @@ #cmakedefine HAVE_UNISTD_H // Functions +#cmakedefine HAVE_DRAND48 #cmakedefine HAVE_CBRT +#cmakedefine HAVE_SRAND48 #cmakedefine HAVE_STRCASECMP diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f7b9acd04..0e990dab9 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -2,6 +2,7 @@ add_subdirectory(cdt) add_subdirectory(circogen) add_subdirectory(dotgen) +add_subdirectory(fdpgen) add_subdirectory(patchwork) add_subdirectory(pathplan) add_subdirectory(twopigen) diff --git a/lib/fdpgen/CMakeLists.txt b/lib/fdpgen/CMakeLists.txt new file mode 100644 index 000000000..992204232 --- /dev/null +++ b/lib/fdpgen/CMakeLists.txt @@ -0,0 +1,32 @@ +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${GRAPHVIZ_LIB_DIR}/cdt + ${GRAPHVIZ_LIB_DIR}/cgraph + ${GRAPHVIZ_LIB_DIR}/common + ${GRAPHVIZ_LIB_DIR}/gvc + ${GRAPHVIZ_LIB_DIR}/neatogen + ${GRAPHVIZ_LIB_DIR}/pack + ${GRAPHVIZ_LIB_DIR}/pathplan + ${GRAPHVIZ_LIB_DIR}/sparse +) + +add_library(fdpgen STATIC + # Header files + clusteredges.h + comp.h + dbg.h + fdp.h + grid.h + tlayout.h + xlayout.h + + # Source files + clusteredges.c + comp.c + dbg.c + fdpinit.c + grid.c + layout.c + tlayout.c + xlayout.c +) -- 2.40.0