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)
13 EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink ${abs_target} ${abs_link_name})
14 EXECUTE_PROCESS(COMMAND chmod a+x ${abs_target})
16 # FIXME: WIN32 support