[CMake] About copy .dll files into destination directory in windows

Adolfo Rodríguez dofo79 at gmail.com
Sat May 2 04:48:47 EDT 2009


On Sat, May 2, 2009 at 7:05 AM, 张宁 <zhangning1978 at gmail.com> wrote:

> Hello! I used cmake to generate dll files used for matlab. The
> cmakelists.txt is listed below
>
> cmake_minimum_required( VERSION 2.6 )
> # matlab specific stuff
> set( matlab_include_path D:/Program Files/MATLAB/R2008b/extern/include )
> set( lsmlib_include_path
> F:/VISUAL_STUDIO_PROJECT/LEVEL_SET/lsmlib-1.0.0/include )
> set( matlab_library_path D:/Program
> Files/MATLAB/R2008b/extern/lib/win32/microsoft )
> set( lsmlib_library_path
> F:/VISUAL_STUDIO_PROJECT/LEVEL_SET/lsmlib-1.0.0/lib )
> include_directories( ${matlab_include_path} ${lsmlib_include_path} )
> link_directories( ${matlab_library_path} ${lsmlib_library_path} )
> link_libraries( libmx.lib libmex.lib libeng.lib )
> set( source_file
> CENTRAL_GRAD_ORDER2_2D.c
> CENTRAL_GRAD_ORDER2_2D.def )
> add_library( CENTRAL_GRAD_ORDER2_2D SHARED ${source_file} )
> target_link_libraries( CENTRAL_GRAD_ORDER2_2D
> liblsm_spatial_derivatives.lib )
> install( TARGETS CENTRAL_GRAD_ORDER2_2D
>          LIBRARY DESTINATION lib/matlab
>          ARCHIVE DESTINATION lib )
>

I believe that you must specify the RUNTIME DESTINATION in your install
command, since in dll platforms (e.g., Windows) shared  libraries are
treated as RUNTIME targets. More info here:

http://cmake.org/cmake/help/cmake2.6docs.html#command:install

HTH,

Adolfo


>
> I want to install the generated .dll and .lib files into a special
> directory. After I compile the INSTALL project, I found that only the .lib
> files were copied to the destination directory and the .dll files were not
> be copied! Why? How to resolved this question?
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Adolfo Rodríguez Tsouroukdissian

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090502/6677668b/attachment.htm>


More information about the CMake mailing list