Giter Site home page Giter Site logo

Comments (7)

15knots avatar 15knots commented on August 22, 2024

Could you please explain what referenced from a location inside the project. does mean?

from cmake4eclipse.

nolange avatar nolange commented on August 22, 2024

I suppose he meant passing a file in the project as parameter to cmake.

In case this is bug report is not clear, you can`t access system or userdefined variables that are managed in the Build Variables preferences, particularly when defining cmake cache variables

from cmake4eclipse.

nolange avatar nolange commented on August 22, 2024

Further, if setting/override any environment Variables in CDT (like PATH) will have no effect, the base Eclipse definitions will be used

from cmake4eclipse.

drolevar avatar drolevar commented on August 22, 2024

I'm currently using project_loc variable here. When I tried using ProjDirPath it didn't work.
screenshot from 2017-04-20 10-57-00

from cmake4eclipse.

15knots avatar 15knots commented on August 22, 2024

Could you post the cmake invokation line shown in 'CMake Console' here.

I cannot reproduce it here, I get
cmake ... -DVAREXPAND:FILEPATH=/home/.../cmake4eclipsecdt/testprojects/C-subsrc/src/../bald -G "Unix Makefiles" /home/.../cmake4eclipsecdt/testprojects/C-subsrc/src which shows that variables get properly expanded.

from cmake4eclipse.

kevemueller avatar kevemueller commented on August 22, 2024

Edited
I am now using cmake4eclipse with multiple projects / multiple configurations and experience problems with the evaluation of the variables as well.
When changing environments, the evaluation sometimes sticks to the value used in the old environment, sometimes it does not evaluate at all (logs an Exception).
I have no simple case that removes the sometimes from the above description.

When defining a C/C++ Build / Build Variable this variable is NOT expanded in the Cmake symbols.
To reproduce:
In C/C++ Build / Build Variable: Define for each Configuration a build Variable ConfigName with the proposed default value of the Eclipse variable ConfigName.
In C/C++ Build / CMake / Symbols: Define for each Configuration a -D CMAKE_INSTALL_PREFIX, FILEPATH,${project_loc}/target/${ConfigName}
Rebuild the project.
cmake4eclipse will emit on the command line for each distinct configuration
-DCMAKE_INSTALL_PREFIX:PATH=C:\Users\keve\git\scratch\testlib/target/${ConfigName}, i.e. ${project_loc} got expanded, ${ConfigName} did not get expanded.

This means that the currently building config name is inaccessible to cmake. I tried ${config_name:${project_name}}, but this resolves to the active config name of the project, which does not change in a Build all setting.

from cmake4eclipse.

15knots avatar 15knots commented on August 22, 2024

Indeed, the plugin uses org.eclipse.core.variables.VariablesPlugin to expand variables. The VariablesPlugin only knows a few variables like project_loc. You can see the full list of variables, if you open a Run configuration and open the Variables... dialog.

The CDT project re-invented the wheel and introduced the org.eclipse.cdt.core.cdtvariables.ICdtVariableManager which is pre-populated with all system environment vars and gives you the ${ConfigName} plus the stuff you add under Build Variables in the project dialog..

At least, the current behavior of variable expansion is in sync with the variables that show up if you open the Variables-dialog on the CMake | Symbols tab.
So this issue is not a bug.

from cmake4eclipse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.