1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 20:53:52 +00:00

clang and cross-compile fixes (#373)

* Add CLANG_TIDY check

Signed-off-by: Khem Raj <raj.khem@gmail.com>

* Use GNUInstallDirs instead of hard-coded path

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2019-12-28 14:55:47 -08:00 committed by Henry Schreiner
parent b979d3a370
commit c72057d877

View File

@ -75,7 +75,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
endif()
endif()
if(NOT CMAKE_VERSION VERSION_LESS 3.6)
if(NOT CMAKE_VERSION VERSION_LESS 3.6 AND CLANG_TIDY)
# Add clang-tidy if available
option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF)
find_program(
@ -146,17 +146,18 @@ endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CLI11ConfigVersion.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CLI11ConfigVersion.cmake" @ONLY)
include(GNUInstallDirs)
# These installs only make sense for a local project
if(CUR_PROJ)
# Make version available in the install
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/CLI11ConfigVersion.cmake"
DESTINATION lib/cmake/CLI11)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CLI11)
# Install the export target as a file
install(EXPORT CLI11Targets
FILE CLI11Config.cmake
NAMESPACE CLI11::
DESTINATION lib/cmake/CLI11)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CLI11)
# Use find_package on the installed package
export(TARGETS CLI11