What I want to accomplish is to link libraries of the same name but from different paths.
Currently I’m helping myself with
link_directories(${FOREIGN_DIR}/arch/win32/apil/access/x64/${CMAKE_BUILD_TYPE})
and later link the foreign_lib.lib so:
target_link_libraries(${LIB_NAME} ${CMAKE_JS_LIB} foreign_lib ${EXTRA_LIB})
foreign_lib.lib
obviously exists in a debug and release variant in a properly named subdirectory as you can see above, but both have the same name and I can’t influence this.
Also I have to set the CMAKE_BUILD_TYPE
myself further up the script as it is empty (the docs for that variable are as usual worthless) which is just a placeholder and also ugly/bad practice as I understand.
What I don’t understand:
The CMake-tools in VisualStudio Code offer me the well-known options Debug, Release, MinSizeRel, RelWithDebInfo
but I fail to understand how this can be correctly employed in the config step.
How does one go about linking in such a scenario correctly?
PS: integrating further variation by factoring in architecture (x64
, Win32
…) and target system (linux
,x64
, …) would be a plus but my main concern is the above problem RN.