[CMake] setting LINK_DIRECTORIES depanding on debug/release build VS8

Bill Hoffman bill.hoffman at kitware.com
Sat May 5 08:21:44 EDT 2007


Christoph John wrote:
> Hello Bill,
> Using Target_Link libaries even does not work for me. I used the following construct:
>
> SET( VXL_DEBUG_LIBS "D:/vxl-1.8.0/lib/debug/vcl")
> SET( VXL_RELEASE_LIBS "D:/vxl-1.8.0/lib/release/vcl")
>
> TARGET_LINK_LIBRARIES(TheApp optimized ${VXL_RELEASE_LIBS} debug ${VXL_DEBUG_LIBS})
>
> The VC8 makefile has under "Additional Link dirs" always both pathes
> "D:/vxl-1.8.0/lib/debug/" and "D:/vxl-1.8.0/lib/release" included.
>
> Did I unterstand you right? If so is there another way to do it.
>   
You need to use the FULL path to the library and not just the directory.

target_link_libraries(TheApp debug d:/vxl/lib/debug/vcl.lib  optimized 
d:/vxl/lib/release/vcl.lib)

Also, you need to make sure you do this for all the libraries you are 
linking in.  If you link just one library from the wrong one you will 
end up with both.

-Bill



More information about the CMake mailing list