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

张宁 zhangning1978 at gmail.com
Sat May 2 01:05:32 EDT 2009


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 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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090502/986af048/attachment.htm>


More information about the CMake mailing list