1 # TODO: It would be nicer to have the list generated from the binary,
2 # but this has some complications. As the same list is also needed for
3 # man page generation, this can wait for now.
91 if (NOT DEFINED BINARY_DIRECTORY)
92 set(BINARY_DIRECTORY "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/@BIN_INSTALL_DIR@")
94 set(BINARY_SUFFIX "@GMX_BINARY_SUFFIX@@CMAKE_EXECUTABLE_SUFFIX@")
95 set(GMX_NATIVE_WINDOWS "@GMX_NATIVE_WINDOWS@")
97 foreach (linkname ${SYMLINK_NAMES})
98 set(linkpath ${BINARY_DIRECTORY}/${linkname}${BINARY_SUFFIX})
99 # Based on documentation, CMake only supports symbolic links on Unix,
100 # although NTFS also has those (since Windows Vista; they require admin
101 # permissions to create).
102 if (GMX_NATIVE_WINDOWS)
104 message(STATUS "Installing: Creating alias binary ${linkpath}")
107 COMMAND ${CMAKE_COMMAND} -E copy_if_different
108 ${BINARY_DIRECTORY}/gmx${BINARY_SUFFIX} ${linkpath})
111 message(STATUS "Installing: Creating symbolic link ${linkpath}")
113 if (EXISTS ${linkpath})
114 FILE(REMOVE ${linkpath})
117 COMMAND ${CMAKE_COMMAND} -E create_symlink
118 gmx${BINARY_SUFFIX} ${linkpath})