erikzenker / hsm

Finite state machine library based on the boost hana meta programming library. It follows the principles of the boost msm and boost sml libraries, but tries to reduce own complex meta programming code to a minimum.
MIT License
189 stars 18 forks source link

CMake improvements #141

Closed friendlyanon closed 3 years ago

friendlyanon commented 3 years ago

This PR will modernize the CMake usage of this library.

Some things to note:

To see how the above affects building the library, please see the CI workflows that have been adapted for this improved process.

This library will also provide a real relocatable CMake package for easy consumption by clients.

For the rationale behind the changes, please see my contributions to FunctionalPlus for related discussions.

codecov-io commented 3 years ago

Codecov Report

Merging #141 (1a0eaca) into master (6b107a7) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #141   +/-   ##
=======================================
  Coverage   96.94%   96.94%           
=======================================
  Files          67       67           
  Lines         950      950           
=======================================
  Hits          921      921           
  Misses         29       29           
Impacted Files Coverage Δ
include/hsm/details/chain_actions.h 100.00% <ø> (ø)
include/hsm/details/collect_events.h 100.00% <ø> (ø)
include/hsm/details/collect_initial_states.h 100.00% <ø> (ø)
include/hsm/details/collect_states.h 100.00% <ø> (ø)
include/hsm/details/create_state.h 100.00% <ø> (ø)
include/hsm/details/dispatch_table.h 100.00% <ø> (ø)
include/hsm/details/fill_dispatch_table.h 100.00% <ø> (ø)
...de/hsm/details/flatten_internal_transition_table.h 100.00% <ø> (ø)
include/hsm/details/flatten_transition_table.h 100.00% <ø> (ø)
include/hsm/details/for_each.h 100.00% <ø> (ø)
... and 16 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6b107a7...1a0eaca. Read the comment docs.

erikzenker commented 3 years ago

Hi @friendlyanon thank you for your contribution. I will start to review your PR and might come up with some question. I think it will take me a while to go through all the changes.

friendlyanon commented 3 years ago

Resolved the conflicts by rebasing the changes on top of the target branch.

friendlyanon commented 3 years ago

Moving the headers to include from src/include is the least surprising. When I see a src or source directory, it's reasonable to assume that a library builds artifacts, i.e. isn't header only. It's also more common to do it this way than not.

erikzenker commented 3 years ago

@friendlyanon thx again for your contribution. Out of curiosity: do you use the hsm somewhere?

friendlyanon commented 3 years ago

I don't use this library yet, but as you might have seen from my recent activity on GitHub, I am the change I want to see in the world. I just want projects to utilize CMake properly, so they are trivial to consume and package.