Re: [gdal-dev] Why can't find_package(GDAL CONFIG) find GDAL_LIBRARIES?

2022-06-07 Thread Tom O'Reilly
Hi Even, You write: > There's no universal way however of knowing the X::Y target name for a random > package. You have to consult each package's documentation. Where is this typically documented? For example, where can I find GDAL package documentation? I looked in the [ https://gdal.org/gd

Re: [gdal-dev] Why can't find_package(GDAL CONFIG) find GDAL_LIBRARIES?

2022-06-07 Thread Even Rouault
That becomes slightly out-of-topic, but CMake practices have evolved over time. Having depencies expressed from target name is indeed more elegant/powerful. There's no universal way however of knowing the X::Y target name for a random package. You have to consult each package's documentation. O

Re: [gdal-dev] Why can't find_package(GDAL CONFIG) find GDAL_LIBRARIES?

2022-06-07 Thread Tom O'Reilly
Thanks for this information Even - very useful and interesting. I'm still a cmake newbie, and one cmake aspect that drives me nuts is its "inconsistency" when it comes to finding packages ("Should I call find_package(X) with MODULE or CONFIG?", "Is it X_INCLUDE_DIRS or X_INCLUDES?"). So my CMa

Re: [gdal-dev] Why can't find_package(GDAL CONFIG) find GDAL_LIBRARIES?

2022-06-07 Thread Kai Pastor, DG0YT
Am 07.06.22 um 09:28 schrieb Even Rouault: Note: If you really wanted to get the equivalent of GDAL_INCLUDE_DIRS and GDAL_LIBRARIES, you could use the following expressions: $ $ It is not so trivial. $ - won't carry GDAL itself - may use generator expressions (in particular for multi-config

Re: [gdal-dev] Why can't find_package(GDAL CONFIG) find GDAL_LIBRARIES?

2022-06-07 Thread Even Rouault
Tom, GDAL_LIBRARIES and GDAL_INCLUDE_DIRS are indeed not defined. You have to use the "GDAL::GDAL" target in a target_link_libraries() statement which propagates both include and linking requirements and tends to be the modern CMake practice, although admitedly not very clearly documented in t