On Wed, 2017-06-21 at 19:01 +0300, Peter Dimov via Boost wrote:
paul wrote:
On Wed, 2017-06-21 at 15:11 +0300, Peter Dimov via Boost wrote:
What I had in mind was more like this:
add_library(pumpkin ${PUMPKIN_SOURCES})
add_library(pumpkin_zlib ${PUMPKIN_ZLIB_SOURCES}) target_link_libraries(pumpkin_zlib pumpkin) target_link_libraries(pumpkin_zlib ZLIB::ZLIB)
with the find_package logic residing in the rootmost CMakeLists, where the project links or does not link to pumpkin_zlib, as appropriate.
The find_package shouldn't be in the root directory. It should be in the same project directory as that is what that project needs, and each project should be standalone.
In other words, what I wrote, with find_package(ZLIB) prepended?
Yes
How are version conflicts resolved? If library A says find_package(Boost 1.62.0) and later library B says find_package(Boost 1.64.0), can I find_package(Boost 1.64.0) at root level first to keep them happy?
Yes, although, the root doesn't need to say `find_package` at all since its getting boost with `add_subdirectory`, right?