[CMake] setting LINK_DIRECTORIES depanding on debug/release build
VS8
Bill Hoffman
bill.hoffman at kitware.com
Fri May 4 08:55:07 EDT 2007
Christoph John wrote:
> Hello,
> I am using CMake 2.4 patch 6 under Windows to generate makefiles for VS8.
> I am trying to set LINK_DIRECTORIES depending on the optimized or debug build of the project. I have not found a way to do this.
>
> my link libraries are under PATH/debug/*.lib and PATH/release/*.lib and have the same names. I already tried putting the relative path into TARGET_LINK_LIBRARIES but this even does not work.
> Therefore my question, how can I set the LINK_DIRECTORIES path depending on the build? Thanks a lot.
>
The best way to do this is to not use LINK_DIRECTORIES. Instead use
target_link_libraries, and give the FULL path to the library you want to
link to. CMake should then do the right thing.
-Bill
More information about the CMake
mailing list