diff --git a/Packaging/install_importlibs.cmake b/Packaging/install_importlibs.cmake index 10f39082b705564416e071634226677c8e7cedb9..ca5c9df2dc46d61186424ff30a393a4d7c9fbb7d 100644 --- a/Packaging/install_importlibs.cmake +++ b/Packaging/install_importlibs.cmake @@ -1,20 +1,23 @@ # This is more messed up that you might think. # On windows we cannot track dependency on .lib files like dll function(install_importlibs) - - if(WIN32) - #ALL .lib files are required for building - #eg: gdal.dll will have gdal_i.lib which is - #needed when you do cmake configure for projects - #using OTB. Hence the *.lib regex is non optional - #and cannot be optimized at any level. - #Only thing you can control is to create only those - #required .lib files in install directory. - file(GLOB import_lib_files - "${SUPERBUILD_INSTALL_DIR}/lib/*.lib") - foreach( import_lib_file ${import_lib_files}) - install_rule(${import_lib_file}) - endforeach() + if(NOT WIN32) return() endif() + + #ALL .lib files are required for building + #eg: gdal.dll will have gdal_i.lib which is + #needed when you do cmake configure for projects + #using OTB. Hence the *.lib regex is non optional + #and cannot be optimized at any level. + #Only thing you can control is to create only those + #required .lib files in install directory. + file(GLOB import_lib_files + "${SUPERBUILD_INSTALL_DIR}/lib/*.lib" + "${SUPERBUILD_INSTALL_DIR}/bin/itk*.dll" + ) + foreach( import_lib_file ${import_lib_files}) + install_rule(${import_lib_file}) + endforeach() + endfunction()