mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-03 14:03:52 +00:00
Fix for install=off
This commit is contained in:
parent
0cc8806ec5
commit
7f47f9926f
@ -181,38 +181,35 @@ endif()
|
|||||||
|
|
||||||
# This folder should be installed
|
# This folder should be installed
|
||||||
if(CLI11_INSTALL)
|
if(CLI11_INSTALL)
|
||||||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
|
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
|
||||||
# Make an export target
|
# Make an export target
|
||||||
install(TARGETS CLI11 EXPORT CLI11Targets)
|
install(TARGETS CLI11 EXPORT CLI11Targets)
|
||||||
endif()
|
|
||||||
|
|
||||||
# Use find_package on the installed package
|
# Use find_package on the installed package
|
||||||
# Since we have no custom code, we can directly write this
|
# Since we have no custom code, we can directly write this
|
||||||
# to Config.cmake (otherwise we'd have a custom config and would
|
# to Config.cmake (otherwise we'd have a custom config and would
|
||||||
# import Targets.cmake
|
# import Targets.cmake
|
||||||
|
|
||||||
# Add the version in a CMake readable way
|
# Add the version in a CMake readable way
|
||||||
configure_file("cmake/CLI11ConfigVersion.cmake.in"
|
configure_file("cmake/CLI11ConfigVersion.cmake.in"
|
||||||
"CLI11ConfigVersion.cmake" @ONLY)
|
"CLI11ConfigVersion.cmake" @ONLY)
|
||||||
|
|
||||||
# These installs only make sense for a local project
|
|
||||||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
|
||||||
# Make version available in the install
|
# Make version available in the install
|
||||||
install(FILES "${PROJECT_BINARY_DIR}/CLI11ConfigVersion.cmake"
|
install(FILES "${PROJECT_BINARY_DIR}/CLI11ConfigVersion.cmake"
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CLI11)
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CLI11)
|
||||||
|
|
||||||
# Install the export target as a file
|
# Install the export target as a file
|
||||||
install(EXPORT CLI11Targets
|
install(EXPORT CLI11Targets
|
||||||
FILE CLI11Config.cmake
|
FILE CLI11Config.cmake
|
||||||
NAMESPACE CLI11::
|
NAMESPACE CLI11::
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CLI11)
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CLI11)
|
||||||
|
|
||||||
# Use find_package on the installed package
|
# Use find_package on the installed package
|
||||||
export(TARGETS CLI11
|
export(TARGETS CLI11
|
||||||
NAMESPACE CLI11::
|
NAMESPACE CLI11::
|
||||||
FILE CLI11Targets.cmake)
|
FILE CLI11Targets.cmake)
|
||||||
|
|
||||||
# Register in the user cmake package registry
|
# Register in the user cmake package registry
|
||||||
export(PACKAGE CLI11)
|
export(PACKAGE CLI11)
|
||||||
|
@ -31,6 +31,7 @@ jobs:
|
|||||||
- script: git diff --exit-code --color
|
- script: git diff --exit-code --color
|
||||||
displayName: Check tidy
|
displayName: Check tidy
|
||||||
|
|
||||||
|
# TODO: Fix macOS error and windows warning in c++17 mode
|
||||||
- job: Native
|
- job: Native
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user