Skip to content

Cmake fix#7625

Merged
timosachsenberg merged 4 commits into
developfrom
cmake_fix
Oct 24, 2024
Merged

Cmake fix#7625
timosachsenberg merged 4 commits into
developfrom
cmake_fix

Conversation

@cbielow

@cbielow cbielow commented Oct 23, 2024

Copy link
Copy Markdown
Contributor

User description

Description

address CMake warnings when using the latest CMake 3.31

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out
  • The details of the action statuses at the end of the PR or the "Checks" tab.
  • http://cdash.openms.de/index.php?project=OpenMS and look for your PR. Use the "Show filters" capability on the top right to search for your PR number.
    If you click in the column that lists the failed tests you will get detailed error messages.

Advanced commands (admins / reviewer only)

Click to expand
  • /reformat (experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.
  • setting the label "NoJenkins" will skip tests for this PR on jenkins (saves resources e.g., on edits that do not affect tests)
  • commenting with rebuild jenkins will retrigger Jenkins-based CI builds

⚠️ Note: Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).


PR Type

enhancement, bug fix


Description

  • Updated CMake configuration to use Boost's CONFIG option, aligning with the new policy of CMake.
  • Removed an invalid PRE_BUILD option in add_custom_command to fix a bug.
  • Escaped quotes in strings for test commands to prevent syntax errors.

Changes walkthrough 📝

Relevant files
Enhancement
build_system_macros.cmake
Use Boost config instead of find module                                   

cmake/build_system_macros.cmake

  • Added CONFIG option to find_package for Boost.
+1/-1     
third_party_tests.cmake
Escape quotes in test command whitelist strings                   

src/tests/topp/THIRDPARTY/third_party_tests.cmake

  • Escaped quotes in whitelist strings for test command.
+1/-1     
Bug fix
configh.cmake
Remove invalid PRE_BUILD option in custom command               

src/openms/configh.cmake

  • Removed invalid PRE_BUILD option from add_custom_command.
+0/-1     

💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

CMake Compatibility
The use of CONFIG in find_package for Boost might lead to compatibility issues with older versions of CMake that do not support this option.

Complex String Handling
The handling of strings within the add_test command is complex and error-prone due to multiple nested quotes and lack of clear separation or encoding, which could lead to syntax errors or misinterpretations.

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Score
Possible issue
Ensure the CONFIG option in find_package is appropriate for the Boost library

Ensure that the CONFIG option in find_package is necessary as it forces CMake to
find the package configuration file rather than the module mode. If the Boost
library does not provide a configuration file, this could lead to configuration
errors.

cmake/build_system_macros.cmake [65]

-find_package(Boost 1.74.0 COMPONENTS ${ARGN} REQUIRED CONFIG)
+find_package(Boost 1.74.0 COMPONENTS ${ARGN} REQUIRED)
Suggestion importance[1-10]: 7

Why: The suggestion highlights a potential issue with using the CONFIG option in find_package, which could lead to configuration errors if the Boost library does not provide a configuration file. This is a valid concern as it can affect the build process, making the suggestion relevant and important to verify.

7

@timosachsenberg

Copy link
Copy Markdown
Contributor

builds so I guess fine to go ;

@timosachsenberg
timosachsenberg merged commit 66a18d0 into develop Oct 24, 2024
@timosachsenberg
timosachsenberg deleted the cmake_fix branch October 24, 2024 09:40
@jpfeuffer

Copy link
Copy Markdown
Contributor

Yep should be fine. I am actually surprised that it's only so little warnings. I'm pretty sure I am getting more on macOS. Maybe I will try to amend some fixes at a later point.

@jpfeuffer

Copy link
Copy Markdown
Contributor

It actually looks good in CI. Either cmake is not so new or it really fixed everything. Good job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants