Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. defining CMake variable: what am I missing?
Forum Update on Monday, May 27th 2025

defining CMake variable: what am I missing?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
6 Posts 3 Posters 703 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi all -

    1. I define an environment variable
    mzimmers@VirtualBox:~$ env | grep FLUIDRA
    FLUIDRA_LIBRARY_PATH=/home/mzimmers/wiced/sdk/WICED-SDK-2.4.1
    
    1. I attempt to use said environment variable to create cmake variable (note the -DLIBRARY_PATH):
      qt.PNG
      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...

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Try this:

      %{Env:FLUIDRA_LIBRARY_PATH}.
      

      (Z(:^

      mzimmersM 1 Reply Last reply
      3
      • sierdzioS sierdzio

        Try this:

        %{Env:FLUIDRA_LIBRARY_PATH}.
        
        mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by mzimmers
        #3

        @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.

        sierdzioS 1 Reply Last reply
        0
        • M Offline
          M Offline
          mchinand
          wrote on last edited by
          #4

          Most likely in CMakeCache.txt in your build directory.

          mzimmersM 1 Reply Last reply
          0
          • M mchinand

            Most likely in CMakeCache.txt in your build directory.

            mzimmersM Offline
            mzimmersM Offline
            mzimmers
            wrote on last edited by mzimmers
            #5

            @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.

            1 Reply Last reply
            0
            • mzimmersM mzimmers

              @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.

              sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              @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

              (Z(:^

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved