[CMake] globs case sensitivity depends on platform

🐋 Jan Hegewald jan.hegewald at awi.de
Thu Jan 28 06:56:36 EST 2016


Hi all,
I have some trouble with file globbing using the glob command like so:
	file(GLOB all_sources ${src_home}/*.F**)
the src_home contains files with uppercase and also some with lowercase suffixes, e.g. .F and .f (This makes an important difference to some Fortran compilers regarding the C preprocessor.).
Now the all_sources does not contain the same list of files on different platforms: On my Mac, the F* glob returns the F* and the f* files, whereas on linux it only returns the F* files.
I tested with a case sensitive filesystem on the Mac too, same result: uppercase and lowercase are returned.
The cmake on both tested systems is "cmake version 3.4.3".

My current solution is this:
	file(GLOB all_sources ${src_home}/*.F** ${src_home}/*.f**)
	list(REMOVE_DUPLICATES all_sources)

Am I missing something obvious here? Do you know a better workaround? I think this is an error with cmakes glob, where can I report it?

Many TIA,
Jan


More information about the CMake mailing list