How can i add variable to the linker command? I need to add a path where libraries are located. This path may change and should be configured:
Toolchain File (OSLIBS_DIR is defines is as a cli argument in cmake call)
set(OSLIBS_DIR ${OSLIBS_DIR} CACHE PATH "Specify the path to OS_Libs")
set(CMAKE_EXE_LINKER_FLAGS "-L${OSLIBS_DIR}/libs" CACHE INTERNAL "" FORCE)
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_LINKER> <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> -o <TARGET>"
But the compiler checks result in:
Linking C executable cmTC_543b2.vxe
gcc.exe -L/libs "CMakeFiles/cmTC_543b2.dir/testCCompiler.c.obj" -o cmTC_543b2.elf
${OSLIBS_DIR} is expanded empty.
Btw: Is there any documentation what this <brackets>
mean in the CMake language?