MantisBT - CMake
View Issue Details
0011680CMakeCMakepublic2011-01-10 17:202016-06-10 14:31
Emmanuel Blot 
Brad King 
normalmajoralways
closedmoved 
PCWindows 7 / Cygwin 1.7
CMake 2.8.3 
 
0011680: FIND_PROGRAM fails to locate a versioned compiler
This is a Cygwin-only issue.

the FIND_PROGRAM works with the following cases:
  FIND_PROGRAM (xcc arm-eabi-gcc) # evaluate to /usr/local/bin/arm-eabi-gcc.exe
  FIND_PROGRAM (xcc arm-eabi-gcc-4.5.2.exe) # evaluate to /usr/local/bin/arm-eabi-gcc-4.5.2.exe
but fails to find the executable with the following case:
  FIND_PROGRAM (xcc arm-eabi-gcc-4.5.2) # xcc-NOTFOUND

The latter command works on any other hosts but Windows/Cygwin.
It seems that CYGWIN variable is not set to 1 either:

MESSAGE (STATUS "CYGWIN: ${CYGWIN}")
  prints out
-- CYGWIN:
No tags attached.
related to 0009879closed Kitware Robot find_program command doesn't take PATHEXT into account 
Issue History
2011-01-10 17:20Emmanuel BlotNew Issue
2011-01-11 17:30Brad KingAssigned To => Brad King
2011-01-11 17:30Brad KingStatusnew => assigned
2011-01-11 17:37Brad KingNote Added: 0024598
2011-01-11 17:41Brad KingRelationship addedrelated to 0009879
2011-01-11 17:43Brad KingNote Added: 0024599
2012-08-13 10:44Brad KingStatusassigned => backlog
2012-08-13 10:44Brad KingNote Added: 0030554
2016-06-10 14:28Kitware RobotNote Added: 0041775
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0024598)
Brad King   
2011-01-11 17:37   
It looks like this can happen when the name given has a "." in it. The find_program command implementation eventually finds its way down to Source/kwsys/SystemTools.cxx in the SystemTools::FindProgram method. The method only tries adding ".exe" and ".com" extensions when there is not already an extension.

This was first introduced here:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a5825cd1#patch20 [^]

but then later changed slightly so that it only happens when the '.' is the fourth-to-last character in the name given (as in foo.exe, but also as in foo.1.2.3 where ".2.3" appears to be a 3-character extension):

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08bb4d52 [^]
(0024599)
Brad King   
2011-01-11 17:43   
Issue 0009879 is very related. All extensions named by the PATHEXT environment variable should be tried unless the name already ends in exactly one of them.
(0030554)
Brad King   
2012-08-13 10:44   
Sending issues I'm not actively working on to the backlog to await someone with time for them.

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it:

 http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer or contributor who has the bandwidth to take it on.
(0041775)
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.