From f1cd8085edaae0587aadac84bef73c04e6f8fbba Mon Sep 17 00:00:00 2001 From: Ihor Dutchak Date: Sun, 14 Mar 2021 11:11:11 +0200 Subject: [PATCH] Explicitly check for trying to install 'EXCLUDE_FROM_ALL' hidapi --- src/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7d97710..7b4e0c1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,6 +22,13 @@ if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() +get_directory_property(IS_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL) +if(IS_EXCLUDE_FROM_ALL) + if(HIDAPI_INSTALL_TARGETS) + message(WARNING "Installing EXCLUDE_FROM_ALL targets in an undefined behavior in CMake.\nDon't add 'hidapi' sundirectory with 'EXCLUDE_FROM_ALL' property, or don't set 'HIDAPI_INSTALL_TARGETS' to TRUE.") + endif() +endif() + # Helper(s) function(hidapi_configure_pc PC_IN_FILE)