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 Updated to NodeBB v4.3 + New Features

defining CMake variable: what am I missing?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
6 Posts 3 Posters 727 Views 3 Watching
  • 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.
  • M Offline
    M Offline
    mzimmers
    wrote on 7 Sept 2021, 22:28 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
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 8 Sept 2021, 04:53 last edited by
      #2

      Try this:

      %{Env:FLUIDRA_LIBRARY_PATH}.
      

      (Z(:^

      M 1 Reply Last reply 8 Sept 2021, 14:42
      3
      • S sierdzio
        8 Sept 2021, 04:53

        Try this:

        %{Env:FLUIDRA_LIBRARY_PATH}.
        
        M Offline
        M Offline
        mzimmers
        wrote on 8 Sept 2021, 14:42 last edited by mzimmers 9 Aug 2021, 15:53
        #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.

        S 1 Reply Last reply 9 Sept 2021, 06:15
        0
        • M Offline
          M Offline
          mchinand
          wrote on 8 Sept 2021, 19:24 last edited by
          #4

          Most likely in CMakeCache.txt in your build directory.

          M 1 Reply Last reply 8 Sept 2021, 20:26
          0
          • M mchinand
            8 Sept 2021, 19:24

            Most likely in CMakeCache.txt in your build directory.

            M Offline
            M Offline
            mzimmers
            wrote on 8 Sept 2021, 20:26 last edited by mzimmers 9 Aug 2021, 22:01
            #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
            • M mzimmers
              8 Sept 2021, 14:42

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

              S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 9 Sept 2021, 06:15 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

              1/6

              7 Sept 2021, 22:28

              • Login

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