mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
636a309981
Instead of appending to a command output, append to an existing target instead. The primary benefit is intermediary ...-cmd targets aren't needed, we can instead append commands to the relevant target directly.
20 lines
616 B
CMake
20 lines
616 B
CMake
# Defines a target named ${target}. If ${prg} is undefined the target prints
|
|
# "not found".
|
|
#
|
|
# - Use add_custom_command(TARGET <target_name> ...) to append a command to the
|
|
# target.
|
|
function(def_cmd_target target prg prg_name prg_fatal)
|
|
add_custom_target(${target})
|
|
|
|
if(NOT prg)
|
|
if(prg_fatal)
|
|
add_custom_command(TARGET ${target}
|
|
COMMAND ${CMAKE_COMMAND} -E echo "${target}: ${prg_name} not found"
|
|
COMMAND false)
|
|
else()
|
|
add_custom_command(TARGET ${target}
|
|
COMMAND ${CMAKE_COMMAND} -E echo "${target}: SKIP: ${prg_name} not found")
|
|
endif()
|
|
endif()
|
|
endfunction()
|