You can use a `$<TARGET_LINKER_FILE_DIR:...>` generator expression, however you couldn't use `$<TARGET_LINKER_FILE_DIR:opencv_matlab>` until it is defined, which is way further down in the piece. So I think you have two options to fix this:

1. Use `$<TARGET_LINKER_FILE_DIR:opencv_core>`, or
2. `${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}` which uses the `CMAKE_CFG_INTDIR` meta-variable, and behaves properly for single-configuration generators (see http://www.cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_CFG_INTDIR)

I tried both approaches, and they work equally well for me when using Makefile and Xcode generators. It's a matter of taste which you prefer.