[CMake] Compiling zlib and libpng with one command

Philip Lowman philip at yhbt.com
Thu Nov 12 19:05:09 EST 2009


On Thu, Nov 12, 2009 at 6:59 PM, Hugh Sorby <h.sorby at auckland.ac.nz> wrote:

>
> I am trying to compile zlib and libpng with one command, or more
> specifically one series of commands.  My aim is to get as simple as possible
> to the following
>
> cmake
> make
> make install
>
>
This should work out of the box with the CMakePorts packaging of libpng &
zlib if you want to try those.

1. Download libpng & zlib
http://code.google.com/p/cmakeports/downloads/list

2. Add the following to your toplevel CMakeLists...
add_subdirectory(zlib)
add_subdirectory(png)

3. The standard CMake variables generated by a find_package() call are
present... so just use ZLIB_FOUND, ZLIB_INCLUDE_DIR, etc. like you normally
would as if you were calling find_package().

4. If you want to control the install options of these libraries (ie. header
files, executables, etc.) you can use SKIP_INSTALL_[HEADERS | LIBRARIES |
EXECUTABLES | FILES | ALL].

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091112/53739b2e/attachment.htm>


More information about the CMake mailing list