add more spacing
[personal-kdebase.git] / workspace / cmake / modules / create_exe_symlink.cmake
blob6f35ff76b6a96f0c2a70ad6d89b881de54bc2dd4
1 # Create an executable symlink to a Python script.
2 # This also sets the target script's permission bits.
4 MESSAGE(STATUS "Symlinking $ENV{DESTDIR}/${LINK_NAME} to $ENV{DESTDIR}/${TARGET}")
6 GET_FILENAME_COMPONENT(abs_link_name $ENV{DESTDIR}/${LINK_NAME} ABSOLUTE)
7 GET_FILENAME_COMPONENT(link_path $ENV{DESTDIR}/${LINK_NAME} PATH)
8 GET_FILENAME_COMPONENT(abs_link_path ${link_path} ABSOLUTE)
9 FILE(MAKE_DIRECTORY ${abs_link_path})
11 GET_FILENAME_COMPONENT(abs_target $ENV{DESTDIR}/${TARGET} ABSOLUTE)
12 IF(UNIX)
13     EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${abs_target} ${abs_link_name})
14     EXECUTE_PROCESS(COMMAND chmod a+x ${abs_target})
15 ENDIF(UNIX)
16 # FIXME: WIN32 support