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

CMake: Fix generation with multiple repos #1140

Merged
merged 6 commits into from
Mar 9, 2024

Conversation

Javask
Copy link
Contributor

@Javask Javask commented Mar 8, 2024

Make the CMake generator work with projects using multiple repositories, similar to how it works with SCons.
Currently this would generate multiple targets called modm, causing an error.

@rleh rleh added this to the 2024q1 milestone Mar 8, 2024
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

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

I don't know much about CMake, so thanks for improving it!

@@ -164,6 +162,8 @@ set({{ name | upper }}{{ "_" ~ (profile | upper) if profile | length else "" }}
endfunction()

function(modm_targets_create project_name)
find_package (Python3 COMPONENTS Interpreter REQUIRED)
Copy link
Member

@salkinium salkinium Mar 8, 2024

Choose a reason for hiding this comment

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

What's the difference? Does cmake have its own package manager???

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not quite a package manager, just a set of modules to find dependecies.
find_program fails to find a valid Python executable on my Windows machine and reading the docs it seems to only search a predefined set of paths per platform for a name match.
find_package in this case will use the FindPython3 module shipped with CMake to find python so it should be more flexible and does find my Python install.

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

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

Thank you!

@salkinium salkinium merged commit 1a89fbe into modm-io:develop Mar 9, 2024
39 checks passed
Copy link
Member

@rleh rleh left a comment

Choose a reason for hiding this comment

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

Thank you also from me :)

@Javask Javask deleted the feature/cmake branch March 14, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants