[cmake-developers] [CMake 0014486]: Search paths without a root component recognized by the host operating system should be ignored by find commands

Mantis Bug Tracker mantis at public.kitware.com
Tue Oct 15 14:57:14 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14486 
====================================================================== 
Reported By:                irwin
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14486
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-10-15 14:57 EDT
Last Modified:              2013-10-15 14:57 EDT
====================================================================== 
Summary:                    Search paths without a root component recognized by
the host operating system should be ignored by find commands
Description: 
This is the second of two issues noted on the mailing-list thread started at
http://public.kitware.com/pipermail/cmake-developers/2013-October/008589.html
for Windows systems that happen to have a Linux file hierarchy mounted as a
particular drive letter. (This scenario always happens on Wine, but it could
also occur on the Microsoft version of Windows.)  The first of these issues "The
result of find commands should always have the drive letter included on Windows
platforms" has already been reported at
http://public.kitware.com/Bug/view.php?id=14485.

The test CMake code is as follows:
 
find_program(LUA_EXECUTABLE lua
  PATHS
  /usr/bin
  NO_DEFAULT_PATH
  )
message(STATUS "LUA_EXECUTABLE = ${LUA_EXECUTABLE}")
 
When the above is executed from the MSYS bash.exe shell, then the
following result is obtained:
 
bash.exe-3.1$ cmake -P test.cmake
-- LUA_EXECUTABLE = /usr/bin/lua
 
When bug 14485 is addressed that result should become

-- LUA_EXECUTABLE = z:/usr/bin/lua

which has the merit of always referring to a real file when the find is a
success.

The current bug report concerns the different issue of when that real file is
not what you want for the case when a Linux file system hierarchy is mounted as
a drive letter (in this case z:).  For this case, I assume most users would
normally prefer PATHS values such as /usr/bin without a drive letter (as in the
above test code) be ignored by find commands since obviously many Linux files
found this way are normally useless on a Windows system.  But in the above
mailing-list discussion Brad King made the case that some Windows users would
prefer the find command to stay just as it is (i.e., for PATHS values without a
drive letter specified, all possible drive letters are searched to see if any
matches are obtained).  So to cater to the needs of the two different sets of
Windows users, I propose the following possibilities be available.

1. The current status quo as default since some Windows users prefer that.

2. Ignore sources of search paths (such as PATHS values) which are unrooted,
i.e. (this is Brad's description) "paths without a root component recognized by
the host operating system".  This possibility would only be used if the user set
a unique cmake variable or property (named, say IGNORE_UNROOTED_SEARCH_PATHS) to
a true value and would insure that PATHS values without drive letter such as
/usr/bin would be ignored on Windows for all find commands.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-10-15 14:57 irwin          New Issue                                    
======================================================================




More information about the cmake-developers mailing list