Commit ea5129f2 authored by Robert Maynard's avatar Robert Maynard
Browse files

VTK-m correctly handles have find_package called multiple times.

When you called find_package multiple times with VTK-m components such
as CUDA would continuously append to variables, causing a variable to have
the same parameter listed multiple times. Secondly since the VTKmConfig
would clear the FOUND flags, each call would cause VTK-m to search for
sections all over again.

The primary issue that caused this correction was passing the same
compile flags multiple times to nvcc which causes compile errors.
parent c4a78d95
Pipeline #26900 passed with stage
......@@ -47,9 +47,11 @@ if(CMAKE_CURRENT_LIST_DIR STREQUAL "@VTKm_BINARY_DIR@/@VTKm_INSTALL_CONFIG_DIR@"
endif()
# The VTKm include file directories.
set_and_check(VTKm_INCLUDE_DIRS "@PACKAGE_VTKm_INSTALL_INCLUDE_DIR@")
if(VTKm_PACKAGE_IN_BUILD)
set(VTKm_INCLUDE_DIRS ${VTKm_INCLUDE_DIRS} "@VTKm_SOURCE_DIR@")
if(NOT VTKm_FOUND)
set_and_check(VTKm_INCLUDE_DIRS "@PACKAGE_VTKm_INSTALL_INCLUDE_DIR@")
if(VTKm_PACKAGE_IN_BUILD)
set(VTKm_INCLUDE_DIRS ${VTKm_INCLUDE_DIRS} "@VTKm_SOURCE_DIR@")
endif()
endif()
set(VTKm_REQUIRED_BOOST_VERSION "@VTKm_REQUIRED_BOOST_VERSION@")
......@@ -73,9 +75,6 @@ if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "@VTKm_BINARY_DIR@")
include(${VTKm_CONFIG_DIR}/VTKmTargets.cmake)
endif()
# Clear out the libraries. We will add more when loading components.
set(VTKm_LIBRARIES)
# The VTKm variables used to configure components and packages silently.
set(VTKm_CONFIGURE_QUIET "${VTKm_FIND_QUIETLY}")
set(VTKm_FIND_PACKAGE_QUIETLY "")
......@@ -101,7 +100,14 @@ set(VTKm_COMPILE_OPTIONS "@VTKm_COMPILE_OPTIONS@")
set(VTKm_FIND_COMPONENTS "Base" ${VTKm_FIND_COMPONENTS})
set(VTKm_FIND_REQUIRED_Base TRUE)
if(NOT VTKm_FOUND)
# Clear out the libraries. We will add more when loading components.
set(VTKm_LIBRARIES)
# Load the selected components
@VTKm_LOAD_COMPONENTS_COMMANDS@
check_required_components(VTKm)
set(VTKm_FOUND TRUE)
endif()
......@@ -145,6 +145,8 @@ if (VTKm_ENABLE_CUDA)
message(SEND_ERROR "Could not load CUDA configuration. If CUDA is not available, turn off VTKm_ENABLE_CUDA.")
endif()
endif (VTKm_ENABLE_CUDA)
set(VTKm_FOUND TRUE)
#-----------------------------------------------------------------------------
......@@ -253,8 +255,8 @@ set(VTKm_${component}_FOUND)"
)
endforeach(component)
set(VTKm_LOAD_COMPONENTS_COMMANDS "${VTKm_LOAD_COMPONENTS_COMMANDS}
set(VTKm_LOAD_COMPONENTS_COMMANDS "${VTKm_LOAD_COMPONENTS_COMMANDS}
# Load each component selected in find_package
foreach(comp \${VTKm_FIND_COMPONENTS})")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment