Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions for improving the CMakeLists #26

Open
Flamefire opened this issue Sep 3, 2020 · 0 comments
Open

Suggestions for improving the CMakeLists #26

Flamefire opened this issue Sep 3, 2020 · 0 comments

Comments

@Flamefire
Copy link

Hello, just some random findings on how to improve the CML

  • set (Boost.Real_VERSION_MAJOR 1) -> project(Boost.Real VERSION 1.0) which is shorter and a superset of those 2 sets
  • don't add coverage by default, add an option
  • make the if consistently lowercase and ommit the condition in the closing endif
  • You are not really using the CodeCoverage include, so maybe remove it and do the stuff explicitely or copy the single file especially going forward in inclusion with boost this might be relevant. Then also check the copyright
  • General advice: Don't check CMAKE_BUILD_TYPE. E.g. for Visual Studio as the output this value is meaningless
  • Instead of HAVE_FLAG_STD_CXX17 use target_compile_features with cxx_std_17
  • replace include_directories with target_include_directories
  • Boost_INCLUDE_DIRS is unset at the point it is used and can be removed
  • add_executable(Boost.Real_headers likely doesn't do what you want. You add a folder as the sources which isn't right IIRC and what is the point for this binary? Could you clarify? I'm inclined in suggesting to remove it
  • Instead if REAL_TEST use the standard BUILD_TESTING (e.g. by include(CTest))

If you want, check https://github.com/boostorg/nowide/blob/develop/CMakeLists.txt. That is a bit more convoluted as it supports a build library instead of a header-only lib and integrates with Boost superproject

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

No branches or pull requests

1 participant