feat: custom module install directory - #1170
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for installing compiled Fortran module files (.mod) to a custom directory separate from headers, enhancing project organization and providing more flexible installation options.
- Added a new optional
module-dirfield to the[install]section offpm.toml - Extended the installer with a separate
install_module()method andmoduledirfield - Maintained backward compatibility by defaulting to the
"include"directory when not specified
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/fpm/manifest/install.f90 |
Added module_dir field to install configuration with parsing and validation |
src/fpm/installer.f90 |
Extended installer with moduledir field and separate install_module() method |
src/fpm/cmd/install.f90 |
Updated to use new module installation method instead of header installation |
test/fpm_test/test_manifest.f90 |
Added unit test for module directory configuration parsing |
test/fpm_test/test_installer.f90 |
Added unit test for custom module directory installation |
example_packages/custom_module_dir/* |
Created example package demonstrating the new feature |
ci/run_tests.sh |
Added CI test to verify custom module directory functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends
fpmto support installing compiled module files (.mod) to a custom directory separate from headers, providing better organization. Close #1157.Changes
Manifest
module-dirfield to[install]section"include"directory (backward compatible)Installer
installer_twithmoduledirfield andinstall_module()method (now separate fromheaders)Example & Testing:
example_packages/custom_module_dir/demonstrating the featureUsage Example