Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4,098
    • Issues 4,098
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #16661
Closed
Open
Issue created Feb 21, 2017 by Michael Maltese@ligfxContributor

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".
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking