Documentation about make-style variable references is misleading
Since at least 3.0, the documentation on syntax has read:
To support legacy CMake code, unquoted arguments may also contain double-quoted strings (
"..."
, possibly enclosing horizontal whitespace), and make-style variable references ($(MAKEVAR)
).
I tried a simple CMake project on 3.7.2, 3.5.0, and 2.8.12.1:
cmake_minimum_required(VERSION 2.6)
project(foo)
set(SOURCES main.cpp)
add_executable(main $(SOURCES))
and on all versions I get the following error:
CMake Error at CMakeLists.txt:6 (add_executable):
Cannot find source file:
$(SOURCES)
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
CMake Error: CMake can not determine linker language for target: main
CMake Error: Cannot determine link language for target "main".