You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modern CMake is all about targets. You define targets & link against targets. You should never, ever use commands such as include_directories, link_directories etc, not even "internally-only".
As a rule of thumb, when working with targets (created with add_library), only use commands prefixed with target_. And use PRIVATE, PUBLIC & INTERFACE accordingly.
Building myapp should only required target_link_libraries(myapp PRIVATE mydependency). If it fails to build because of mydependency, then mydependency is not setup correctly and must be fixed. Nothing should have to be changed in myapp.
Similar goes for find_package, please restrict usage of "magic" & package specific variables (eg. Boost_INCLUDE_DIR). Use only those that are package agnostic. See here for a list.
Failing to do this, and more specifically failing to follow up-to-date CMake best practices, makes it very hard to supply the required dependencies (eg. Boost), and ultimately to consume websocketpp.
With that said, thanks for an otherwise great library!
The text was updated successfully, but these errors were encountered:
Please please do this.... I've had to make my own *.cmake files and force CMake to ignore the currently generated cmake file so that our library we make can install correctly and be easily consumed.
Modern CMake is all about targets. You define targets & link against targets. You should never, ever use commands such as
include_directories
,link_directories
etc, not even "internally-only".As a rule of thumb, when working with targets (created with
add_library
), only use commands prefixed with target_. And use PRIVATE, PUBLIC & INTERFACE accordingly.Building myapp should only required
target_link_libraries(myapp PRIVATE mydependency)
. If it fails to build because of mydependency, then mydependency is not setup correctly and must be fixed. Nothing should have to be changed in myapp.Similar goes for
find_package
, please restrict usage of "magic" & package specific variables (eg. Boost_INCLUDE_DIR). Use only those that are package agnostic. See here for a list.Failing to do this, and more specifically failing to follow up-to-date CMake best practices, makes it very hard to supply the required dependencies (eg. Boost), and ultimately to consume websocketpp.
With that said, thanks for an otherwise great library!
The text was updated successfully, but these errors were encountered: