add dependinfo to custom target

When I set an executable:

enable_language(CXX)
add_executable( MyProj_MyExe2 main.cc )

CMake populates CMAKE_DEPENDS_LANGUAGES in DependInfo.cmake:

# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
  "CXX"
  )

for a custom target, it does not:

# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
  )

How can I set CMAKE_DEPENDS_LANGUAGES? I tried by setting the Linker Language

add_custom_target( MyProj_MyExe1 ALL
	DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/MyExe1
	SOURCES main.cc
)
set_target_properties( MyProj_MyExe1 PROPERTIES
	LINKER_LANGUAGE CXX
)

but it doesn’t work. Is CMAKE_DEPENDS_LANGUAGES a directory property?

What is your add_custom_target trying to do? Custom targets (and commands) currently do not support depfile-like dependency discovery (except add_custom_command(DEPFILE) which only works with Ninja).