From 07f09279edb450a1291f777d48d3f10766890495 Mon Sep 17 00:00:00 2001 From: Daniel Marshall Date: Wed, 10 Apr 2019 12:14:33 +0100 Subject: [PATCH] Add root CMakeLists.txt --- CMakeLists.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a46443d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.8) +project(argparse VERSION 0.1.0 LANGUAGES CXX) +option(ARGPARSE_BUILD_TESTS OFF) + +include(GNUInstallDirs) + +add_library(argparse INTERFACE) +add_library(argparse::argparse ALIAS argparse) + +target_compile_features(argparse INTERFACE cxx_std_17) +target_include_directories(argparse INTERFACE + $ + $/include) + +if(ARGPARSE_BUILD_TESTS) + add_subdirectory(test) +endif() + +install(TARGETS argparse EXPORT argparseConfig) +install(EXPORT argparseConfig + NAMESPACE argparse:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/argparse) +install(FILES ${CMAKE_CURRENT_LIST_DIR}/include/argparse.hpp + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/argparse) \ No newline at end of file