For some plugins that I intend to write, I need to pull in the libgeotiff library into my Paraview custom application. I can even find a libgeotiff repository that already uses cmake, and I can try to compile it - standalone. Did not work at first, but I stopped the exercise because I actually do not need this: I want the thing as part of my application!
Now libgeotiff needs two libraries that are already part of Paraview: libtiff and libproj or proj4. So basically I could tell libgeotiff that it can find the required symbols there - but how do I achieve this?
In the existing libgeotiff cmake setup, the libraries are found with find_package - and this (on a Windows system) pulls in the tiff and proj libraries that I have on my system at C:\OSGeo4W64. They would even fit, compiled with the same MSVC compiler and all, so should work. But finally I will have to bring the entire thing into my “superbuild”, so I do not want to rely on these local libraries.
So what I could do in the CMakeLists.txt of my libgeotiff as part of my custom project: first do a “find_package” for paraview, in order to get a number of path variables etc. And then calculate some “HINTS” for the find_package for libtiff and proj4. - derived from the paraview source or target path.
From the find_paraview I am getting e.g. the following definitions:
With these I could now find the path to both the tiff and the proj library - in the source and the target file tree. And with this generate some “HINTS” to tell the libgeotiff where the libraries can be found…
I am afraid that all this reasoning is far from how things are supposed to be used!
Or maybe there are no ways “how it is supposed”? In that case I could just directly generate some variables like LIBTIFF_INCLUDE or LIBTIFF_LIB and use them in the libgeotiff cmake.