defining CMake variable: what am I missing?
-
Hi all -
- I define an environment variable
mzimmers@VirtualBox:~$ env | grep FLUIDRA FLUIDRA_LIBRARY_PATH=/home/mzimmers/wiced/sdk/WICED-SDK-2.4.1
- I attempt to use said environment variable to create cmake variable (note the -DLIBRARY_PATH):
3.In my configuration file:
message ("LIBRARY_PATH is " ${LIBRARY_PATH})
When I run cmake from Creator, this is the output:
LIBRARY_PATH is "$ENV{FLUIDRA_LIBRARY_PATH}"
I've tried with and without the double quotations; same results.
Can someone please tell me WHAT I'm doing wrong here?
Thanks...
-
Try this:
%{Env:FLUIDRA_LIBRARY_PATH}.
-
@sierdzio perfect!
I looked in the docs regarding build settings for CMake, and couldn't find anything on this syntax. Are elements like "Env" explained somewhere?
Thanks!
EDIT: as a side question, I've changed the value of the environment variable (went to an earlier version of the library). Somehow, somewhere, Creator and/or CMake is retaining the old setting. Whenever I reconfigure with initial parameters, I get the old value. Where might this be kept? I've tried deleting my .user file, and the stuff in the /tmp directory...still have this problem.
Thanks.
-
@mchinand that was my thought, but I've deleted the build directory and I still get the same result. I must have some temporary file(s) somewhere...
EDIT: I found the problem, though I'm not sure how best to solve it. In my problem explanation, I neglected to mention that I was starting Creator with a "favorites" entry in the GUI. This apparently bypasses all the startup files in my account that contain the necessary settings.
Again, I'm not sure how best to fix this, but at least I know what's going on.
-
@sierdzio perfect!
I looked in the docs regarding build settings for CMake, and couldn't find anything on this syntax. Are elements like "Env" explained somewhere?
Thanks!
EDIT: as a side question, I've changed the value of the environment variable (went to an earlier version of the library). Somehow, somewhere, Creator and/or CMake is retaining the old setting. Whenever I reconfigure with initial parameters, I get the old value. Where might this be kept? I've tried deleting my .user file, and the stuff in the /tmp directory...still have this problem.
Thanks.
@mzimmers said in defining CMake variable: what am I missing?:
Are elements like "Env" explained somewhere?
I don't know if there is a full list of all variables somewhere in the documentation. Some are mentioned here: https://doc.qt.io/qtcreator/creator-project-settings-environment.html#using-qt-creator-variables