gdal
gdal copied to clipboard
CMake: handle multiple paths stored in XXX__INCLUDE_DIR when checking for version strings
Feature description
Packagers must often specify multiple paths inside a single CMake variable, such as for multiple includes, or libs, for a single driver.
However GDAL's CMake system assumes that the variable contains only one value (path), when looking for version strings. For example:
- in
FindLibKML.cmake
see the line-
file(STRINGS ${LIBKML_INCLUDE_DIR}/kml/base/version.h libkml_version_h_string
-
- a packager might have set
LIBKML_INCLUDE_DIR = "LIB1/include;LIB1/install/include;LIB3/include"
- that causes warnings of
-
LIBXXX has unknown version. Assuming it is at least matching the minimum version required of X.X
-
Additional context
I've been modifying the FindXXX.cmake
paths for the version strings by hand for many GDAL drivers, but I am sure that it would be beneficial to all packagers if this was handled somehow out of the box. thanks.