Note that there are some explanatory texts on larger screens.

plurals
  1. POcmake hierarchy zlib, libpng and my own app
    text
    copied!<p>I'm trying to create a CMake hierarchy for an application that uses libpng. Libpng requires zlib.</p> <p>Since a CMakeLists.txt is distributed with both zlib and libpng my first idea was to make the following structure:</p> <pre><code>/development CMakeLists.txt /zlib-1.2.5 CMakeLists.txt &lt;- provided by zlib -sources- -build of zlib?- /libpng154 CMakeLists.txt &lt;- provided by libpng -sources- -build of libpng?- /myapp CMakeLists.txt -sources- /build -build of myapp- -build of zlib?- -build of libpng?- </code></pre> <p>... and then, in the top level CMakeLists.txt, place something like:</p> <pre><code>project(everything) ... add_subdirectory(zlib-1.2.5) add_subdirectory(libpng154) add_subdirectory(myapp) ... </code></pre> <p>But no luck. The CMakeLists.txt of libpng performs a find_package(ZLIB...) but it doesn't know where to look. This might be solved on Mac OS by "installing" zlib to /usr. But this wouldn't work in Windows.</p> <p>So then i thought i would not recurse into the subdirectories. Just compile and build zlib and libpng independently and do a find_package(PNG...) prior to traversing down into my own app (compiling and building zlib and libpng individually (via the provided CMakeLists.txt) works, at least on Mac OS but again, only because zlib is installed to /usr).</p> <pre><code>project(everything) ... find_package(PNG...) add_subdirectory(myapp) ... </code></pre> <p>No luck, find_package(PNG...) fails. I have no idea how to let find_package(PNG...) know where to look for the libpng library i have just built. For instance for boost, you can set the "BOOST_ROOT" variable. Is there anything simular for libpng?</p> <p>Kind Regards,</p> <p>Daniel Dekkers</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload