mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-03 22:54:39 +00:00
Merge pull request #364 from zhao-shihan/master
Allow to install when argparse is a subproject
This commit is contained in:
commit
a2b4d27989
@ -13,8 +13,8 @@ project(argparse
|
|||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
option(ARGPARSE_INSTALL "Include an install target" ON)
|
option(ARGPARSE_INSTALL "Include an install target" ${ARGPARSE_IS_TOP_LEVEL})
|
||||||
option(ARGPARSE_BUILD_TESTS "Build tests" ON)
|
option(ARGPARSE_BUILD_TESTS "Build tests" ${ARGPARSE_IS_TOP_LEVEL})
|
||||||
option(ARGPARSE_BUILD_SAMPLES "Build samples" OFF)
|
option(ARGPARSE_BUILD_SAMPLES "Build samples" OFF)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
@ -32,11 +32,11 @@ if(ARGPARSE_BUILD_SAMPLES)
|
|||||||
add_subdirectory(samples)
|
add_subdirectory(samples)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ARGPARSE_BUILD_TESTS AND ARGPARSE_IS_TOP_LEVEL)
|
if(ARGPARSE_BUILD_TESTS)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ARGPARSE_INSTALL AND ARGPARSE_IS_TOP_LEVEL)
|
if(ARGPARSE_INSTALL)
|
||||||
install(TARGETS argparse EXPORT argparseConfig)
|
install(TARGETS argparse EXPORT argparseConfig)
|
||||||
install(EXPORT argparseConfig
|
install(EXPORT argparseConfig
|
||||||
NAMESPACE argparse::
|
NAMESPACE argparse::
|
||||||
|
Loading…
Reference in New Issue
Block a user