From 7f47f9926fe5b05dc11b28cb8d20d9b69faf639a Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Thu, 9 Jan 2020 08:33:34 -0500 Subject: [PATCH] Fix for install=off --- CMakeLists.txt | 37 +++++++++++++++++-------------------- azure-pipelines.yml | 1 + 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97414a3d..cbb89539 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,38 +181,35 @@ endif() # This folder should be installed if(CLI11_INSTALL) - install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - # Make an export target - install(TARGETS CLI11 EXPORT CLI11Targets) -endif() + # Make an export target + install(TARGETS CLI11 EXPORT CLI11Targets) -# Use find_package on the installed package -# Since we have no custom code, we can directly write this -# to Config.cmake (otherwise we'd have a custom config and would -# import Targets.cmake + # Use find_package on the installed package + # Since we have no custom code, we can directly write this + # to Config.cmake (otherwise we'd have a custom config and would + # import Targets.cmake -# Add the version in a CMake readable way -configure_file("cmake/CLI11ConfigVersion.cmake.in" - "CLI11ConfigVersion.cmake" @ONLY) + # Add the version in a CMake readable way + configure_file("cmake/CLI11ConfigVersion.cmake.in" + "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 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(EXPORT CLI11Targets - FILE CLI11Config.cmake - NAMESPACE CLI11:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CLI11) + FILE CLI11Config.cmake + NAMESPACE CLI11:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CLI11) # Use find_package on the installed package export(TARGETS CLI11 - NAMESPACE CLI11:: - FILE CLI11Targets.cmake) + NAMESPACE CLI11:: + FILE CLI11Targets.cmake) # Register in the user cmake package registry export(PACKAGE CLI11) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7e4cad09..3d68064b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,6 +31,7 @@ jobs: - script: git diff --exit-code --color displayName: Check tidy +# TODO: Fix macOS error and windows warning in c++17 mode - job: Native strategy: matrix: