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

Tom O'Reilly oreilly at mbari.org
Wed Jun 1 11:29:21 PDT 2022


I'm running cmake 3.22.4 on MacOS 11.6. 
I installed proj6 with " sudo port proj6" which looks to be [ https://proj.org/install.html | the proj-recommended way to install with MacPorts ] . 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. Th e [ https://proj.org/development/cmake.html | proj page also says ] : 





The recommended way to use the PROJ library in a CMake project is to link to the imported library target PROJ::proj provide 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) 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20220601/70c40c72/attachment-0001.htm>


More information about the PROJ mailing list