Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang and cross-compile fixes #373

Merged
merged 2 commits into from
Dec 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down