User forums > Using Code::Blocks

Using system environment variables in .cbp project file

(1/2) > >>

akk0rd87:
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
--- End code ---

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

--- End code ---

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

--- End code ---
I have a search, for example http://forums.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:

--- Code: ---<Unit filename="${AKKORD_SDK_HOME}/framework/basewrapper.cpp" />
--- End code ---
I don't think this is supported.
The variables in the other places are supported, but I don't think they are supported here.

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.

Navigation

[0] Message Index

[#] Next page

Go to full version