Author Topic: Using system environment variables in .cbp project file  (Read 3915 times)

Offline akk0rd87

  • Single posting newcomer
  • *
  • Posts: 4
Using system environment variables in .cbp project file
« on: April 21, 2018, 08:43:09 am »
Code::BLocks 17.12.
I have a system env variable on my windows 10:
Code
C:\Users\MyUser>set AKKORD_SDK_HOME
AKKORD_SDK_HOME=C:\CommonVersioning\akk0rdsdk

I have a project file Example1.cbp contains some search directories and path to source code files.
Code
...
<Compiler>
<Add option="-Wall" />
<Add directory="../../../framework" />
<Add directory="../../../libraries/SDL/i686-w64-mingw32/include/SDL2" />
<Add directory="../../../libraries/SDL_image/i686-w64-mingw32/include/SDL2" />
</Compiler>
<Linker>
<Add option="-lmingw32 -lSDL2main -lSDL2 -lSDL2_image" />
<Add directory="../../../libraries/SDL/i686-w64-mingw32/lib" />
<Add directory="../../../libraries/SDL_image/i686-w64-mingw32/lib" />
</Linker>
<Unit filename="../../../framework/admob.cpp" />
<Unit filename="../../../framework/basewrapper.cpp" />
<Unit filename="../src/main.cpp" />
...

It is any way to use my env variable to specify path like this? This example does not work for me.
Code
...
<Compiler>
<Add option="-Wall" />
<Add directory="${AKKORD_SDK_HOME}/framework" />
<Add directory="${AKKORD_SDK_HOME}/libraries/SDL/i686-w64-mingw32/include/SDL2" />
<Add directory="${AKKORD_SDK_HOME}/libraries/SDL_image/i686-w64-mingw32/include/SDL2" />
</Compiler>
<Linker>
<Add option="-lmingw32 -lSDL2main -lSDL2 -lSDL2_image" />
<Add directory="${AKKORD_SDK_HOME}/libraries/SDL/i686-w64-mingw32/lib" />
<Add directory="${AKKORD_SDK_HOME}/libraries/SDL_image/i686-w64-mingw32/lib" />
</Linker>
<Unit filename="${AKKORD_SDK_HOME}/framework/admob.cpp" />
<Unit filename="${AKKORD_SDK_HOME}/framework/basewrapper.cpp" />
<Unit filename="../src/main.cpp" />
...
I have a search, for example http://forums.codeblocks.org/index.php?topic=5411.0, but I didn't find solution there.

Offline akk0rd87

  • Single posting newcomer
  • *
  • Posts: 4
Re: Using system environment variables in .cbp project file
« Reply #1 on: April 21, 2018, 08:58:18 am »
This works for MSVS, but now I want implement it to CodeBlocks.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Using system environment variables in .cbp project file
« Reply #2 on: April 21, 2018, 09:17:37 am »
Code
<Unit filename="${AKKORD_SDK_HOME}/framework/basewrapper.cpp" />
I don't think this is supported.
The variables in the other places are supported, but I don't think they are supported here.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline akk0rd87

  • Single posting newcomer
  • *
  • Posts: 4
Re: Using system environment variables in .cbp project file
« Reply #3 on: April 21, 2018, 10:07:46 am »
oBFusCATed, Thank you for reply. Is it allowed through cutsom makefile?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Using system environment variables in .cbp project file
« Reply #4 on: April 21, 2018, 10:16:25 am »
The makefiles control the build process, so if you can do it with a makefile it will work, but you won't see the files in the project tree.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline akk0rd87

  • Single posting newcomer
  • *
  • Posts: 4
Re: Using system environment variables in .cbp project file
« Reply #5 on: April 25, 2018, 09:56:43 pm »
May I request feature for support system env vars in project file?