From c562b361f82220771a1099b8d0fd88f4b491b81a Mon Sep 17 00:00:00 2001 From: Mark Ellzey Date: Wed, 27 Nov 2013 15:40:57 -0500 Subject: [PATCH] Added cmake support (Non MINGW only right now) --- .gitignore | 2 -- CMakeLists.txt | 13 +++++++++++++ include/CMakeLists.txt | 1 + src/CMakeLists.txt | 2 ++ test/CMakeLists.txt | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 include/CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 test/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 72704c2..fd1ec68 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,5 @@ build/ *.sdf *.opensdf *.aps -CMake* -*.cmake .DS_Store *~ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..08118ee --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 2.8) + +project(diff-match-patch-c) + +set(LIBDMP_DEPS_INSTALL ${PROJECT_BINARY_DIR}/install) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBDMP_DEPS_INSTALL}/lib/) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBDMP_DEPS_INSTALL}/lib) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + +add_subdirectory(src) +add_subdirectory(include) +add_subdirectory(test) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 0000000..b5ca0f4 --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1 @@ +install(FILES dmp.h DESTINATION include) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..fc0447b --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(dmp STATIC dmp_pool.c dmp.c) +install(TARGETS dmp DESTINATION lib) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..a7e553d --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,2 @@ +add_executable(dump_test dmp_test_internals.c dmp_test.c) +target_link_libraries(dump_test dmp)