-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from SuperWig/cmake
Add root CMakeLists.txt
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |