Skip to content

Commit

Permalink
Fix: Installed Symlink LIB (ECP-WarpX#2626)
Browse files Browse the repository at this point in the history
The latest patch to these routines broke our library alias in installs.

By default, this variable is relative and needs the prefix appended. In some cases, e.g., if externally set, it can already be absolute. In that case, we skip adding the prefix.
  • Loading branch information
ax3l authored and lgiacome committed Dec 16, 2021
1 parent a8d6777 commit cfadf26
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,14 @@ if(WarpX_LIB)
else()
set(mod_ext "so")
endif()
if(IS_ABSOLUTE CMAKE_INSTALL_LIBDIR)
set(ABS_INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR})
else()
set(ABS_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
endif()
install(CODE "file(CREATE_LINK
$<TARGET_FILE_NAME:shared>
${CMAKE_INSTALL_LIBDIR}/libwarpx.${lib_suffix}.${mod_ext}
${ABS_INSTALL_LIB_DIR}/libwarpx.${lib_suffix}.${mod_ext}
COPY_ON_ERROR SYMBOLIC)")
endif()

Expand Down

0 comments on commit cfadf26

Please sign in to comment.