You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Go to Properties -> C/C++ Build -> Cmake4eclipse
Go to File under Pre-populate CMake cache entries from file (-C)
Fill in a location with an eclipse variable, e.g. "${workspace_loc}/tools/CMakePrePopulate.txt"
See the string is passed verbatim cmake -C ${workspace_loc}/tools/CMakePrePopulate.txt
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
The text was updated successfully, but these errors were encountered:
It is by intent that variables are not allowed to pre-populate the cache. IMHO, the file to pre-populate the cache should be sitting inside the project source directory or users should put a PreLoad.cmake file into the source dir.
What exactly are you trying to achieve?
Honestly, I don't remember what was the exact thing I wanted to do. Basically in need to frequently switch build profiles to try out different combinations of CMake flags. For most of my current work projects, there's a base set of cca six CMake flags that are always the same on my machine, then there are other three or four which I want to test in different combinations. I guess I wanted to put those six in a separate file, since they're the same for all the projects (coming from our core library), and have them live inside my workspace, but outside the project directory (since they are specific to my machine).
In my case, an absolute path will do. It just felt inconsistent - when most other file entry dialogs expand the eclipse variables, I would have expected this dialog to expand them as well.
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:
cmake -C ${workspace_loc}/tools/CMakePrePopulate.txt
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
The text was updated successfully, but these errors were encountered: