Skip to content

Conversation

@Flamefire
Copy link
Contributor

Not required as this is part of the super-project build which adds this automatically.

This leads to either failures when Boost isn't installed yet or potentially wrong Boost installations found when Building Boost tests

So just remove it.

Not required as this is part of the super-project build which adds this automatically.
@chandryan
Copy link
Collaborator

I recently added this file, though for now it was only meant for internal testing outside of the super-project build.

According to the readme I found through your PR I suppose it needs to be changed to the following, is that correct?

if(BUILD_TESTING AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)

  add_subdirectory(test)

endif()

@Flamefire
Copy link
Contributor Author

According to the readme I found through your PR I suppose it needs to be changed to the following, is that correct?

Yes something like that. Although I'd suggest to follow the common approach and use the Boost super-project as MSM has dependencies on a couple other Boost libraries besides serialization you'd need too. Any specific reason you don't do that yet?

You could go with a split approach in the test CML. Something like:

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
  # Build test folder directly
  target_include_directories(boost_msm_tests PRIVATE ../include)
  # Includes other Boost header-only libraries
  find_package(Boost COMPONENTS serialization REQUIRED)
  target_link_libraries(boost_msm_tests Boost::serialization)
else()
  # Part of super project or called from parent CML
  target_link_libraries(boost_msm_tests Boost::msm)
endif()

This way cmake msm/test works as currently and the tests would also be part of the super-project build (if they are ready for that)

@chandryan
Copy link
Collaborator

Yes something like that. Although I'd suggest to follow the common approach and use the Boost super-project as MSM has dependencies on a couple other Boost libraries besides serialization you'd need too. Any specific reason you don't do that yet?

No specific reason, I should give it a try soon :)

You could go with a split approach in the test CML. Something like: [...]

Thanks for the recommendation, that looks like a good approach 👍

@chandryan
Copy link
Collaborator

Merged your suggestion in #103

@Flamefire Flamefire closed this Sep 16, 2025
@Flamefire Flamefire deleted the patch-1 branch September 16, 2025 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants