CMake Visual Studio zlib zlibstatic.lib

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

CMake Visual Studio zlib zlibstatic.lib

clanmills
Folks

My project (exiv2.org) uses zlib and is builds well on all platforms (Linux,
Cygwin, MacOS-X and Visual Studio) with CMake.

A user complained that the CMake/Visual Studio static builds link zlib.dll
(zlibd.dll for debug) and wants to link zlibstatic.lib (zlibstaticd.lib). 
I've tracked this down to FindZlib.cmake which sets ZLIB_FOUND,
ZLIB_LIBRARIES and ZLIB_INCLUDE_DIRS to use the zlib dynamic libraries.  For
the moment, I have a work-around which externally copies zlibstatic.lib to
overwrite zlib.lib.

I've inspected the code in FindZlib.cmake and it doesn't appear to know
about zlibstatic.  I've unsuccessfully tried to use string(REPLACE ...) on
ZLIB_LIBRARIES.  I don't know CMake very well.  Is ZLIB_LIBRARIES a string
or a list of strings?  How can I either edit it, or get a new variable
ZLIB_STATIC_LIBRARIES to pass to target_link_libraries(...)

Any suggestions?  All help appreciated.

Robin Mills

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake