add_custom_command(TARGET targetname
COMMENT "Symlinking compile_commands.json for LSP convenience"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json"
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E create_symlink
"${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json"
"${PROJECT_SOURCE_DIR}/compile_commands.json")
|