[CMake] Different CMAKE_LIBRARY_PATH for Debug and Release builds

Rolf Eike Beer eike at sf-mail.de
Tue Dec 3 08:28:28 EST 2013


Am 03.12.2013 13:50, schrieb Alexey Petruchik:
> For windows build I have win32/libs folder with prebuilt libraries in 
> my
> source code repo. Debug versions live in win32/libs/x86/debug, release 
> ones
> in win32/libs/x86/release. How I can achieve linking to different 
> libraries
> for different configurations in Visual Studio? Something like
> set(CMAKE_LIBRARY_PATH "win32/libs/x86/${CMAKE_BUILD_TYPE}) doesn't 
> work
> for me because CMAKE_BUILD_TYPE seems to be undefined at project 
> generation
> time.

cmake --help-command target_link_libraries

Look for "debug" and "optimized" here. If you have Find*.cmake modules 
for your stuff also look at

cmake --help-module SelectLibraryConfigurations

Eike


More information about the CMake mailing list