]> granicus.if.org Git - graphviz/commitdiff
Add lib/pathplan to the CMake build
authorErwin Janssen <erwinjanssen@outlook.com>
Tue, 3 Jan 2017 17:01:50 +0000 (18:01 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Thu, 19 Jan 2017 11:53:49 +0000 (12:53 +0100)
Only a one additional checks were required for pathplan: cbrt function

cmake/config_checks.cmake
config-cmake.h.in
lib/CMakeLists.txt
lib/pathplan/CMakeLists.txt [new file with mode: 0644]

index 07efa8da7de78e105d5dc70aa29826da29a36f5d..ed440367046ffeffdc492b9ef57b6a18f624658d 100644 (file)
@@ -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)
index f783c30c8d2a8bd1e00f5f6a2c427d3e5da86905..6d2dc3d89919c7b1cfa9fad1f0d60dc5437d925a 100644 (file)
@@ -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
index 5d94cbcb5a1fd4064bd22bf23578639320846419..98280f8d9f8cedd9280e999351f2557419fad012 100644 (file)
@@ -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 (file)
index 0000000..2eec7c4
--- /dev/null
@@ -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
+)