|
Boost : |
Subject: Re: [boost] CMake Modularization
From: Philip Woods (elzairthesorcerermailinglist_at_[hidden])
Date: 2016-09-28 12:12:42
> I know next to nothing about CMake, but this doesn't seem quite the right
way.
> This:
> set(BOOST_FILESYSTEM_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include"
CACHE STRING
"Location of boost.filesystem headers")
> should perhaps just be
> target_include_directories(boost_filesystem PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include)
> The manual dependency checking at the top:
> if(NOT BOOST_CONFIG_INCLUDE_DIRS)
message(FATAL_ERROR "Cannot find boost.config!")
endif(NOT BOOST_CONFIG_INCLUDE_DIRS)
> should probably be replaced by
> target_link_libraries(boost_config)
> boost_config, being a header-only library, should be
> add_library(boost_config INTERFACE)
> The various BOOST_*_INCLUDE_DIRS and BOOST_*_LIBRARIES won't be needed;
CMake will figure it out automatically. And the order of add_subdirectory
will no longer matter.
Thanks for that! I did not know CMake had that functionality.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk