From f03cb0377cb1930650568810efb000511ad413f0 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 22 May 2014 00:49:18 +0300 Subject: [PATCH] Add support for configuring with CMake --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b20ce2c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 2.8) +project(dht) + +option(DHT_BUILD_EXAMPLE "Build DHT example program" ON) + +add_library(dht STATIC dht.c dht.h) +target_include_directories(dht PUBLIC ${PROJECT_SOURCE_DIR}) + +if(DHT_BUILD_EXAMPLE) + add_executable(dht-example dht-example.c) + target_link_libraries(dht-example dht crypt) +endif()