Skip to content

"Pre-populate CMake cache" file path doesn't expand eclipse variables #152

@sliwowitz

Description

@sliwowitz

Describe the bug
The "File" input box in CMake Bulid properties will not expand eclipse variables such as ${workspace_loc}, and passes the ${workspace_loc} (or whatever) verbatim to "cmake -C" instead.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Properties -> C/C++ Build -> Cmake4eclipse
  2. Go to File under Pre-populate CMake cache entries from file (-C)
  3. Fill in a location with an eclipse variable, e.g. "${workspace_loc}/tools/CMakePrePopulate.txt"
  4. See the string is passed verbatim cmake -C ${workspace_loc}/tools/CMakePrePopulate.txt
  5. CMake interprets that as a path relative to the build directory, i.e. you get something like CMake Error: Error processing file: /home/username/prog/workspace/project_name/build/Release/${workspace_loc}/tools/CMakePrePopulate.txt

Expected behavior
Eclipse variables are expanded, resulting in cmake -C /home/username/prog/workspace/tools/CMakePrePopulate.txt in the example here.

Useful Information

  • cmake4eclipse version: 2.1.4.202103291945
  • Which OS do you use: Fedora 34
  • Cmake version: 3.19.7

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions