[PROJ] cmake find_package() fails to find PROJ6 installed with MacPorts
Tom O'Reilly
oreilly at mbari.org
Wed Jun 1 12:55:31 PDT 2022
Thanks Even.
My project needs proj6, but as a test of cmake I installed proj9 with MacPorts - and find_package(Proj9 CONFIG REQUIRED) fails just as before.
Question - if the installed proj9 provides CONFIG support, I presume there is a proj9-config.cmake or Proj9Config.cmake file somewhere. Where would I look for this file? I see /opt/local/lib/proj9 - but the file is not in there. Would this file be in there if proj9 supports CONFIG mode or is there some other place to look?
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)
From: "Even Rouault" <even.rouault at spatialys.com>
To: "Tom O'Reilly" <oreilly at mbari.org>, "proj" <proj at lists.osgeo.org>
Sent: Wednesday, June 1, 2022 11:39:55 AM
Subject: Re: [PROJ] cmake find_package() fails to find PROJ6 installed with MacPorts
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 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. The [ 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)
[ mailto:oreilly at mbari.org | oreilly at mbari.org ] (email)
[ http://www.mbari.org/ | 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 [ mailto:PROJ at lists.osgeo.org | PROJ at lists.osgeo.org ] [ https://lists.osgeo.org/mailman/listinfo/proj | https://lists.osgeo.org/mailman/listinfo/proj ]
-- [ http://www.spatialys.com/ | 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/64eb2323/attachment.htm>
More information about the PROJ
mailing list