It looks like there is nothing that I can do with cmake, and the problem is coming from libraries that I am linking against (Cairo and ImageMagick).
The reason that there are two libpng dependencies on the deployed system is that I am deploying a prebuild ImageMagick (statically) which is built on a machine with libpng12
. I assumed that the deploy system will have Cairo and libpng, and it does, but it does not have libpng12
. It has libpng15
and Cairo, which is linking against it. Therefore, ldd
shows that my executable is dependent on libpng12 and libpng15.
To resolve this, I statically link against libpng12
and any libraries that are linking it.