learning-cmake icon indicating copy to clipboard operation
learning-cmake copied to clipboard

[DOC Error] ADD_EXECUTABLE expects the source files not the variable name

Open leeexyz opened this issue 6 years ago • 0 comments

Hi there, When I try the first example in cmake-pratice, page 6, cmake complains cannot find source files.

-- This is BINARY dir
-- This is SOURCE dir
-- Configuring done
CMake Error at CMakeLists.txt:8 (add_executable):
  Cannot find source file:

    SRC_LIST

  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: hello
CMake Error: Cannot determine link language for target "hello".

After I modified add_executable(hello SRC_LIST) to add_executable(hello ${SRC_LIST}), this issue had been solved. So here must be using variable name. Can you check and update it?

cmake version 3.5.1

leeexyz avatar Mar 06 '19 07:03 leeexyz