From e0ec9e44b5eda6219c4740b149d30a58f8687a83 Mon Sep 17 00:00:00 2001 From: Erwin Janssen Date: Mon, 19 Dec 2016 16:03:57 +0100 Subject: [PATCH] Initial minimal CMake project 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 | 3 +++ CMakeLists.txt | 5 +++++ lib/CMakeLists.txt | 1 + lib/cdt/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 lib/CMakeLists.txt create mode 100644 lib/cdt/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 541b6962a..1f259d8f3 100644 --- a/.gitignore +++ b/.gitignore @@ -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 index 000000000..4ce651d04 --- /dev/null +++ b/CMakeLists.txt @@ -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 index 000000000..650cb7bbe --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(cdt) diff --git a/lib/cdt/CMakeLists.txt b/lib/cdt/CMakeLists.txt new file mode 100644 index 000000000..36827c053 --- /dev/null +++ b/lib/cdt/CMakeLists.txt @@ -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 +) -- 2.40.0