include_guard(GLOBAL) # Пропуск целей, которые создаются автоматически в `CMAKE_BINARY_DIR` macro(myx_skip_external_target NAME) get_target_property(__type ${NAME} TYPE) if(__type STREQUAL "INTERFACE_LIBRARY") get_target_property(__sources ${NAME} INTERFACE_SOURCES) foreach(iter ${__sources}) string(FIND ${iter} ${CMAKE_BINARY_DIR} __pos) if(__pos EQUAL 0) unset(__type) unset(__pos) unset(__sources) return() endif() endforeach() unset(__type) unset(__pos) unset(__sources) else() get_target_property(__source_dir ${NAME} SOURCE_DIR) string(FIND ${__source_dir} ${CMAKE_BINARY_DIR} __pos) if(__pos EQUAL 0) unset(__type) unset(__pos) unset(__source_dir) return() endif() unset(__pos) unset(__source_dir) endif() unset(__type) endmacro(myx_skip_external_target NAME)