[CMake] problems configuring with multiple zlib version

Torsten Rohlfing rohlfing at ieee.org
Tue Feb 21 16:35:59 EST 2012


Hi All:

I was wondering if someone has an idea how I could solve a problem I am 
having with CMake.

Briefly, here's what I have:

- Mac OS-X 10.6 system
- System zlib (1.2.3) installed in /usr/include
- MacPorts zlib (1.2.6) installed in /opt/local/include

My project needs to include headers from /opt/local/include (MacPorts) 
for things like Qt (in fact, FindQt.cmake will add this path to include 
directories).

FindZLIB.cmake finds and configures system zlib, but "/usr/include", 
being a system include directory, is not added to the list of explicit 
"-I" compiler command line options.

So now compilation uses MacPorts zlib.h (due to "-I/opt/local/include"), 
but linking uses system zlib.dynlib. But 1.2.3 and 1.2.6 are not binary 
compatible, so I get link errors.

Is there a solution to this problem short of patching FindZLIB.cmake to 
first look in /opt/local?

Thanks!
   Torsten


More information about the CMake mailing list