IMPORTANT FIX: be extra-careful here on WIN32, we do NOT want CMake to look in the system's PATH env var to search for ImageMagick's convert.exe, otherwise it is going to pick Microsoft Window's own convert.exe, which is used to convert FAT partitions to NTFS format ! Depending on the options passed to convert.exe, there is a good chance you would kiss your hard-disk good-bye.
This commit is contained in:
parent
d4d04b46cd
commit
5e366c361d
|
@ -9,26 +9,69 @@
|
|||
# IMAGEMAGICK_COMPOSITE_EXECUTABLE = the full path to the 'composite' utility
|
||||
#
|
||||
|
||||
FIND_PROGRAM(IMAGEMAGICK_CONVERT_EXECUTABLE
|
||||
NAMES convert
|
||||
)
|
||||
IF (WIN32)
|
||||
|
||||
# Try to find the ImageMagick binary path.
|
||||
|
||||
FIND_PATH(IMAGEMAGICK_BINARY_PATH mogrify.exe
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]
|
||||
DOC "Path to the ImageMagick binary directory where all executable should be found."
|
||||
)
|
||||
|
||||
# Be extra-careful here: we do NOT want CMake to look in the system's PATH
|
||||
# env var to search for convert.exe, otherwise it is going to pick
|
||||
# Window's own convert.exe, and you may say good-bye to your disk.
|
||||
|
||||
FIND_PROGRAM(IMAGEMAGICK_CONVERT_EXECUTABLE
|
||||
NAMES convert
|
||||
PATHS ${IMAGEMAGICK_BINARY_PATH}
|
||||
NO_SYSTEM_PATH
|
||||
DOC "Path to ImageMagick's convert executable. WARNING: note that this tool, named convert.exe, conflicts with Microsoft Window's own convert.exe, which is used to convert FAT partitions to NTFS format ! Therefore, be extra-careful and make sure the right convert.exe has been picked."
|
||||
)
|
||||
|
||||
ELSE (WIN32)
|
||||
|
||||
SET (IMAGEMAGICK_BINARY_PATH "")
|
||||
|
||||
FIND_PROGRAM(IMAGEMAGICK_CONVERT_EXECUTABLE
|
||||
NAMES convert
|
||||
PATHS ${IMAGEMAGICK_BINARY_PATH}
|
||||
DOC "Path to ImageMagick's convert executable."
|
||||
)
|
||||
|
||||
ENDIF (WIN32)
|
||||
|
||||
# Find mogrify, import, montage, composite
|
||||
|
||||
FIND_PROGRAM(IMAGEMAGICK_MOGRIFY_EXECUTABLE
|
||||
NAMES mogrify
|
||||
PATHS ${IMAGEMAGICK_BINARY_PATH}
|
||||
DOC "Path to ImageMagick's mogrify executable."
|
||||
)
|
||||
|
||||
FIND_PROGRAM(IMAGEMAGICK_IMPORT_EXECUTABLE
|
||||
NAMES import
|
||||
PATHS ${IMAGEMAGICK_BINARY_PATH}
|
||||
DOC "Path to ImageMagick's import executable."
|
||||
)
|
||||
|
||||
FIND_PROGRAM(IMAGEMAGICK_MONTAGE_EXECUTABLE
|
||||
NAMES montage
|
||||
PATHS ${IMAGEMAGICK_BINARY_PATH}
|
||||
DOC "Path to ImageMagick's montage executable."
|
||||
)
|
||||
|
||||
FIND_PROGRAM(IMAGEMAGICK_COMPOSITE_EXECUTABLE
|
||||
NAMES composite
|
||||
PATHS ${IMAGEMAGICK_BINARY_PATH}
|
||||
DOC "Path to ImageMagick's composite executable."
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
IMAGEMAGICK_BINARY_PATH
|
||||
IMAGEMAGICK_CONVERT_EXECUTABLE
|
||||
IMAGEMAGICK_MOGRIFY_EXECUTABLE
|
||||
IMAGEMAGICK_IMPORT_EXECUTABLE
|
||||
IMAGEMAGICK_MONTAGE_EXECUTABLE
|
||||
IMAGEMAGICK_COMPOSITE_EXECUTABLE
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue