Skip to content

Commit 8aed1b2

Browse files
committed
Create/install relative link to module file
Patch from @mexas (Thanks!)
1 parent c76ef50 commit 8aed1b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/mpi/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ install(TARGETS caf_mpi EXPORT OpenCoarraysTargets
5858
)
5959

6060
# Install modules to standard include dir, but namespace them with compiler/version
61-
set (mod_install "${CMAKE_INSTALL_FULL_INCLUDEDIR}/OpenCoarrays/${CMAKE_Fortran_COMPILER_ID}/${CMAKE_Fortran_COMPILER_VERSION}")
61+
set (mod_install "OpenCoarrays/${CMAKE_Fortran_COMPILER_ID}/${CMAKE_Fortran_COMPILER_VERSION}")
6262
install(DIRECTORY "${CMAKE_BINARY_DIR}/mod/"
63-
DESTINATION "${mod_install}"
63+
DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/${mod_install}"
6464
FILES_MATCHING PATTERN "*.mod"
6565
)
6666

6767
# Now add a link in standard include dir so that compilers will find by default... this may or may not actually be a good idea...
6868
if ( "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU" )
69-
INSTALL(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${mod_install}/opencoarrays.mod ${CMAKE_INSTALL_FULL_INCLUDEDIR}/opencoarrays.mod )"
69+
INSTALL(CODE "execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${mod_install}/opencoarrays.mod \$ENV{DESTDIR}${CMAKE_INSTALL_FULL_INCLUDEDIR}/opencoarrays.mod )"
7070
)
7171
endif ()
7272

0 commit comments

Comments
 (0)