Skip to content

Allow modification of install directory for module files #419

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

Merged
merged 1 commit into from
Jun 13, 2021

Conversation

awvwgk
Copy link
Member

@awvwgk awvwgk commented May 31, 2021

The install directory for the module files will default to $PREFIX/include/fortran_stdlib/<compiler-id> and is automatically exported for both CMake package files and pkg-config files.

A possible alternative would be to install in $PREFIX/lib/fortran_stdlib/<compiler-id> instead:

diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
index 430cef2..e4e2ec2 100644
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -3,7 +3,7 @@
 option(
   CMAKE_INSTALL_MODULEDIR
   "Directory in prefix to install generated module files"
-  "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}"
+  "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}"
 )
 
 # Export a pkg-config file

@awvwgk awvwgk added the reviewers needed This patch requires extra eyes label May 31, 2021
Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

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

OK from my side

Copy link
Member

@milancurcic milancurcic left a comment

Choose a reason for hiding this comment

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

I tried it, it works. Thanks!

@milancurcic milancurcic merged commit 88adb9f into fortran-lang:master Jun 13, 2021
@awvwgk awvwgk deleted the cmake branch June 13, 2021 08:21
@awvwgk awvwgk removed the reviewers needed This patch requires extra eyes label Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants