How do I specify that CMake should use a different link_directories
value depending on whether the target is 32-bit or 64-bit? For example, 32-bit binaries need
For Boost specifically, you should use
FIND_LIBRARY(Boost 1.44 COMPONENTS ...)
Then the CMake variable Boost_LIBRARY_DIRS will contain the correct library path, which has to be set using LINK_DIRECTORIES, e.g.
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
The more general case is correctly described in user434507's answer.