Skip to content

Commit c9ce719

Browse files
committed
Add installation of instead -> sdl_instead symlink
1 parent dee9088 commit c9ce719

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cmake/InstallSymlink.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
MACRO(INSTALL_SYMLINK linktarget linkname destination)
2+
IF(UNIX)
3+
IF(IS_ABSOLUTE ${destination})
4+
SET(FULL_DESTINATION "\$ENV{DESTDIR}${destination}/${linkname}")
5+
ELSE(IS_ABSOLUTE ${destination})
6+
SET(FULL_DESTINATION "\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${destination}/${linkname}")
7+
ENDIF(IS_ABSOLUTE ${destination})
8+
9+
INSTALL(CODE "MESSAGE(STATUS \"Symlink: ${FULL_DESTINATION} -> ${linktarget}\")
10+
EXECUTE_PROCESS(COMMAND \${CMAKE_COMMAND} -E create_symlink ${linktarget} ${FULL_DESTINATION})")
11+
ENDIF()
12+
ENDMACRO()

src/sdl-instead/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,12 @@ ADD_EXECUTABLE(sdl-instead ${INSTEAD_SRCS})
166166
TARGET_LINK_LIBRARIES(sdl-instead ${INSTEAD_LIBS})
167167

168168
# install
169+
INCLUDE(InstallSymlink)
170+
169171
IF(SYSTEMWIDE)
170172
INSTALL(TARGETS sdl-instead DESTINATION ${BINDIR})
173+
INSTALL_SYMLINK(sdl-instead instead${CMAKE_EXECUTABLE_SUFFIX} ${BINDIR})
171174
ELSEIF(STANDALONE)
172175
INSTALL(TARGETS sdl-instead DESTINATION ${STANDALONEDIR})
176+
INSTALL_SYMLINK(sdl-instead instead${CMAKE_EXECUTABLE_SUFFIX} ${STANDALONEDIR})
173177
ENDIF(SYSTEMWIDE)

0 commit comments

Comments
 (0)