|
|
@@ -5,7 +5,9 @@
|
|
|
FindImageMagick
|
|
|
---------------
|
|
|
|
|
|
-Find ImageMagick binary suite.
|
|
|
+Find ImageMagick, software suite for displaying, converting and
|
|
|
+manipulating raster images.
|
|
|
+
|
|
|
|
|
|
.. versionadded:: 3.9
|
|
|
Added support for ImageMagick 7.
|
|
|
@@ -15,65 +17,87 @@ components in the :command:`find_package` call. Typical components include,
|
|
|
but are not limited to (future versions of ImageMagick might have
|
|
|
additional components not listed here):
|
|
|
|
|
|
-::
|
|
|
+* ``animate``
|
|
|
+* ``compare``
|
|
|
+* ``composite``
|
|
|
+* ``conjure``
|
|
|
+* ``convert``
|
|
|
+* ``display``
|
|
|
+* ``identify``
|
|
|
+* ``import``
|
|
|
+* ``mogrify``
|
|
|
+* ``montage``
|
|
|
+* ``stream``
|
|
|
|
|
|
- animate
|
|
|
- compare
|
|
|
- composite
|
|
|
- conjure
|
|
|
- convert
|
|
|
- display
|
|
|
- identify
|
|
|
- import
|
|
|
- mogrify
|
|
|
- montage
|
|
|
- stream
|
|
|
+If no component is specified in the :command:`find_package` call, then it only
|
|
|
+searches for the ImageMagick executable directory.
|
|
|
|
|
|
+There are also components for the following ImageMagick APIs:
|
|
|
|
|
|
+* ``Magick++``: ImageMagick C++ API, if found.
|
|
|
+* ``MagickWand``: ImageMagick MagickWand C API, if found.
|
|
|
+* ``MagickCore``: ImageMagick MagickCore low-level C API, if found.
|
|
|
|
|
|
-If no component is specified in the :command:`find_package` call, then it only
|
|
|
-searches for the ImageMagick executable directory. This code defines
|
|
|
-the following variables:
|
|
|
|
|
|
-::
|
|
|
+Imported targets
|
|
|
+^^^^^^^^^^^^^^^^
|
|
|
|
|
|
- ImageMagick_FOUND - TRUE if all components are found.
|
|
|
- ImageMagick_EXECUTABLE_DIR - Full path to executables directory.
|
|
|
- ImageMagick_<component>_FOUND - TRUE if <component> is found.
|
|
|
- ImageMagick_<component>_EXECUTABLE - Full path to <component> executable.
|
|
|
- ImageMagick_VERSION_STRING - the version of ImageMagick found
|
|
|
- (since CMake 2.8.8)
|
|
|
+.. versionadded:: 3.26
|
|
|
|
|
|
+This module defines the following :prop_tgt:`IMPORTED` targets:
|
|
|
|
|
|
+``ImageMagick::Magick++``
|
|
|
+ ImageMagick C++ API, if found.
|
|
|
|
|
|
-``ImageMagick_VERSION_STRING`` will not work for old versions like 5.2.3.
|
|
|
+``ImageMagick::MagickWand``
|
|
|
+ ImageMagick MagickWand C API, if found.
|
|
|
|
|
|
-There are also components for the following ImageMagick APIs:
|
|
|
+``ImageMagick::MagickCore``
|
|
|
+ ImageMagick MagickCore low-level C API, if found.
|
|
|
|
|
|
-::
|
|
|
|
|
|
- Magick++
|
|
|
- MagickWand
|
|
|
- MagickCore
|
|
|
+Result Variables
|
|
|
+^^^^^^^^^^^^^^^^
|
|
|
|
|
|
+``ImageMagick_FOUND``
|
|
|
+ TRUE if all components are found.
|
|
|
|
|
|
+``ImageMagick_EXECUTABLE_DIR``
|
|
|
+ Full path to executables directory.
|
|
|
|
|
|
-For these components the following variables are set:
|
|
|
+``ImageMagick_INCLUDE_DIRS``
|
|
|
+ Full paths to all include dirs.
|
|
|
|
|
|
-::
|
|
|
+``ImageMagick_LIBRARIES``
|
|
|
+ Full paths to all libraries.
|
|
|
|
|
|
- ImageMagick_FOUND - TRUE if all components are found.
|
|
|
- ImageMagick_INCLUDE_DIRS - Full paths to all include dirs.
|
|
|
- ImageMagick_LIBRARIES - Full paths to all libraries.
|
|
|
- ImageMagick_<component>_FOUND - TRUE if <component> is found.
|
|
|
- ImageMagick_<component>_INCLUDE_DIRS - Full path to <component> include dirs.
|
|
|
- ImageMagick_<component>_LIBRARIES - Full path to <component> libraries.
|
|
|
+``ImageMagick_COMPILE_OPTIONS``
|
|
|
+ Compile options of all libraries.
|
|
|
|
|
|
+``ImageMagick_VERSION_STRING``
|
|
|
+ The version of ImageMagick found (since CMake 2.8.8).
|
|
|
+ Will not work for old versions like 5.2.3.
|
|
|
|
|
|
+``ImageMagick_<component>_FOUND``
|
|
|
+ TRUE if <component> is found.
|
|
|
|
|
|
-Example Usages:
|
|
|
+``ImageMagick_<component>_EXECUTABLE``
|
|
|
+ Full path to <component> executable.
|
|
|
+
|
|
|
+``ImageMagick_<component>_INCLUDE_DIRS``
|
|
|
+ Full path to <component> include dirs.
|
|
|
+
|
|
|
+``ImageMagick_<component>_COMPILE_OPTIONS``
|
|
|
+ .. versionadded:: 3.26
|
|
|
+
|
|
|
+ Compile options of <component>.
|
|
|
|
|
|
-::
|
|
|
+``ImageMagick_<component>_LIBRARIES``
|
|
|
+ Full path to <component> libraries.
|
|
|
+
|
|
|
+
|
|
|
+Example Usages:
|
|
|
+^^^^^^^^^^^^^^^
|
|
|
|
|
|
find_package(ImageMagick)
|
|
|
find_package(ImageMagick COMPONENTS convert)
|
|
|
@@ -81,7 +105,7 @@ Example Usages:
|
|
|
find_package(ImageMagick COMPONENTS Magick++)
|
|
|
find_package(ImageMagick COMPONENTS Magick++ convert)
|
|
|
|
|
|
-
|
|
|
+ target_link_libraries(example PRIVATE ImageMagick::Magick++)
|
|
|
|
|
|
Note that the standard :command:`find_package` features are supported (i.e.,
|
|
|
``QUIET``, ``REQUIRED``, etc.).
|
|
|
@@ -150,6 +174,8 @@ function(FIND_IMAGEMAGICK_API component header)
|
|
|
set(ImageMagick_${component}_INCLUDE_DIRS
|
|
|
${ImageMagick_${component}_INCLUDE_DIRS} PARENT_SCOPE)
|
|
|
|
|
|
+ set(ImageMagick_${component}_COMPILE_OPTIONS ${PC_${component}_CFLAGS_OTHER})
|
|
|
+
|
|
|
# Add the per-component include directories to the full include dirs.
|
|
|
list(APPEND ImageMagick_INCLUDE_DIRS ${ImageMagick_${component}_INCLUDE_DIRS})
|
|
|
list(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)
|
|
|
@@ -159,6 +185,17 @@ function(FIND_IMAGEMAGICK_API component header)
|
|
|
${ImageMagick_${component}_LIBRARY}
|
|
|
)
|
|
|
set(ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES} PARENT_SCOPE)
|
|
|
+
|
|
|
+ list(APPEND ImageMagick_COMPILE_OPTIONS
|
|
|
+ ${ImageMagick_${component}_COMPILE_OPTIONS}
|
|
|
+ )
|
|
|
+ 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}")
|
|
|
endif()
|
|
|
endfunction()
|
|
|
|