[CMake] Copying executeables and libraries

Andreas Pokorny andreas.pokorny at gmail.com
Mon Mar 31 18:41:30 EDT 2008


Hi,
I work on a project that creates several dlls and shared object files, and
some executables.
To test only aspects of the software I need to copy the tested parts into a
separate directory, because one of the components loads all libraries that
implement a certain interface and can be found in the directory.
So to avoid interference with other tests, or new components I would like
to have a well defined set of components in one directory.

How can I achieve that in a portable manner? Right now each of these tests
uses a separate project and there is a msvc specific custom target, which
copies the .dll .pdb and the test case executeble files using cmake -E .
The copy commands are rather hard to read, something like:
 COMMAND ${CMAKE_COMMAND} -E
${SomeProject_BINARY_DIR}/${CMAKE_CFG_INT_DIR}/SomeProject.dll
${PROJECT_BINARY_DIR}/
and I will have to duplicate them to also support unix like library names....
There should be a cleaner way to do that.

Any ideas?

kind regards
Andreas Pokorny


More information about the CMake mailing list