From: Erwin Janssen Date: Tue, 3 Jan 2017 17:01:50 +0000 (+0100) Subject: Add lib/pathplan to the CMake build X-Git-Tag: 2.42.0~213^2^2~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f13cfd8c9d5570b8a73fd146b6efc38fb46e7b36;p=graphviz Add lib/pathplan to the CMake build Only a one additional checks were required for pathplan: cbrt function --- diff --git a/cmake/config_checks.cmake b/cmake/config_checks.cmake index 07efa8da7..ed4403670 100644 --- a/cmake/config_checks.cmake +++ b/cmake/config_checks.cmake @@ -6,7 +6,8 @@ CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H) # Function checks include(CheckFunctionExists) -CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP) +CHECK_FUNCTION_EXISTS( cbrt HAVE_CBRT ) +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 f783c30c8..6d2dc3d89 100644 --- a/config-cmake.h.in +++ b/config-cmake.h.in @@ -1,5 +1,6 @@ +// Include headers +#cmakedefine HAVE_UNISTD_H + // Functions +#cmakedefine HAVE_CBRT #cmakedefine HAVE_STRCASECMP - -// Include headers -#cmakedefine HAVE_UNISTD_H \ No newline at end of file diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 5d94cbcb5..98280f8d9 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,2 +1,6 @@ +# No dependencies add_subdirectory(cdt) +add_subdirectory(pathplan) + +# Dependent on: cdt add_subdirectory(cgraph) diff --git a/lib/pathplan/CMakeLists.txt b/lib/pathplan/CMakeLists.txt new file mode 100644 index 000000000..2eec7c418 --- /dev/null +++ b/lib/pathplan/CMakeLists.txt @@ -0,0 +1,54 @@ +add_definitions(-D_BLD_pathplan -DPATHPLAN_EXPORTS) + +include_directories(.) + +add_library(pathplan SHARED + # Header files + pathgeom.h + pathplan.h + pathutil.h + solvers.h + tri.h + vis.h + vispath.h + + # Source files + cvt.c + inpoly.c + route.c + shortest.c + shortestpth.c + solvers.c + triang.c + util.c + visibility.c + + # Link definition file for Windows + pathplan.def +) + +# Installation location of library files +install( + TARGETS pathplan + RUNTIME DESTINATION ${BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR} +) + +# Specify headers to be installed +install( + FILES pathgeom.h pathplan.h + DESTINATION ${HEADER_INSTALL_DIR} +) + +# Specify man pages to be installed +install( + FILES pathplan.3 + DESTINATION ${MAN_INSTALL_DIR} +) + +# Specify library version and soversion +set_target_properties(pathplan PROPERTIES + VERSION 4.0.0 + SOVERSION 4 +)