MantisBT - CMake
View Issue Details
0015941CMakeCMakepublic2016-01-29 05:052016-06-10 14:31
Jan Hegewald 
Kitware Robot 
normalminoralways
closedmoved 
Mac OS / LinuxMac OS / SUSE Linux E Server10.11.3 / 11
CMake 3.4.3 
 
0015941: file glob case sensitivity depends on platform
[The OS did not fit in the above field, so here is the full version:
Mac OS 10.11.3 / SUSE Linux Enterprise Server 11 (x86_64)]

Cmakes file glob returns files regardless of the case used in the glob expression on Mac OS (even on a case sensitive filesystem). On Linux glob returns the files which match the case being used in the expression, as would be returned by the ls terminal command.
Have two files where the suffix differs in case, use cmake file glob with on of the cases used in a suffix.
Example:
# directory
src/
  foo.f90
  bar.F90

# ls on Mac
ls src/*.F*
bar.F90

# cmake on Mac
file(GLOB all_sources ${src}/*.F*
message(STATUS "all_sources: ${all_sources}")
-- all_sources: /.../src/bar.F90;/.../src/foo.f90

# ls on Linux
ls src/*.F*
bar.F90

# cmake on Linus
file(GLOB all_sources ${src}/*.F*
message(STATUS "all_sources: ${all_sources}")
-- all_sources: /.../src/bar.F90
No tags attached.
txt CMakeLists.txt (294) 2016-01-29 05:05
https://public.kitware.com/Bug/file/5621/CMakeLists.txt
Issue History
2016-01-29 05:05Jan HegewaldNew Issue
2016-01-29 05:05Jan HegewaldFile Added: CMakeLists.txt
2016-01-29 08:42Brad KingNote Added: 0040355
2016-06-10 14:29Kitware RobotNote Added: 0042926
2016-06-10 14:29Kitware RobotStatusnew => 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
(0040355)
Brad King   
2016-01-29 08:42   
Yes, the implementation would need to be taught to read filesystem properties on the volume where the globbing takes place to see whether it is case sensitive or not.
(0042926)
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.