[PROJ] cmake find_package() fails to find PROJ6 installed with MacPorts

Even Rouault even.rouault at spatialys.com
Wed Jun 1 11:39:55 PDT 2022


Tom,

You should try to use a more recent version than PROJ 6.x (not sure what 
"proj6" corresponds to in MacPorts). I believe PROJ Config support was 
only added in PROJ > 6, or can only be relied upon in those later versions

Even

Le 01/06/2022 à 20:29, Tom O'Reilly a écrit :
> I'm running cmake 3.22.4 on MacOS 11.6.
> I installed proj6 with "sudo port proj6" which looks to bethe 
> proj-recommended way to install with MacPorts 
> <https://proj.org/install.html>. I see the proj6 include/ and lib/ 
> subdirectories in /opt/local/lib/proj6, and set PROJ6_ROOT to 
> /opt/local/lib/proj6 accordingly in my applications's CMakeLists.txt.
>
> But CmakeLists.txt is unable to find proj on the system. The proj page 
> also says <https://proj.org/development/cmake.html>:
>
>
> The recommended way to use the PROJ library in a CMake project is to 
> link to the imported library target PROJ::projprovide by the CMake 
> configuration which comes with the library. Typical usage is:
>
>
> find_package(PROJ CONFIG REQUIRED)
>
>
> However find_package() cannot find PROJ or PROJ6 on my system - 
> find_package() exits with this message:
>
> CMake Error at CMakeLists.txt:95 (find_package):
>
>   Could not find a package configuration file provided by "PROJ6" with 
> any of
>
>   the following names:
>
>     PROJ6Config.cmake
>
>     proj6-config.cmake
>
>
> Moreover I do not see any files named "proj*.cmake" in /opt/local - 
> somehow installing proj6 with MacPorts did not include this package 
> information? What am I doing wrong?
>
> Any help much appreciated!
>
>
> Thanks
>
> Tom
>
>
> --------------------------------------------------
> Thomas C. O'Reilly
> Monterey Bay Aquarium Research Institute
> 7700 Sandholdt Road
> Moss Landing, California 95039-9644
> 831-775-1766 (voice)
> 831-775-1620 (FAX)
> oreilly at mbari.org (email)
> http://www.mbari.org (World-wide Web)
>
> "The machine does not isolate us from the great mysteries
>  of nature, but plunges us more deeply into them."
>
>    - ANTOINE DE SAINT-EXUPERY
>      "Wind, Sand, and Stars" (1939)
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj

-- 
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/proj/attachments/20220601/adeb081a/attachment.htm>


More information about the PROJ mailing list