MantisBT - CMake
View Issue Details
0011583CMakeModulespublic2010-12-08 11:292016-06-10 14:31
Pierre Ossman 
Bill Hoffman 
normalfeaturealways
closedmoved 
CMake-2-8 
 
0011583: No simple function to find "tools" as opposed to programs
Autoconf separates the concept of "tools" and "programs" in the macros AC_PROG_PATH and AC_TOOL_PATH (and variants). The difference only matters when you cross-compile, but when you do that distinction is crucial.

CMake unfortunately doesn't expose such a distinction, even though it uses it internally. The attached patch puts this in a generic function called find_tool() and changes the current internal users to this (just binutils really).

This also fixes a buggy pkg-config implementation as that really is a "tool" and not a "program". This makes it possible to use pkg-config with cross-compiler setups, something that wasn't previously possible (not without hacks at least).
No tags attached.
related to 0008034closed Alex Neundorf In cross compiling mode FIND_PROGRAM() doesn't use CMAKE_PROGRAM_SUFFIX of the target platform 
child of 0014539closed Kitware Robot Multiple output configurations 
patch find_tool.patch (4,352) 2010-12-08 11:29
https://public.kitware.com/Bug/file/3554/find_tool.patch
Issue History
2010-12-08 11:29Pierre OssmanNew Issue
2010-12-08 11:29Pierre OssmanFile Added: find_tool.patch
2010-12-08 11:46Alex NeundorfNote Added: 0023797
2010-12-08 12:21Pierre OssmanNote Added: 0023800
2010-12-08 12:26Pierre OssmanNote Added: 0023801
2010-12-15 12:25David ColeRelationship addedrelated to 0008034
2010-12-15 12:25David ColeAssigned To => Bill Hoffman
2010-12-15 12:25David ColeStatusnew => assigned
2013-11-02 10:35Stephen KellyRelationship addedchild of 0014539
2016-06-10 14:28Kitware RobotNote Added: 0041769
2016-06-10 14:28Kitware RobotStatusassigned => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0023797)
Alex Neundorf   
2010-12-08 11:46   
This is related to 0008034.

Alex
(0023800)
Pierre Ossman   
2010-12-08 12:21   
I'm not sure what's going on on bug 8034, but it seems to be something else. The reporter there expects find_program() to find an executable for the target system. That is of course entirely wrong as find_program() is for stuff you want to run, and you can't run those binaries. The same thing applies for find_tool(), i.e. you want something you are able to execute.

(the difference between find_program() and find_tool() is what the program outputs, not what arch/system the executable is compiled for)
(0023801)
Pierre Ossman   
2010-12-08 12:26   
Sorry, didn't read the entire thread. Not really used to Mantis. :/

It is slightly related, but will probably have different solutions. All the foo-config variants are not very cross-compile friendly, so most projects have deprecated them in favour of pkg-config. It could be solved in their case if they have a i686-pc-mingw32-kde4-config that is executable for Linux, but gives information for mingw. In that case my function would help. There is still the question who would create that program though?
(0041769)
Kitware Robot   
2016-06-10 14:28   
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.