From 9a6775837a831d2acac0211ec2796717b8a81536 Mon Sep 17 00:00:00 2001 From: Omar Alvarez Date: Tue, 18 Jun 2019 10:18:05 +0200 Subject: [PATCH] CMake support --- CMakeLists.txt | 29 +++++++++++++++++++++++++++++ httplib.h => include/httplib.h | 0 2 files changed, 29 insertions(+) create mode 100644 CMakeLists.txt rename httplib.h => include/httplib.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..6907638 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.7.0) +project(httplib) + +set(CMAKE_CXX_STANDARD 11) + +# Include +include(GNUInstallDirs) +include(ExternalProject) + +add_library(${PROJECT_NAME} INTERFACE) +target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_11) + +target_include_directories(${PROJECT_NAME} INTERFACE + $ + $) + +install(TARGETS ${PROJECT_NAME} EXPORT httplibConfig + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) + +install(EXPORT httplibConfig DESTINATION share/httplib/cmake) + +export(TARGETS ${PROJECT_NAME} FILE httplibConfig.cmake) + +#add_subdirectory(example) +#add_subdirectory(test) \ No newline at end of file diff --git a/httplib.h b/include/httplib.h similarity index 100% rename from httplib.h rename to include/httplib.h