[CMake] Interpretation of RUNTIME_OUTPUT_DIRECTORY in VisualStudio

Martin Apel martin.apel at simpack.de
Tue Mar 17 08:40:18 EDT 2009


Hi all,

I am trying to write CMake rules to copy shared libraries / DLLs to the
runtime directory (not "installing"), right besides the binaries
generated by my project. In order to do this, I have rules like the
following:
ADD_CUSTOM_TARGET(QtLibs
                                             COMMAND ${CMAKE_COMMAND} -E
copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/libQtCore.so.4  
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}...)

This works fine on Linux and Windows using the NMake generator. However,
when using VisualStudio 8 under Windows, these libraries end up in the
directory, where CMAKE_RUNTIME_OUTPUT_DIRECTORY points to, whereas the
generated binaries are put into ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/debug
or /release.

Is the interpretation of what the RUNTIME_OUTPUT_DIRECTORY property or
the CMAKE_RUNTIME_OUTPUT_DIRECTORY means different for the Visual Studio
generators? Do I have to put something like
IF (MSVC80)
  ...
ELSE(MSVC80)
  ...
ENDIF(MSVC80)

into my CMakeLists.txt? Or is there a better solution?

Best Regards,

Martin



____________
Virus checked by G DATA AntiVirus
Version: AVF 19.302 from 16.03.2009




More information about the CMake mailing list