Explicitly check for trying to install 'EXCLUDE_FROM_ALL' hidapi

This commit is contained in:
Ihor Dutchak
2021-03-14 11:11:11 +02:00
parent 00fe9c0b25
commit f1cd8085ed
+7
View File
@@ -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)