2.0.10
This commit is contained in:
@@ -2,13 +2,32 @@ include_guard(GLOBAL)
|
||||
|
||||
# Пропуск целей, которые создаются автоматически в `CMAKE_BINARY_DIR`
|
||||
macro(myx_skip_external_target NAME)
|
||||
get_target_property(__source_dir ${NAME} SOURCE_DIR)
|
||||
string(FIND ${__source_dir} ${CMAKE_BINARY_DIR} __pos)
|
||||
if(__pos EQUAL 0)
|
||||
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)
|
||||
return()
|
||||
endif()
|
||||
unset(__pos)
|
||||
unset(__source_dir)
|
||||
unset(__type)
|
||||
endmacro(myx_skip_external_target NAME)
|
||||
|
Reference in New Issue
Block a user