Feature/brush up cmake - #364
Open
KIwabuchi wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request significantly improves how the Metall CMake build system manages dependencies, especially Boost and Threads, and modernizes the way executable targets are set up. The changes make Metall easier to consume from both build trees and installed packages, reduce manual dependency management for users, and refactor helper logic for maintainability.
The most important changes are:
Dependency Management Improvements:
CMakeLists.txtnow automatically attaches required C++ standard, Boost, and Threads dependencies to theMetall::Metalltarget, so consumers no longer need to manually specify include directories or link libraries—these are inherited transitively. This includes proper handling for older and newer CMake versions, and for both build-tree and installed usage. [1] [2] [3]cmake/metall_target_helpers.cmaketo encapsulate logic for propagating include directories, compile definitions, and for converting local targets into export-safe link items.CMake Helper Refactoring:
CMakeLists.txtto a newcmake/metall_executable_helpers.cmake, making the build scripts more modular and easier to maintain. [1] [2]Example and Documentation Updates:
example/cmake/FetchContent/CMakeLists.txtandexample/cmake/find_package/CMakeLists.txt) are updated to reflect the new transitive dependency setup—users now only need to link againstMetall::Metalland do not need to manually specify Boost or Threads. [1] [2] [3] [4]Internal Variables and Export Logic:
These changes make Metall much easier to integrate into user projects and ensure that all required dependencies are handled correctly and automatically, both when building from source and when using installed packages.