Symbolic links CMake

前端 未结 6 447
抹茶落季
抹茶落季 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:38

    I've added the check to @ulidtko's approach, so symlink doesn't overridden on every rebuild unconditionally:

    install(CODE "if (NOT EXISTS ${link})
                      execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \
                                                                    ${target} \
                                                                    ${link})
                  endif()" )
    

提交回复
热议问题