[CMake] Proposed fix for the FindX11.cmake triplication annoyance

Alexander Neundorf a.neundorf-work at gmx.net
Mon Aug 6 15:27:18 EDT 2007


On Friday 03 August 2007 13:27, Alan W. Irwin wrote:
> On Linux (at least for both my Debian and Ubuntu platforms), FindX11.cmake
> sets X11_INCLUDE_DIR to /usr/include;/usr/include;/usr/include.
>
> This triplication is an annoyance at least in the case where you are using
> SET_SOURCE_FILES_PROPERTIES to set the -I compiler flags (as we do for the
> subset of the PLplot source files which depend on X) because you then
> end up with triplicate -I/usr/include options for the compiler which
> (unless the compiler itself ignores duplicate -I flags) causes compilation
> inefficiencies as the same /usr/include directory is searched three times
> for header files.

Does this really happen ?
Please have a look at 
void cmMakefile::AddIncludeDirectory(const char* inc, bool before), this 
should actually avoid duplicates according to the comment.

Alex


More information about the CMake mailing list