Skip to content
Snippets Groups Projects

Deprecate usage of dune_project cmake function outside of CMake project directories

All threads resolved!

Proposal

Deprecate usage of dune_project cmake function outside of CMake project directories

Reasoning

In the future, I would like to see a dune module that does not need dune_project()/finalize_dune_project() at all. All of these things can be achieved somehow else in a very compatible way.

  • All of the effects of dune_project() can be achieved at find_package(dune-common). The only question is what do we want to move there and what needs to be deprecated.
  • All of the effects of finalize_dune_project() can be triggered by a cmake deferred call cmake_language(DEFER CALL ) triggered by dune_add_library or find_package(dune-common) if a dune module file is found.

For this, we need to be sure that the effects of dune_project() and finalize_dune_project() are predictable with respect to a given directory. That is, the CMake project directory ${PROJECT_SOURCE_DIR}.

Backwards Compatibility

Most if not all projects already follow the practice of having a dune project exactly where cmake project is. Thus, most people won't even notice this issue. For those who rely on this feature, CMake now supports nested projects, so the situation is also easily solvable.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • 64dafce3 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Another motivation is that when constraining dune project to be in the same directory as the cmake project, we can safely remove include_directories("${CMAKE_CURRENT_BINARY_DIR}") which is another global setting less to worry about and take care on #332 (closed) during transition paths.

  • added 1 commit

    • 8422e5c0 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • resolved all threads

  • Santiago Ospina De Los Ríos marked this merge request as ready

    marked this merge request as ready

  • Santiago Ospina De Los Ríos marked this merge request as draft

    marked this merge request as draft

  • added 70 commits

    • 8422e5c0...f7f70723 - 69 commits from branch master
    • 6e38287c - Deprecate usage of dune_project cmake function outside of CMake project directories

    Compare with previous version

  • Simon Praetorius approved this merge request

    approved this merge request

  • Santiago Ospina De Los Ríos marked this merge request as ready

    marked this merge request as ready

  • requested review from @simon.praetorius

  • Simon Praetorius mentioned in commit af8c5126

    mentioned in commit af8c5126

  • Please register or sign in to reply
    Loading