vcpkg/ports/vtk/vtkm.patch

154 строки
5.3 KiB
Diff

diff --git a/Accelerators/Vtkm/Core/CMakeLists.txt b/Accelerators/Vtkm/Core/CMakeLists.txt
index 397dca9f6..bc9c62ac5 100644
--- a/Accelerators/Vtkm/Core/CMakeLists.txt
+++ b/Accelerators/Vtkm/Core/CMakeLists.txt
@@ -16,8 +16,7 @@
set(VTKm_NO_DEPRECATED_VIRTUAL ON)
-list(INSERT CMAKE_MODULE_PATH 0
- "${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake")
+find_package(VTKm CONFIG REQUIRED)
set(private_headers
vtkmFilterPolicy.h
@@ -65,9 +64,6 @@ vtkm_add_target_information(${vtkm_accel_target}
EXTENDS_VTKM
MODIFY_CUDA_FLAGS
DEVICE_SOURCES ${sources})
-vtk_module_set_property(VTK::AcceleratorsVTKmCore
- PROPERTY JOB_POOL_COMPILE
- VALUE vtkm_pool)
if (TARGET vtkm::kokkos_hip)
list(TRANSFORM nowrap_classes APPEND ".cxx" OUTPUT_VARIABLE hip_impl)
diff --git a/Accelerators/Vtkm/DataModel/CMakeLists.txt b/Accelerators/Vtkm/DataModel/CMakeLists.txt
index 9d5dfe100..7fea257b7 100644
--- a/Accelerators/Vtkm/DataModel/CMakeLists.txt
+++ b/Accelerators/Vtkm/DataModel/CMakeLists.txt
@@ -16,8 +16,7 @@
set(VTKm_NO_DEPRECATED_VIRTUAL ON)
-list(INSERT CMAKE_MODULE_PATH 0
- "${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake")
+find_package(VTKm CONFIG REQUIRED)
set(sources
vtkmlib/ArrayConvertersReal.cxx
@@ -72,10 +71,6 @@ vtkm_add_target_information(${vtkm_accel_target}
MODIFY_CUDA_FLAGS
DEVICE_SOURCES ${sources})
-vtk_module_set_property(VTK::AcceleratorsVTKmDataModel
- PROPERTY JOB_POOL_COMPILE
- VALUE vtkm_pool)
-
if (TARGET vtkm::cuda)
set(cuda_impl ${nowrap_classes} vtkmDataSet.cxx)
set_source_files_properties(${cuda_impl} PROPERTIES
diff --git a/Accelerators/Vtkm/Filters/CMakeLists.txt b/Accelerators/Vtkm/Filters/CMakeLists.txt
index 0f51c436d..567b49197 100644
--- a/Accelerators/Vtkm/Filters/CMakeLists.txt
+++ b/Accelerators/Vtkm/Filters/CMakeLists.txt
@@ -16,8 +16,7 @@
set(VTKm_NO_DEPRECATED_VIRTUAL ON)
-list(INSERT CMAKE_MODULE_PATH 0
- "${VTK_SOURCE_DIR}/ThirdParty/vtkm/vtkvtkm/vtk-m/CMake")
+find_package(VTKm CONFIG REQUIRED)
set(classes
vtkmAverageToCells
@@ -118,9 +117,6 @@ vtkm_add_target_information(${vtkm_accel_target}
MODIFY_CUDA_FLAGS
DEVICE_SOURCES ${sources})
-vtk_module_set_property(VTK::AcceleratorsVTKmFilters
- PROPERTY JOB_POOL_COMPILE
- VALUE vtkm_pool)
vtk_module_link(VTK::AcceleratorsVTKmFilters
PRIVATE
vtkm_worklet
diff --git a/CMake/vtk-config.cmake.in b/CMake/vtk-config.cmake.in
index a8c40085a..764298f0e 100644
--- a/CMake/vtk-config.cmake.in
+++ b/CMake/vtk-config.cmake.in
@@ -126,9 +126,7 @@ set("${CMAKE_FIND_PACKAGE_NAME}_AVAILABLE_COMPONENTS" "@vtk_all_components@")
unset("${CMAKE_FIND_PACKAGE_NAME}_FOUND")
set("${CMAKE_FIND_PACKAGE_NAME}_HAS_VTKm" "@vtk_has_vtkm@")
if (${CMAKE_FIND_PACKAGE_NAME}_HAS_VTKm)
- find_package(VTKm
- PATHS "${CMAKE_CURRENT_LIST_DIR}/vtkm"
- NO_DEFAULT_PATH)
+ find_package(VTKm CONFIG REQUIRED)
if (NOT VTKm_FOUND)
set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 0)
endif ()
diff --git a/ThirdParty/vtkm/CMakeLists.txt b/ThirdParty/vtkm/CMakeLists.txt
index 8cfbf92b0..ad78cc8f5 100644
--- a/ThirdParty/vtkm/CMakeLists.txt
+++ b/ThirdParty/vtkm/CMakeLists.txt
@@ -1,6 +1,41 @@
-vtk_module_third_party_internal(
- LICENSE_FILES "vtkvtkm/vtk-m/LICENSE.txt"
- VERSION "1.7.1"
- SUBDIRECTORY vtkvtkm
- STANDARD_INCLUDE_DIRS
- INTERFACE)
+#vtk_module_third_party_internal(
+# LICENSE_FILES "vtkvtkm/vtk-m/LICENSE.txt"
+# VERSION "master"
+# SUBDIRECTORY vtkvtkm
+# STANDARD_INCLUDE_DIRS
+# INTERFACE)
+
+message(STATUS "VTK_MODULE_USE_EXTERNAL_VTK_vtkm: ${VTK_MODULE_USE_EXTERNAL_VTK_vtkm}")
+if(TRUE)
+ message(STATUS "Searching for external VTKm")
+ find_package(VTKm CONFIG REQUIRED)
+ if(TARGET vtkm_compiler_flags)
+ get_target_property(VTKm_INCLUDE_DIRS vtkm_compiler_flags INTERFACE_INCLUDE_DIRECTORIES)
+ message(STATUS "INCLUDE: ${VTKm_INCLUDE_DIRS}")
+ get_target_property(VTKm_DIY_INCLUDE_DIRS vtkm_diy INTERFACE_INCLUDE_DIRECTORIES)
+ get_target_property(VTKm_OPTION_INCLUDE_DIRS vtkm_optionparser INTERFACE_INCLUDE_DIRECTORIES)
+ if(MSVC)
+ set(VTKm_DEFINITIONS /bigobj)
+ endif()
+ else()
+ message(FATAL_ERROR "VTKM target missing")
+ endif()
+ if(VTKM_FOUND)
+ message(STATUS "Found VTKm")
+ endif()
+endif()
+
+vtk_module_third_party(
+ INTERNAL
+ HEADER_ONLY
+ LICENSE_FILES "vtkvtkm/vtk-m/LICENSE.txt"
+ VERSION "master"
+ SUBDIRECTORY vtkvtkm
+ STANDARD_INCLUDE_DIRS
+ INTERFACE
+ EXTERNAL
+ PACKAGE VTKm
+ TARGETS vtkm_cont vtkm_filter vtkm_diy vtkm_optionparser vtkm_taotuple
+ #LIBRARIES vtkm_cont vtkm_filter vtkm_diy vtkm_optionparser vtkm_taotuple
+ INCLUDE_DIRS VTKm_INCLUDE_DIRS VTKm_DIY_INCLUDE_DIRS VTKm_OPTION_INCLUDE_DIRS
+)
diff --git a/ThirdParty/vtkm/vtk.module b/ThirdParty/vtkm/vtk.module
index a8e4dad0f..c7bbbf0e8 100644
--- a/ThirdParty/vtkm/vtk.module
+++ b/ThirdParty/vtkm/vtk.module
@@ -3,5 +3,7 @@ NAME
PRIVATE_DEPENDS
# While not needed to satisfy symbols, this is necessary to guarantee that
# VTK_SMP_IMPLEMENTATION_TYPE is available when configuring vtk-m.
- VTK::CommonCore
+ # VTK::CommonCore
+LIBRARY_NAME
+ VTKm
THIRD_PARTY