Skip to content

[feat] Add support for configure directory in CMake builds#3395

Merged
vkarak merged 7 commits intoreframe-hpc:developfrom
mredenti:develop
Feb 26, 2025
Merged

[feat] Add support for configure directory in CMake builds#3395
vkarak merged 7 commits intoreframe-hpc:developfrom
mredenti:develop

Conversation

@mredenti
Copy link
Copy Markdown

@mredenti mredenti commented Feb 19, 2025

Closes #3359.

Changes:

  • Move configuredir to ConfigureBasedBuildSystem, making it available to all configure-based build systems (Autotools, CMake).
  • Update CMake.emit_build_commands to respect configuredir.
  • Remove redundant configuredir definition from Autotools, as it now inherits this property from ConfigureBasedBuildSystem.

Now CMake.configuredir allows users to specify the source directory explicitly, aligning with Autotools.configuredir.

Why We Don't Use -S

Although CMake provides the -S flag to specify the source directory, this option was introduced in CMake 3.13. To maintain compatibility with older versions, this implementation does not use -S explicitly. Instead, configuredir is passed as the last argument in the cmake command, which ensures compatibility with both older and newer CMake versions.

Indeed, CMake v3.12 does not support the -S flag https://cmake.org/cmake/help/v3.12/manual/cmake.1.html but v3.13 does https://cmake.org/cmake/help/v3.13/manual/cmake.1.html

@mredenti mredenti changed the title [feat] Add CMake.configuredir to specify source directory in CMake builds [feat] Add support for configure directory in CMake builds Feb 20, 2025
@vkarak vkarak self-requested a review February 20, 2025 23:58
@vkarak vkarak added this to the ReFrame 4.8 milestone Feb 20, 2025
Copy link
Copy Markdown
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the solution to move the configuredir to the base class. My comments are only related to the documentation and code style.

As for the CI failure, I am having a look; I don't think your PR's fault.

Comment thread reframe/core/buildsystems.py
Comment thread reframe/core/buildsystems.py Outdated
@mredenti mredenti requested a review from vkarak February 21, 2025 12:29
@vkarak vkarak enabled auto-merge February 25, 2025 23:00
@vkarak vkarak merged commit 85edad2 into reframe-hpc:develop Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add CMake.configuredir Property for Source Directory Specification

2 participants