VTKm config module now properly support the QUIET flag.

The QUIET flag will also be properly propagated to all modules
that VTKm finds.
This commit is contained in:
Robert Maynard 2016-07-28 10:46:59 -04:00
parent 5e1b2e966d
commit e52f7628a7
4 changed files with 31 additions and 17 deletions

@ -157,6 +157,7 @@ set(Boost_FIND_VERSION ${BoostHeaders_FIND_VERSION})
set(Boost_FIND_VERSION_MAJOR ${BoostHeaders_FIND_VERSION_MAJOR})
set(Boost_FIND_VERSION_MINOR ${BoostHeaders_FIND_VERSION_MINOR})
set(Boost_FIND_VERSION_PATCH ${BoostHeaders_FIND_VERSION_PATCH})
set(Boost_FIND_QUIETLY ${BoostHeaders_FIND_QUIETLY})
set(Boost_DEBUG ${BoostHeaders_DEBUG})
# Check the version of Boost against the requested version.

@ -65,6 +65,13 @@ set(VTKm_ENABLE_TBB "@VTKm_ENABLE_TBB@")
set(VTKm_ENABLE_OPENGL_INTEROP "@VTKm_ENABLE_OPENGL_INTEROP@")
set(VTKm_BUILD_RENDERING "@VTKm_BUILD_RENDERING@")
# The VTKm variables used to configure components and packages silently.
set(VTKm_CONFIGURE_QUIET "${VTKm_FIND_QUIETLY}")
set(VTKm_FIND_PACKAGE_QUIETLY "")
if(VTKm_CONFIGURE_QUIET)
set(VTKm_FIND_PACKAGE_QUIETLY "QUIET")
endif()
# VTKm requires some CMake Find modules not included with CMake, so
# include the CMake modules distributed with VTKm.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${VTKm_CMAKE_MODULE_PATH})

@ -59,8 +59,10 @@ macro(vtkm_finish_configure_component component)
set(VTKm_${component}_FOUND TRUE)
foreach(var ${VTKm_FCC_DEPENDENT_VARIABLES})
if(NOT ${var})
message(STATUS "Failed to configure VTK-m component ${component}: !${var}")
set(VTKm_${component}_FOUND)
if(NOT VTKm_CONFIGURE_QUIET)
message(STATUS "Failed to configure VTK-m component ${component}: !${var}")
endif()
break()
endif()
endforeach(var)
@ -79,7 +81,7 @@ endmacro()
macro(vtkm_configure_component_Base)
# Find the Boost library.
if(NOT Boost_FOUND)
find_package(BoostHeaders ${VTKm_REQUIRED_BOOST_VERSION})
find_package(BoostHeaders ${VTKm_FIND_PACKAGE_QUIETLY} ${VTKm_REQUIRED_BOOST_VERSION})
endif()
vtkm_finish_configure_component(Base
@ -99,7 +101,7 @@ endmacro(vtkm_configure_component_Serial)
macro(vtkm_configure_component_OpenGL)
vtkm_configure_component_Base()
find_package(OpenGL)
find_package(OpenGL ${VTKm_FIND_PACKAGE_QUIETLY})
vtkm_finish_configure_component(OpenGL
DEPENDENT_VARIABLES VTKm_Base_FOUND OPENGL_FOUND
@ -112,14 +114,14 @@ macro(vtkm_configure_component_OSMesa)
vtkm_configure_component_OpenGL()
if (UNIX AND NOT APPLE)
find_package(MESA)
find_package(MESA ${VTKm_FIND_PACKAGE_QUIETLY})
vtkm_finish_configure_component(OSMesa
DEPENDENT_VARIABLES VTKm_OpenGL_FOUND OSMESA_FOUND
ADD_INCLUDES ${OSMESA_INCLUDE_DIR}
ADD_LIBRARIES ${OSMESA_LIBRARY}
)
else()
elseif(NOT VTKm_CONFIGURE_QUIET)
message(STATUS "OSMesa not supported on this platform.")
endif()
endmacro(vtkm_configure_component_OSMesa)
@ -127,7 +129,7 @@ endmacro(vtkm_configure_component_OSMesa)
macro(vtkm_configure_component_EGL)
vtkm_configure_component_OpenGL()
find_package(EGL)
find_package(EGL ${VTKm_FIND_PACKAGE_QUIETLY})
vtkm_finish_configure_component(EGL
DEPENDENT_VARIABLES VTKm_OpenGL_FOUND EGL_FOUND
@ -139,7 +141,7 @@ endmacro(vtkm_configure_component_EGL)
macro(vtkm_configure_component_Interop)
vtkm_configure_component_OpenGL()
find_package(GLEW)
find_package(GLEW ${VTKm_FIND_PACKAGE_QUIETLY})
set(vtkm_interop_dependent_vars
VTKm_OpenGL_FOUND
@ -149,7 +151,7 @@ macro(vtkm_configure_component_Interop)
#on unix/linux Glew uses pthreads, so we need to find that, and link to it
#explicitly or else in release mode we get sigsegv on launch
if (VTKm_Interop_FOUND AND UNIX)
find_package(Threads)
find_package(Threads ${VTKm_FIND_PACKAGE_QUIETLY})
set(vtkm_interop_dependent_vars ${vtkm_interop_dependent_vars} CMAKE_USE_PTHREADS_INIT)
endif()
@ -164,7 +166,7 @@ macro(vtkm_configure_component_TBB)
if(VTKm_ENABLE_TBB)
vtkm_configure_component_Base()
find_package(TBB)
find_package(TBB ${VTKm_FIND_PACKAGE_QUIETLY})
endif()
vtkm_finish_configure_component(TBB
@ -178,7 +180,7 @@ macro(vtkm_configure_component_CUDA)
if(VTKm_ENABLE_CUDA)
vtkm_configure_component_Base()
find_package(CUDA)
find_package(CUDA ${VTKm_FIND_PACKAGE_QUIETLY})
mark_as_advanced(
CUDA_BUILD_CUBIN
CUDA_BUILD_EMULATION
@ -189,7 +191,7 @@ macro(vtkm_configure_component_CUDA)
CUDA_VERBOSE_BUILD
)
find_package(Thrust)
find_package(Thrust ${VTKm_FIND_PACKAGE_QUIETLY})
endif()
vtkm_finish_configure_component(CUDA
@ -257,9 +259,11 @@ macro(vtkm_configure_component_CUDA)
string(SUBSTRING "${run_output}" ${position} -1 run_output)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${run_output}")
else()
message(STATUS "Unable to run \"${CUDA_NVCC_EXECUTABLE}\" to autodetect GPU architecture."
"Falling back to fermi, please manually specify if you want something else.")
set(VTKm_CUDA_Architecture "fermi")
if(NOT VTKm_CONFIGURE_QUIET)
message(STATUS "Unable to run \"${CUDA_NVCC_EXECUTABLE}\" to autodetect GPU architecture."
"Falling back to fermi, please manually specify if you want something else.")
endif()
endif()
endif()

@ -246,12 +246,12 @@ foreach(component ${VTKm_AVAILABLE_COMPONENTS})
set(VTKm_LOAD_COMPONENTS_COMMANDS "${VTKm_LOAD_COMPONENTS_COMMANDS}
if(\"${component}\" STREQUAL \${comp})
vtkm_configure_component_${component}()
if(VTKm_${component}_FOUND)
if(VTKm_${component}_FOUND AND NOT VTKm_CONFIGURE_QUIET)
message(STATUS \"Successfully loaded VTK-m component ${component}\")
else()
if(VTKm_FIND_REQUIRED_${component})
if(VTKm_FIND_REQUIRED_${component} AND NOT VTKm_CONFIGURE_QUIET)
message(\"Could not load REQUIRED VTK-m component ${component}\")
else()
elseif(NOT VTKm_CONFIGURE_QUIET)
message(STATUS \"Could not load optional VTK-m component ${component}\")
endif()
endif()
@ -261,7 +261,9 @@ foreach(component ${VTKm_AVAILABLE_COMPONENTS})
endforeach()
set(VTKm_LOAD_COMPONENTS_COMMANDS "${VTKm_LOAD_COMPONENTS_COMMANDS}
message(WARNING \"No such VTK-m component: \${comp}\")
if(NOT VTKm_CONFIGURE_QUIET)
message(WARNING \"No such VTK-m component: \${comp}\")
endif()
endforeach()" )
configure_package_config_file(