Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use Environment Environment variables with External Tools ?
QtWS25 Last Chance

How to use Environment Environment variables with External Tools ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 562 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.
  • A Offline
    A Offline
    Aramir
    wrote on last edited by
    #1

    Hello,

    I have defined an External tool in my QtCreator that requires a "ID number" as a parameter. For now that parameter is defined in the project's CMakeLists.txt. I already gave up on trying to get a CMake variable using External Tools (or it would require me to parse the CMake to get said variable). But I was wondering if it was possible to use a Environment Variable as a Parameter for that External Tool . Variable that I would have to define manually in the Projects-> Build-> Build Environment -> Add "CMAKE_APP_ID".

    According to the documentation it should be possible use it by typing %{ENV:CMAKE_APP_ID} ... But sadly it doesn't work. I tried using echo as an External Tool with this parameter and it returns nothing.

    Am I doing something wrong ?

    Thanks for reading.

    1 Reply Last reply
    0
    • AndySA Offline
      AndySA Offline
      AndyS
      Moderators
      wrote on last edited by
      #2

      Hi @Aramir

      If you want it to be based on your current build environment then you should use %{CurrentBuild:Env:CMAKE_APP_ID} instead of %{ENV:CMAKE_APP_ID} as the latter will just take your system environment as opposed to the build one.

      Does this solve it?

      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      5

      • Login

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