Skip to content

Commit

Permalink
Merge pull request #4 from SuperWig/cmake
Browse files Browse the repository at this point in the history
Add root CMakeLists.txt
  • Loading branch information
p-ranav authored Apr 10, 2019
2 parents a60cb8b + 07f0927 commit f3cd481
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/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)

0 comments on commit f3cd481

Please sign in to comment.