diff options
author | Brad King <brad.king@kitware.com> | 2017-06-09 14:06:58 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-06-09 14:07:16 (GMT) |
commit | c8a866b8c47f25ffd5e63e82bf4e501344bf7740 (patch) | |
tree | 8a053142044e4c39f861bd665986c12ae0d10390 | |
parent | 55d752b10855f22642dc69fd99a79af6d085831b (diff) | |
parent | 522c92d752753089f4bd50552955883a6f005570 (diff) | |
download | CMake-c8a866b8c47f25ffd5e63e82bf4e501344bf7740.zip CMake-c8a866b8c47f25ffd5e63e82bf4e501344bf7740.tar.gz CMake-c8a866b8c47f25ffd5e63e82bf4e501344bf7740.tar.bz2 |
Merge topic 'FindDoxygen-imported-target-once'
522c92d7 FindDoxygen: Create imported targets at most once in a given scope
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !945
-rw-r--r-- | Modules/FindDoxygen.cmake | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake index aff26fd..0d9e161 100644 --- a/Modules/FindDoxygen.cmake +++ b/Modules/FindDoxygen.cmake @@ -396,10 +396,12 @@ macro(_Doxygen_find_doxygen) endif() # Create an imported target for Doxygen - add_executable(Doxygen::doxygen IMPORTED GLOBAL) - set_target_properties(Doxygen::doxygen PROPERTIES - IMPORTED_LOCATION "${DOXYGEN_EXECUTABLE}" - ) + if(NOT TARGET Doxygen::doxygen) + add_executable(Doxygen::doxygen IMPORTED GLOBAL) + set_target_properties(Doxygen::doxygen PROPERTIES + IMPORTED_LOCATION "${DOXYGEN_EXECUTABLE}" + ) + endif() endif() endmacro() @@ -429,10 +431,12 @@ macro(_Doxygen_find_dia) endif() # Create an imported target for component - add_executable(Doxygen::dia IMPORTED GLOBAL) - set_target_properties(Doxygen::dia PROPERTIES - IMPORTED_LOCATION "${DOXYGEN_DIA_EXECUTABLE}" - ) + if(NOT TARGET Doxygen::dia) + add_executable(Doxygen::dia IMPORTED GLOBAL) + set_target_properties(Doxygen::dia PROPERTIES + IMPORTED_LOCATION "${DOXYGEN_DIA_EXECUTABLE}" + ) + endif() endif() unset(_x86) @@ -474,10 +478,12 @@ macro(_Doxygen_find_dot) endif() # Create an imported target for component - add_executable(Doxygen::dot IMPORTED GLOBAL) - set_target_properties(Doxygen::dot PROPERTIES - IMPORTED_LOCATION "${DOXYGEN_DOT_EXECUTABLE}" - ) + if(NOT TARGET Doxygen::dot) + add_executable(Doxygen::dot IMPORTED GLOBAL) + set_target_properties(Doxygen::dot PROPERTIES + IMPORTED_LOCATION "${DOXYGEN_DOT_EXECUTABLE}" + ) + endif() endif() unset(_Doxygen_GRAPHVIZ_BIN_DIRS) @@ -510,10 +516,12 @@ macro(_Doxygen_find_mscgen) endif() # Create an imported target for component - add_executable(Doxygen::mscgen IMPORTED GLOBAL) - set_target_properties(Doxygen::mscgen PROPERTIES - IMPORTED_LOCATION "${DOXYGEN_MSCGEN_EXECUTABLE}" - ) + if(NOT TARGET Doxygen::mscgen) + add_executable(Doxygen::mscgen IMPORTED GLOBAL) + set_target_properties(Doxygen::mscgen PROPERTIES + IMPORTED_LOCATION "${DOXYGEN_MSCGEN_EXECUTABLE}" + ) + endif() endif() unset(_x86) |