Skip to content

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

Open
@leeexyz

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions