[CMake] copy generated dll in executable directory

Benoit benpaka.spam at gmail.com
Mon Feb 9 11:31:00 EST 2009


Hy!

I'm doing a project where I'm generating 2 libraries for differents
application. The problem is that the dll and the executable are not in the
same directory. Therefore if i need to copy the dll each time i want to
recompile them.


The tree of my project is the following.

./CMakeList.txt (A)
./my/
./my/lib1/CmakeList.txt (B)
./my/lib2/
./test1
./test2


And in the file CMakeList.txt (A), I have:

set( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin )
set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/bin )


I've found some help on the web and now i I use the install target in the
Makefile to copy the .dll in the binary directory.

And in CmakeList.txt (B)

INSTALL( TARGETS ${LIBNAME} DESTINATION . PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE )


However, i would like to have them directly in the executable output path.
Using the target all should be sufficient to generate the executable and the
new dll in the same directory.


Thanks,

--
Benoit RAT
www.neub.co.nr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090209/7a24cc99/attachment.htm>


More information about the CMake mailing list