[CMake] Output directory in Visual C++

Michael Hertling mhertling at online.de
Wed Jun 22 18:37:40 EDT 2011


On 06/22/2011 08:00 PM, Mathias Bavay wrote:
> Hi!
> 
> In my tries to properly compile a library with Visual C++ 10 Express, 
> I've noticed that despite setting LIBRARY_OUTPUT_DIRECTORY 
> "${PROJECT_SOURCE_DIR}/lib" in SET_TARGET_PROPERTIES (which works 
> perfectly fine with gcc on Linux and Xcode on OSX), the Visual C++ 
> "Output directory" property of the dynamic library target is not 
> properly set (it still is some sort of a default value). On the other 
> hand, for the static library, it has the correct (ie: customized) value 
> as well as for the import library.
> 
> Is this normal?

The LIBRARY_OUTPUT_DIRECTORY[_<CONFIG>] properties apply neither
to DLLs nor to static or import libraries since the formers are
considered as runtime targets and the latters as archive targets,
i.e. use the RUNTIME_OUTPUT_DIRECTORY[_<CONFIG>] properties for
DLLs and the ARCHIVE_OUTPUT_DIRECTORY[_<CONFIG>] properties for
static and import libraries. BTW, do not write to the project's
source tree during the build, e.g. by setting OUTPUT_DIRECTORY
properties to ${PROJECT_SOURCE_DIR} or something below; it's
bad style and might give rise to strange problems.

'hope that helps.

Regards,

Michael


More information about the CMake mailing list