News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Using system environment variables in .cbp project file

Started by akk0rd87, April 21, 2018, 08:43:09 AM

Previous topic - Next topic

akk0rd87

Code::BLocks 17.12.
I have a system env variable on my windows 10:
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.

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

...
<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.next.codeblocks.org/index.php?topic=5411.0, but I didn't find solution there.

akk0rd87

This works for MSVS, but now I want implement it to CodeBlocks.

oBFusCATed

<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!]

akk0rd87

oBFusCATed, Thank you for reply. Is it allowed through cutsom makefile?

oBFusCATed

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!]

akk0rd87

May I request feature for support system env vars in project file?