I am trying to create a CMake hierarchy for an application using libpng. Libpng requires zlib.
Since CMakeLists.txt is distributed with both zlib and libpng, my first idea was to create the following structure:
/development
CMakeLists.txt
/zlib-1.2.5
CMakeLists.txt <- provided by zlib
-sources-
-build of zlib?-
/libpng154
CMakeLists.txt <- provided by libpng
-sources-
-build of libpng?-
/myapp
CMakeLists.txt
-sources-
/build
-build of myapp-
-build of zlib?-
-build of libpng?-
... and then, at the top level of CMakeLists.txt, put something like:
project(everything)
...
add_subdirectory(zlib-1.2.5)
add_subdirectory(libpng154)
add_subdirectory(myapp)
...
But no luck. CMakeLists.txt libpng does find_package (ZLIB ...), but it doesn't know where to look. This can be resolved on Mac OS by "installing" zlib in / usr. But this will not work on Windows.
, , . zlib libpng find_package (PNG...) ,
( zlib libpng ( CMakeLists.txt) , , Mac OS, , , zlib /usr ).
project(everything)
...
find_package(PNG...)
add_subdirectory(myapp)
...
, find_package (PNG...) . , find_package (PNG...) , libpng, . , boost, BOOST_ROOT. - libpng?
,