Эх сурвалжийг харах

Copy lib files only if it is a DLL.

Former-commit-id: 56be2e0c58a112877559b7429b3fa55a595fbf23
Jérémie Dumas 7 жил өмнө
parent
commit
ecc199fe3b

+ 4 - 4
shared/cmake/libigl.cmake

@@ -151,11 +151,11 @@ if(LIBIGL_WITH_CGAL)
 endif()
 
 # Helper function for `igl_copy_cgal_dll()`
-function(igl_copy_imported_locations src_target dst_target)
+function(igl_copy_imported_dll src_target dst_target)
   get_target_property(configurations ${src_target} IMPORTED_CONFIGURATIONS)
   foreach(config ${configurations})
     get_target_property(location ${src_target} IMPORTED_LOCATION_${config})
-    if(EXISTS "${location}")
+    if(EXISTS "${location}" AND location MATCHES "^.*\\.dll$")
       add_custom_command(TARGET ${dst_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${location}" $<TARGET_FILE_DIR:${dst_target}>)
     endif()
   endforeach()
@@ -164,8 +164,8 @@ endfunction()
 # Convenient functions to copy CGAL dlls into a target (executable) destination folder (for Windows)
 function(igl_copy_cgal_dll target)
   if(WIN32 AND LIBIGL_WITH_CGAL)
-    igl_copy_imported_locations(CGAL::CGAL ${target})
-    igl_copy_imported_locations(CGAL::CGAL_Core ${target})
+    igl_copy_imported_dll(CGAL::CGAL ${target})
+    igl_copy_imported_dll(CGAL::CGAL_Core ${target})
   endif()
 endfunction()