FindDoxygen: Create imported targets at most once in a given scope

The imported targets added by commit v3.9.0-rc1~55^2 (Improve Doxygen
support, 2017-04-10) need to be guarded against duplicate creation on
multiple inclusion.
This commit is contained in:
Brad King
2017-06-08 15:58:26 -04:00
parent 893ee1b17c
commit 522c92d752
+24 -16
View File
@@ -396,10 +396,12 @@ macro(_Doxygen_find_doxygen)
endif() endif()
# Create an imported target for Doxygen # Create an imported target for Doxygen
add_executable(Doxygen::doxygen IMPORTED GLOBAL) if(NOT TARGET Doxygen::doxygen)
set_target_properties(Doxygen::doxygen PROPERTIES add_executable(Doxygen::doxygen IMPORTED GLOBAL)
IMPORTED_LOCATION "${DOXYGEN_EXECUTABLE}" set_target_properties(Doxygen::doxygen PROPERTIES
) IMPORTED_LOCATION "${DOXYGEN_EXECUTABLE}"
)
endif()
endif() endif()
endmacro() endmacro()
@@ -429,10 +431,12 @@ macro(_Doxygen_find_dia)
endif() endif()
# Create an imported target for component # Create an imported target for component
add_executable(Doxygen::dia IMPORTED GLOBAL) if(NOT TARGET Doxygen::dia)
set_target_properties(Doxygen::dia PROPERTIES add_executable(Doxygen::dia IMPORTED GLOBAL)
IMPORTED_LOCATION "${DOXYGEN_DIA_EXECUTABLE}" set_target_properties(Doxygen::dia PROPERTIES
) IMPORTED_LOCATION "${DOXYGEN_DIA_EXECUTABLE}"
)
endif()
endif() endif()
unset(_x86) unset(_x86)
@@ -474,10 +478,12 @@ macro(_Doxygen_find_dot)
endif() endif()
# Create an imported target for component # Create an imported target for component
add_executable(Doxygen::dot IMPORTED GLOBAL) if(NOT TARGET Doxygen::dot)
set_target_properties(Doxygen::dot PROPERTIES add_executable(Doxygen::dot IMPORTED GLOBAL)
IMPORTED_LOCATION "${DOXYGEN_DOT_EXECUTABLE}" set_target_properties(Doxygen::dot PROPERTIES
) IMPORTED_LOCATION "${DOXYGEN_DOT_EXECUTABLE}"
)
endif()
endif() endif()
unset(_Doxygen_GRAPHVIZ_BIN_DIRS) unset(_Doxygen_GRAPHVIZ_BIN_DIRS)
@@ -510,10 +516,12 @@ macro(_Doxygen_find_mscgen)
endif() endif()
# Create an imported target for component # Create an imported target for component
add_executable(Doxygen::mscgen IMPORTED GLOBAL) if(NOT TARGET Doxygen::mscgen)
set_target_properties(Doxygen::mscgen PROPERTIES add_executable(Doxygen::mscgen IMPORTED GLOBAL)
IMPORTED_LOCATION "${DOXYGEN_MSCGEN_EXECUTABLE}" set_target_properties(Doxygen::mscgen PROPERTIES
) IMPORTED_LOCATION "${DOXYGEN_MSCGEN_EXECUTABLE}"
)
endif()
endif() endif()
unset(_x86) unset(_x86)