mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-29 04:09:35 +03:00
FindImageMagick: Allow including multiple times
This prevents attempting to create a duplicate target by adding an
`if(NOT TARGET ...)` check as in other modules. The condition was
missed in commit 1bba218214 (FindImageMagick: Define targets for
specific components, 2023-01-20, v3.26.0-rc1~23^2).
Fixes: #25970
This commit is contained in:
1 parent
b83fabd0d3
commit
63bb3fca54
1 file changed
+7
-5
@@ -185,11 +185,13 @@ function(FIND_IMAGEMAGICK_API component header)
|
||||
)
|
||||
set(ImageMagick_COMPILE_OPTIONS ${ImageMagick_COMPILE_OPTIONS} PARENT_SCOPE)
|
||||
|
||||
add_library(ImageMagick::${component} UNKNOWN IMPORTED)
|
||||
set_target_properties(ImageMagick::${component} PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${ImageMagick_${component}_INCLUDE_DIRS}"
|
||||
INTERFACE_COMPILE_OPTIONS "${ImageMagick_${component}_COMPILE_OPTIONS}"
|
||||
IMPORTED_LOCATION "${ImageMagick_${component}_LIBRARY}")
|
||||
if(NOT TARGET ImageMagick::${component})
|
||||
add_library(ImageMagick::${component} UNKNOWN IMPORTED)
|
||||
set_target_properties(ImageMagick::${component} PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${ImageMagick_${component}_INCLUDE_DIRS}"
|
||||
INTERFACE_COMPILE_OPTIONS "${ImageMagick_${component}_COMPILE_OPTIONS}"
|
||||
IMPORTED_LOCATION "${ImageMagick_${component}_LIBRARY}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
Reference in new issue
Block a user