[gdal-dev] CMake and internal json-c

Even Rouault even.rouault at spatialys.com
Tue Mar 15 04:16:33 PDT 2022


Hi,

if you define both GDAL_USE_JSONC=ON and GDAL_USE_JSONC_INTERNAL=ON, the 
use of the internal variant will take precedence. It would be a good 
contribution to mention that in https://gdal.org/build_hints.html

Technically, the report is correct: external json-c has been found. But 
it is not used. The standard CMake FeatureSummary functionality that is 
used doesn't take that subtlety into account. One could possible decide 
to remove the external component from the list of detected component 
when there's a corresponding _INTERNAL=ON  setting. If you feel it would 
be good, please file an issue about that. Bonus point if accompanied 
with a patch. The solution would probably to add some code to all 
|PACKAGES_FOUND| before the call to feature_summary() (cf 
https://cmake.org/cmake/help/latest/module/FeatureSummary.html)

Even

Le 15/03/2022 à 09:20, Javier Jimenez Shaw a écrit :
> Hi
>
> Keep working with CMake and GDAL_USE_EXTERNAL_LIBS=OFF
> Now I want to enable json-c
>
> If I do not say anything, I get this message:
> -- JSONC has been found, but is disabled due to 
> GDAL_USE_EXTERNAL_LIBS=OFF. Enable it by setting GDAL_USE_JSONC=ON
>
> If I say
> GDAL_USE_JSONC=ON
> GDAL_USE_JSONC_INTERNAL=ON
>
> the log message is
> -- Could NOT find JSONC (missing: JSONC_DIR)
> -- Found JSONC: /usr/lib/x86_64-linux-gnu/libjson-c.so
> and later
> -- The following OPTIONAL packages have been found:
> ...
> * JSONC
>    json-c library (external)
>
>
> Looks like I am doing something wrong, or the "internal" configuration 
> is ignored.
>
> In my computer I have libjson-c installed, but in CI it is not. I want 
> to reproduce the same behaviour in both.
>
> Thanks
> .___ ._ ..._ .. . ._. .___ .. __ . _. . __..  ... .... ._ .__
> Entre dos pensamientos racionales
> hay infinitos pensamientos irracionales.
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220315/dde068af/attachment.html>


More information about the gdal-dev mailing list