]> granicus.if.org Git - graphviz/commitdiff
Initial minimal CMake project
authorErwin Janssen <erwinjanssen@outlook.com>
Mon, 19 Dec 2016 15:03:57 +0000 (16:03 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Thu, 19 Jan 2017 11:53:48 +0000 (12:53 +0100)
A CMake project consists of CMakeLists.txt files. The primary file in the
root of the project specifies global project information and
configuration. CMakeLists.txt files in subdirectories can contain
configuration for how to build to binaries.

This configuration minimal configuration only builds lib/cdt as a shared
(dynamic) library. CMake supports out of source builds, which is the
recommended way of building:

mkdir build
cd build
cmake ..
cmake --build .

The `cmake ..` generates the build files. On Unix based systems, it
gerenates makefiles, on Windows it generates Visual Studio projects. The
used generated can be specified with -G.

.gitignore
CMakeLists.txt [new file with mode: 0644]
lib/CMakeLists.txt [new file with mode: 0644]
lib/cdt/CMakeLists.txt [new file with mode: 0644]

index 541b6962a34c179dd3811fdca2a32f296c71a8f7..1f259d8f3f79dcfa2a93bd77fdf737bbbb3195a4 100644 (file)
@@ -206,6 +206,9 @@ tests/**/difference/**
 ## Binaries
 tests/unit_tests/lib/common/command_line
 
+# Cmake build folder
+build/**
+
 # Folders and files generated by Visual Studio builds
 **/Debug/**
 **/Release/**
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..4ce651d
--- /dev/null
@@ -0,0 +1,5 @@
+cmake_minimum_required (VERSION 2.8 FATAL_ERROR)
+
+project (Graphviz)
+
+add_subdirectory(lib)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
new file mode 100644 (file)
index 0000000..650cb7b
--- /dev/null
@@ -0,0 +1 @@
+add_subdirectory(cdt)
diff --git a/lib/cdt/CMakeLists.txt b/lib/cdt/CMakeLists.txt
new file mode 100644 (file)
index 0000000..36827c0
--- /dev/null
@@ -0,0 +1,30 @@
+add_definitions(-D_BLD_cdt)
+
+include_directories(.)
+
+add_library(cdt SHARED
+    # Header files
+    cdt.h
+    dthdr.h
+
+    # Source files
+    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
+
+    # Link definition file for Windows
+    cdt.def
+)