Приватный заголовок запрещёл для нитерфейсной цели

This commit is contained in:
Andrei Astafev 2023-12-12 12:23:31 +03:00
parent 399a9f2464
commit 13a95cf650

View File

@ -31,5 +31,10 @@ function(myx_generate_private_config_header TARGET_NAME BASE_FILENAME)
configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/PrivateConfig.hpp.in" ${__filename}) configure_file("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/PrivateConfig.hpp.in" ${__filename})
set_property(TARGET ${TARGET_NAME} APPEND PROPERTY PRIVATE_HEADER_FILES ${__filename}) set_property(TARGET ${TARGET_NAME} APPEND PROPERTY PRIVATE_HEADER_FILES ${__filename})
target_sources(${TARGET_NAME} PRIVATE ${__filename}) get_target_property(__target_type ${TARGET_NAME} TYPE)
if(${__target_type} STREQUAL "INTERFACE_LIBRARY")
target_sources(${TARGET_NAME} INTERFACE ${__filename})
else()
target_sources(${TARGET_NAME} PRIVATE ${__filename})
endif()
endfunction() endfunction()