CMake: Symlink files instead of copying them during install -


making cmake copy files during make install simple:

install(targets foo destination lib) install(directory include/ destination include) 

but possible write make symlink make symlinks instead of copying files? if so, how?

write cmake script creates required symlink:

symlink_include_dir.cmake.in:

execute_process(command cmake -e create_symlink     "@cmake_source_dir@/include" # old name     "@cmake_install_prefix@/include" # new name ) 

in cmakelists.txt configure script adjust actual source , install paths, , call install(script):

cmakelists.txt:

# copy original script @variable@ replaced variable's value. configure_file("symlink_include_dir.cmake.in" "symlink_include_dir.cmake"    @only)  # tell cmake use script @ install stage install(script "${cmake_current_binary_dir}/symlink_include_dir.cmake") 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -