MantisBT - CMake
View Issue Details
0015007CMakeModulespublic2014-07-05 05:002016-06-10 14:31
broucari 
Kitware Robot 
highmajoralways
closedmoved 
Debian linuxsid
CMake 2.8.12.2 
 
0015007: FindImageMagick detection broken with multi-arch imagemagick, need CFLAGS from pkgconfig
Imagemagick detection is still broken with cmake. Indeed some headers are installed under arch dependant dir and it need to specify CFLAGS in order to get quantum selection.

May be related to 0014012

Reported downstream as:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747907 [^]

I have made an untested patch using pkg-config.

Please fix it, it lead to multiple FTBFS.

Thanks

Download recent imagemagick from debian experimental, and try to compile libtuxcap See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747908 [^]
Block newer imagemagick in experimental.
No tags attached.
related to 0014012closed Brad King FindImageMagick.cmake needs update for ImageMagick >= 6.8.0-8, perhaps use pkgconfig 
? Fix-imagemagick-multiarch (3,509) 2014-07-05 05:00
https://public.kitware.com/Bug/file/5185/Fix-imagemagick-multiarch
diff Imagemagick2try.diff (1,850) 2014-07-12 16:22
https://public.kitware.com/Bug/file/5191/Imagemagick2try.diff
? patch (2,403) 2014-07-22 16:44
https://public.kitware.com/Bug/file/5196/patch
patch 0001-FindImageMagick-Find-arch-include-dir-15007.patch (2,135) 2014-07-23 09:42
https://public.kitware.com/Bug/file/5198/0001-FindImageMagick-Find-arch-include-dir-15007.patch
patch 0002-FindImageMagick-Provide-per-component-include-dirs-15007.patch (2,015) 2014-07-23 15:35
https://public.kitware.com/Bug/file/5199/0002-FindImageMagick-Provide-per-component-include-dirs-15007.patch
Issue History
2014-07-05 05:00broucariNew Issue
2014-07-05 05:00broucariFile Added: Fix-imagemagick-multiarch
2014-07-07 09:27Brad KingRelationship addedrelated to 0014012
2014-07-07 09:57Brad KingNote Added: 0036321
2014-07-07 09:57Brad KingStatusnew => backlog
2014-07-12 16:22broucariFile Added: Imagemagick2try.diff
2014-07-12 16:23broucariNote Added: 0036357
2014-07-14 11:06Brad KingNote Added: 0036372
2014-07-14 13:32broucariNote Added: 0036375
2014-07-14 15:08Brad KingSummary[patch] Imagemagick detection stlli broken with multi-arch imagemagick => FindImageMagick detection broken with multi-arch imagemagick, need CFLAGS from pkgconfig
2014-07-14 15:09Brad KingNote Added: 0036379
2014-07-22 15:24broucariNote Added: 0036430
2014-07-22 15:35Brad KingNote Added: 0036431
2014-07-22 16:44broucariFile Added: patch
2014-07-22 16:45broucariNote Added: 0036432
2014-07-23 09:42Brad KingFile Added: 0001-FindImageMagick-Find-arch-include-dir-15007.patch
2014-07-23 09:43Brad KingNote Added: 0036436
2014-07-23 13:49broucariNote Added: 0036441
2014-07-23 14:04Brad KingNote Added: 0036442
2014-07-23 14:40broucariNote Added: 0036443
2014-07-23 14:56Brad KingNote Added: 0036445
2014-07-23 15:35Brad KingFile Added: 0002-FindImageMagick-Provide-per-component-include-dirs-15007.patch
2014-07-23 15:35Brad KingNote Added: 0036447
2014-07-24 13:11broucariNote Added: 0036453
2014-07-24 13:44Brad KingNote Added: 0036454
2016-06-10 14:29Kitware RobotNote Added: 0042581
2016-06-10 14:29Kitware RobotStatusbacklog => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0036321)
Brad King   
2014-07-07 09:57   
One reason little progress on this module is made is that there is no module maintainer for it as mentioned in 0014012:0032631.

The patch proposed in this issue hard-codes use of pkgconfig if it is available but we need to still fall back to a normal search if pkgconfig fails to find the component. See 0014012:0036320 for an update to the patch in 0014012.
(0036357)
broucari   
2014-07-12 16:23   
Hi,

I have attached a second patch with fallback. Please review
(0036372)
Brad King   
2014-07-14 11:06   
Thanks. However, we still need to let users control the find results in the cache. The pkgconfig results can be used at most for hints to the normal find_ commands. See 0001-FindImageMagick-Use-pkgconfig-hints-if-available-14012.patch in 0014012.

Also, LDFLAGS cannot be used as the _LIBRARY result. Perhaps other fields from FindPkgConfig can be used:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/FindPkgConfig.cmake;hb=v3.0.0#l369 [^]
(0036375)
broucari   
2014-07-14 13:32   
Hi,

Your patch is perfect, CFLAGS lack is not critical, imagemagick try to guess the correct answer and will only warn for now.

I do not understand the LDFLAGS part. Your solution is good
(0036379)
Brad King   
2014-07-14 15:09   
Re 0015007:0036375: I've applied the patch as recorded in 0014012:0036377.

This issue will remain open pending a solution for CFLAGS.
(0036430)
broucari   
2014-07-22 15:24   
The previous patch does not work indeed:
- imagemagick need -I/usr/include/ImagemaMagick
AND -I/usr/include/somearch/ImagemaMagick-6

pkgconfig give the two path
(0036431)
Brad King   
2014-07-22 15:35   
Re 0015007:0036430: We search for ImagemaMagick-6 since 0014174 but still only return one of the two. We still need a solution that works without pkgconfig, so the module will have to be taught that both directories are needed.

Are they always next to one another? What determines the number "6" in the name?
(0036432)
broucari   
2014-07-22 16:45   
The last patch work, at least for me.

Bastien
(0036436)
Brad King   
2014-07-23 09:43   
Re 0015007:0036432: Thanks! Based on that I constructed a slightly simpler version. Please try "0001-FindImageMagick-Find-arch-include-dir-15007.patch".
(0036441)
broucari   
2014-07-23 13:49   
No it does not work because you do not add arch include to component include variable.

Bastien
(0036442)
Brad King   
2014-07-23 14:04   
Re 0015007:0036441: Although ImageMagick_<component>_INCLUDE_DIRS is documented I do not see anywhere that sets it prior to your patch. Fixing that is a separate problem of either setting it or removing the docs.

Do the proper paths end up in ImageMagick_INCLUDE_DIRS?
(0036443)
broucari   
2014-07-23 14:40   
Yes ImageMagick_INCLUDE_DIRS are set.

I do not agree with you ImageMagick_<component>_INCLUDE_DIRS end in Cmake cache due to findPath.

Bastien
(0036445)
Brad King   
2014-07-23 14:56   
Re 0015007:0036443: Only the singular name "ImageMagick_${component}_INCLUDE_DIR" is in the cache, and that one is not documented for public use. Now
"ImageMagick_${component}_ARCH_INCLUDE_DIR" is also in the cache, but also not documented for public use.

If we want to set the plural ImageMagick_${component}_INCLUDE_DIRS name to satisfy the documentation then that can be done as a follow-up fix. It should not be cached.
(0036447)
Brad King   
2014-07-23 15:35   
Re 0015007:0036445: Please try "0002-FindImageMagick-Provide-per-component-include-dirs-15007.patch" on top of the previous patch to get ImageMagick_${component}_INCLUDE_DIRS.
(0036453)
broucari   
2014-07-24 13:11   
Now work as a charm
(0036454)
Brad King   
2014-07-24 13:44   
Re 0015007:0036453: Thanks for testing! Applied:

 FindImageMagick: Find arch include dir
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f5581c1 [^]

 FindImageMagick: Provide per-component include dirs
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1342e022 [^]

This issue must still remain open as in 0015007:0036379.
(0042581)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.