Symbolic links CMake

前端 未结 6 439
抹茶落季
抹茶落季 2020-12-17 10:34

I want to rename certain executables in CMakeLists.txt but also want symbolic links from the older names to new files for backward compatibility. How can this b

6条回答
  •  粉色の甜心
    2020-12-17 11:34

    You can create a custom target and use CMake to create symlinks

    ADD_CUSTOM_TARGET(link_target ALL
                      COMMAND ${CMAKE_COMMAND} -E create_symlink ${target} ${link})
    

    This will only work on systems that support symlinks, see guide.

    Available on UNIX only:

    create_symlink old new - create a symbolic link new -> old

提交回复
热议问题