Re: [CMake] FindImageMagick: Rewrite to support all utilities.
On 10/19/07, Alex Neundorf wrote: On Thursday 18 October 2007 21:25, Miguel A. Figueroa-Villanueva wrote: On 10/14/07, Alex Neundorf wrote: On Saturday 13 October 2007 07:17, Miguel A. Figueroa-Villanueva wrote: Hello, I've been assigned the task of maintaining the ImageMagick find module. As such, I made a rewrite to support the complete toolchain (i.e., all command line executables) and would like to ask for user feedback before committing the changes. The new module is attached for reference. Why do you use FIND_PATH() instead of FIND_PROGRAM() ? Then you wouldn't have to care for the different suffixes. Something like this should work: FIND_PROGRAM(ImageMagick_mogrify_EXECUTABLE mogrify ...) GET_FILENAME_COMPONENT(ImageMagick_EXECUTABLE_DIR ImageMagick_mogrify_EXECUTABLE PATH ) ... Then the only variable in the CACHE would be ImageMagick_mogrify_EXECUTABLE instead of ImageMagick_EXECUTABLE_DIR. Should I change ImageMagick_EXECUTABLE_DIR to ImageMagick_ROOT_DIR ?? Can you please post the new file before committing ? I have posted the new file as feature request #5919 (http://www.cmake.org/Bug/view.php?id=5919). So, that the discussion can continue on the bug tracker with whoever is interested in this. Note that I'll commit after about a week if no one comments. I have taken care to replicate the VARIABLES and CACHE VARIABLES available when using the current module in the new module for backward compatibility. Alex, there is a note in it commenting why I reverted to thinking it is best to use FIND_PATH instead of FIND_PROGRAM. --Miguel ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] FindImageMagick: Rewrite to support all utilities.
On 10/14/07, Alex Neundorf wrote: On Saturday 13 October 2007 07:17, Miguel A. Figueroa-Villanueva wrote: Hello, I've been assigned the task of maintaining the ImageMagick find module. As such, I made a rewrite to support the complete toolchain (i.e., all command line executables) and would like to ask for user feedback before committing the changes. The new module is attached for reference. The pattern that I'm using for this find module comes up a few times, for example FindLATEX could use it. Instead of hard-coding the tools to search for I use the COMPONENTS argument in of the FIND_PACKAGE command. For example, if I need ImageMagick's convert I would do: FIND_PACKAGE(ImageMagick COMPONENTS convert) If found the following variables will be set: # 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. Why do you use FIND_PATH() instead of FIND_PROGRAM() ? Then you wouldn't have to care for the different suffixes. Something like this should work: FIND_PROGRAM(ImageMagick_mogrify_EXECUTABLE mogrify ...) GET_FILENAME_COMPONENT(ImageMagick_EXECUTABLE_DIR ImageMagick_mogrify_EXECUTABLE PATH ) ... Then the only variable in the CACHE would be ImageMagick_mogrify_EXECUTABLE instead of ImageMagick_EXECUTABLE_DIR. Should I change ImageMagick_EXECUTABLE_DIR to ImageMagick_ROOT_DIR ?? Since I haven't had any objections I'll go ahead and commit with the previous change (i.e., find_program thing above). Note also that I would like to make the following additions: - add XXX_EXECUTABLE_DIR to the variables in the readme.txt in the Modules directory, unless it is recommended to use the XXX_ROOT_DIR naming. - create a macro in the same line of FIND_PACKAGE_HANDLE_STANDARD_ARGS(...), and possibly in the same file, that checks if all components are found to set the main variable: FIND_PACKAGE_HANDLE_STANDARD_COMPONENTS(ImageMagick) would basically do a: # check if all components are found to set XXX_FOUND SET(XXX_FOUND TRUE) FOREACH (component ${XXX_FIND_COMPONENTS}) IF (NOT XXX_${component}_FOUND) SET(XXX_FOUND FALSE) ENDIF (NOT XXX_${component}_FOUND) ENDFOREACH (component) # handle standard args FIND_PACKAGE_HANDLE_STANDARD_ARGS(XXX DEFAULT_MSG XXX_FOUND) - Create a list of clean, standard compliant, non-patched cmake modules that can be used as example references for module developers. This could be added in the Module maintainer wiki page and/or the readme.txt and would add context to the specs in the readme.txt file. --Miguel ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] FindImageMagick: Rewrite to support all utilities.
On Saturday 13 October 2007 07:17, Miguel A. Figueroa-Villanueva wrote: Hello, I've been assigned the task of maintaining the ImageMagick find module. As such, I made a rewrite to support the complete toolchain (i.e., all command line executables) and would like to ask for user feedback before committing the changes. The new module is attached for reference. The pattern that I'm using for this find module comes up a few times, for example FindLATEX could use it. Instead of hard-coding the tools to search for I use the COMPONENTS argument in of the FIND_PACKAGE command. For example, if I need ImageMagick's convert I would do: FIND_PACKAGE(ImageMagick COMPONENTS convert) If found the following variables will be set: # 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. Why do you use FIND_PATH() instead of FIND_PROGRAM() ? Then you wouldn't have to care for the different suffixes. Bye Alex ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] FindImageMagick: Rewrite to support all utilities.
Hello, I've been assigned the task of maintaining the ImageMagick find module. As such, I made a rewrite to support the complete toolchain (i.e., all command line executables) and would like to ask for user feedback before committing the changes. The new module is attached for reference. The pattern that I'm using for this find module comes up a few times, for example FindLATEX could use it. Instead of hard-coding the tools to search for I use the COMPONENTS argument in of the FIND_PACKAGE command. For example, if I need ImageMagick's convert I would do: FIND_PACKAGE(ImageMagick COMPONENTS convert) If found the following variables will be set: # 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_convert_EXECUTABLE would have the path to the convert executable. Note that in the approach I followed, the only CACHE variable is ImageMagick_EXECUTABLE_DIR the others are not set in the cache. I don't see an entry for XXX_EXECUTABLE_DIR in the Modules/readme.txt, but I think it is the appropriate name. Or should it be XXX_ROOT_DIR in this case? The variables set in the old ImageMagick module are kept for backward compatibility. Let me know if there are any objections to this layout; otherwise I'll commit the changes. Thanks, --Miguel FindImageMagick.cmake Description: Binary data ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake