@@ -253,6 +253,17 @@ if(NOT WIN32)
253253 libiomp5${LIBOMP_LIBRARY_SUFFIX}
254254 WORKING_DIRECTORY ${LIBOMP_LIBRARY_DIR}
255255 )
256+ if (LIBOMP_ENABLE_SHARED)
257+ if (APPLE )
258+ set (VERSIONED_LIBGOMP_NAME libgomp.1${LIBOMP_LIBRARY_SUFFIX} )
259+ else ()
260+ set (VERSIONED_LIBGOMP_NAME libgomp${LIBOMP_LIBRARY_SUFFIX} .1)
261+ endif ()
262+ add_custom_command (TARGET omp POST_BUILD
263+ COMMAND ${CMAKE_COMMAND} -E create_symlink ${LIBOMP_LIB_FILE} ${VERSIONED_LIBGOMP_NAME}
264+ WORKING_DIRECTORY ${LIBOMP_LIBRARY_DIR}
265+ )
266+ endif ()
256267endif ()
257268
258269# Definitions for testing, for reuse when testing libomptarget-nvptx.
@@ -439,13 +450,18 @@ else()
439450
440451 if (${LIBOMP_INSTALL_ALIASES} )
441452 # Create aliases (symlinks) of the library for backwards compatibility
453+ extend_path(outdir "${CMAKE_INSTALL_PREFIX} " "${OPENMP_INSTALL_LIBDIR} " )
442454 set (LIBOMP_ALIASES "libgomp;libiomp5" )
443455 foreach (alias IN LISTS LIBOMP_ALIASES)
444- extend_path(outdir "${CMAKE_INSTALL_PREFIX} " "${OPENMP_INSTALL_LIBDIR} " )
445456 install (CODE "execute_process(COMMAND \"\$ {CMAKE_COMMAND}\" -E create_symlink \" ${LIBOMP_LIB_FILE} \"
446457 \" ${alias}${LIBOMP_LIBRARY_SUFFIX} \" WORKING_DIRECTORY
447458 \"\$ ENV{DESTDIR}${outdir} \" )" )
448459 endforeach ()
460+ if (LIBOMP_ENABLE_SHARED)
461+ install (CODE "execute_process(COMMAND \"\$ {CMAKE_COMMAND}\" -E create_symlink \" ${LIBOMP_LIB_FILE} \"
462+ \" ${VERSIONED_LIBGOMP_NAME} \" WORKING_DIRECTORY
463+ \"\$ ENV{DESTDIR}${outdir} \" )" )
464+ endif ()
449465 endif ()
450466endif ()
451467install (
0 commit comments