Commit bcb347bf authored by Robert Maynard's avatar Robert Maynard Committed by Kitware Robot

Merge topic 'test_vtkm_install'

9580b192 Introduces SourceInInstall which verifies that VTK-m install its headers
c501500e Install missing headers found by VTKmCheckSourceInInstall
baaa47af Reduce verbosity of VTKmCheckCopyright
545a2ce9 VTKmCheckSourceInBuild now shows all missing files in a directory
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Matt Larsen's avatarMatt Larsen <larsen30@llnl.gov>
Merge-request: !1532
parents ba832202 9580b192
......@@ -234,7 +234,6 @@ foreach (glob_expression ${FILES_TO_CHECK})
endforeach(exception)
if (NOT skip)
message("Checking ${file}")
check_copyright("${VTKm_SOURCE_DIR}/${file}")
endif (NOT skip)
endforeach (file)
......
......@@ -35,7 +35,6 @@ set(FILES_TO_CHECK
)
set(EXCEPTIONS
kxsort.h
)
set(DIRECTORY_EXCEPTIONS
......@@ -62,6 +61,7 @@ function(check_directory directory parent_CMakeLists_contents)
file(READ "${directory}/CMakeLists.txt" CMakeLists_contents)
endif()
set(send_fatal_error FALSE)
foreach (glob_expression ${FILES_TO_CHECK})
file(GLOB file_list
RELATIVE "${directory}"
......@@ -78,7 +78,6 @@ function(check_directory directory parent_CMakeLists_contents)
endforeach(exception)
if(NOT skip)
message("Checking ${file}")
# Remove .in suffix. These are generally configured files that generate
# new files that are actually used in the build.
string(REGEX REPLACE ".in$" "" file_check "${file}")
......@@ -92,16 +91,21 @@ function(check_directory directory parent_CMakeLists_contents)
position
)
if(${position} LESS 0)
message(SEND_ERROR
message(STATUS
"****************************************************************
${file_check} is not found in ${directory}/CMakeLists.txt
This indicates that the file is not part of the build system. Thus it might be missing build targets. All such files should be explicitly handled by CMake.")
set(send_fatal_error True)
endif() # Not in parent's CMakeLists.txt
endif() # Not in CMakeLists.txt
endif() # Not skipped
endforeach (file)
endforeach(glob_expression)
if(send_fatal_error)
message(FATAL_ERROR "errors found in ${directory}")
endif()
file(GLOB file_list
LIST_DIRECTORIES true
"${directory}/*")
......
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##
## Copyright 2016 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
## Copyright 2016 UT-Battelle, LLC.
## Copyright 2016 Los Alamos National Security.
##
## Under the terms of Contract DE-NA0003525 with NTESS,
## the U.S. Government retains certain rights in this software.
##
## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
## Laboratory (LANL), the U.S. Government retains certain rights in
## this software.
##============================================================================
## This CMake script checks to make sure that each source file explicitly
## listed in the CMakeLists.txt is installed.
## To run this script, execute CMake as follows:
##
## cmake -DMODE=[INSTALL|VERIFY|CLEANUP]
# -DVTKm_SOURCE_DIR=<VTKm_SOURCE_DIR>
# -DVTKm_BINARY_DIR=<VTKm_BINARY_DIR>
# -DVTKm_INSTALL_INCLUDE_DIR=<VTKm_INSTALL_INCLUDE_DIR>
# -DVTKm_ENABLE_RENDERING=<VTKm_ENABLE_RENDERING>
# -DVTKm_ENABLE_LOGGING=<VTKm_ENABLE_LOGGING>
# -P <VTKm_SOURCE_DIR>/CMake/VTKMCheckSourceInBuild.cmake
##
if (NOT DEFINED MODE)
message(FATAL_ERROR "Need to pass the MODE variable (INSTALL|VERIFY|CLEANUP) so the script knows what to do")
endif ()
if (NOT VTKm_SOURCE_DIR)
message(FATAL_ERROR "VTKm_SOURCE_DIR not defined.")
endif ()
if (NOT VTKm_BINARY_DIR)
message(FATAL_ERROR "VTKm_BINARY_DIR not defined.")
endif ()
if (NOT VTKm_INSTALL_INCLUDE_DIR)
message(FATAL_ERROR "VTKm_INSTALL_INCLUDE_DIR not defined.")
endif ()
if (NOT DEFINED VTKm_ENABLE_RENDERING)
message(FATAL_ERROR "VTKm_ENABLE_RENDERING not defined.")
endif ()
if (NOT DEFINED VTKm_ENABLE_LOGGING)
message(FATAL_ERROR "VTKm_ENABLE_LOGGING not defined.")
endif ()
include(CMakeParseArguments)
# -----------------------------------------------------------------------------
function(verify_install_per_dir src_directory build_dir)
set(options )
set(oneValueArgs )
set(multiValueArgs EXTENSIONS FILE_EXCEPTIONS DIR_EXCEPTIONS)
cmake_parse_arguments(verify
"${options}" "${oneValueArgs}" "${multiValueArgs}"
${ARGN}
)
set(files_to_verify )
foreach(ext IN LISTS verify_EXTENSIONS)
file(GLOB_RECURSE listing
RELATIVE "${src_directory}"
"${src_directory}/${ext}"
)
list(APPEND files_to_verify ${listing})
endforeach()
#remove all files that are exempt
list(REMOVE_ITEM files_to_verify ${verify_FILE_EXCEPTIONS})
#remove all files inside directories that match
foreach(dir IN LISTS verify_DIR_EXCEPTIONS)
list(FILTER files_to_verify EXCLUDE REGEX "^${dir}")
endforeach()
set(to_fail FALSE) # error out after listing all missing headers
foreach(file IN LISTS files_to_verify)
if(NOT EXISTS ${build_dir}/${file})
message(STATUS "file: ${file} not installed \n\tWas expecting it to be at: ${build_dir}/${file}")
set(to_fail TRUE)
# else()
# message(STATUS "file: ${file} installed")
endif()
endforeach()
if(to_fail)
message(FATAL_ERROR "unable to find all headers in the install tree")
endif()
endfunction()
# -----------------------------------------------------------------------------
function(do_install root_dir prefix)
#Step 1. Setup up our new install prefix location
set(CMAKE_INSTALL_PREFIX ${root_dir}/${prefix})
#Step 2. Gather all the cmake_install.cmake files
file(GLOB_RECURSE install_files
LIST_DIRECTORIES False
RELATIVE "${root_dir}"
"${root_dir}/*/cmake_install.cmake")
#Step 3. Execute all the install files
if(EXISTS "${root_dir}/cmake_install.cmake")
include(${root_dir}/cmake_install.cmake)
endif()
foreach(file ${install_files})
include("${file}")
endforeach()
endfunction()
# -----------------------------------------------------------------------------
function(do_verify root_dir prefix)
#Step 1. Setup the extensions to check, and all file and directory
# extensions
set(files_extensions
*.hpp #needed for diy and taotuple
*.h
*.hxx
)
set(file_exceptions
cont/cuda/internal/testing/Testing.h
cont/ColorTablePrivate.hxx
)
# These exceptions should be based on the status of the associated
# cmake option
set(directory_exceptions )
if(NOT VTKm_ENABLE_RENDERING)
list(APPEND directory_exceptions rendering)
endif()
if(NOT VTKm_ENABLE_LOGGING)
list(APPEND directory_exceptions thirdparty/loguru)
endif()
#Step 2. Verify the installed files match what headers are listed in each
# source directory
verify_install_per_dir("${VTKm_SOURCE_DIR}/vtkm"
"${root_dir}/${prefix}/${VTKm_INSTALL_INCLUDE_DIR}/vtkm"
EXTENSIONS ${files_extensions}
FILE_EXCEPTIONS ${file_exceptions}
DIR_EXCEPTIONS ${directory_exceptions}
)
endfunction()
# -----------------------------------------------------------------------------
function(do_cleanup root_dir prefix)
#Step 1. Remove temp directory
file(REMOVE_RECURSE "${root_dir}/${prefix}")
endfunction()
set(root_dir "${VTKm_BINARY_DIR}")
set(prefix "/CMakeFiles/_tmp_install")
message(STATUS "MODE: ${MODE}")
if(MODE STREQUAL "INSTALL")
do_install(${root_dir} ${prefix})
elseif(MODE STREQUAL "VERIFY")
do_verify(${root_dir} ${prefix})
elseif(MODE STREQUAL "CLEANUP")
do_cleanup(${root_dir} ${prefix})
endif()
unset(prefix)
unset(root_dir)
......@@ -152,9 +152,6 @@ include(VTKmWrappers)
include(VTKmCompilerFlags)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
if (VTKm_ENABLE_TESTING)
enable_testing()
......@@ -171,24 +168,6 @@ if (VTKm_ENABLE_TESTING)
configure_file(${VTKm_SOURCE_DIR}/CTestCustom.cmake.in
${VTKm_BINARY_DIR}/CTestCustom.cmake @ONLY)
#-----------------------------------------------------------------------------
# Add "meta" tests that check the state of the repository
# SystemInformation prints out information about the current configuration
# CopyrightStatement checks that the copyright statement is in all source files
# SourceInBuild checks that all source files are listed in the build
add_test(NAME SystemInformation
COMMAND ${CMAKE_COMMAND} "-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}" "-DVTKm_BINARY_DIR=${VTKm_BINARY_DIR}" -P "${VTKm_SOURCE_DIR}/CMake/VTKmSystemInformation.cmake"
)
add_test(NAME CopyrightStatement
COMMAND ${CMAKE_COMMAND} "-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}" -P "${VTKm_SOURCE_DIR}/CMake/VTKmCheckCopyright.cmake"
)
# increase timeout since on some machines CopyrightStatement test takes a long time.
set_tests_properties(CopyrightStatement PROPERTIES TIMEOUT 300)
add_test(NAME SourceInBuild
COMMAND ${CMAKE_COMMAND} "-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}" -P "${VTKm_SOURCE_DIR}/CMake/VTKmCheckSourceInBuild.cmake"
)
#-----------------------------------------------------------------------------
# Find the Python interpreter, which we will use during the build process
find_package(PythonInterp QUIET)
......@@ -325,3 +304,63 @@ endif()
if(VTKm_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif(VTKm_ENABLE_EXAMPLES)
#-----------------------------------------------------------------------------
if (VTKm_ENABLE_TESTING)
#-----------------------------------------------------------------------------
# Add "meta" tests that check the state of the repository
# SystemInformation prints out information about the current configuration
# CopyrightStatement checks that the copyright statement is in all source files
# SourceInBuild checks that all source files are listed in the build
# SourceInInstall checks that all source files are installed in the build
add_test(NAME SystemInformation
COMMAND ${CMAKE_COMMAND} "-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}" "-DVTKm_BINARY_DIR=${VTKm_BINARY_DIR}" -P "${VTKm_SOURCE_DIR}/CMake/VTKmSystemInformation.cmake"
)
add_test(NAME CopyrightStatement
COMMAND ${CMAKE_COMMAND} "-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}" -P "${VTKm_SOURCE_DIR}/CMake/VTKmCheckCopyright.cmake"
)
# increase timeout since on some machines CopyrightStatement test takes a long time.
set_tests_properties(CopyrightStatement PROPERTIES TIMEOUT 300)
add_test(NAME SourceInBuild
COMMAND ${CMAKE_COMMAND} "-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}" -P "${VTKm_SOURCE_DIR}/CMake/VTKmCheckSourceInBuild.cmake"
)
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
set(command_args
"-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}"
"-DVTKm_BINARY_DIR=${VTKm_BINARY_DIR}"
"-DVTKm_INSTALL_INCLUDE_DIR=${VTKm_INSTALL_INCLUDE_DIR}"
"-DVTKm_ENABLE_RENDERING=${VTKm_ENABLE_RENDERING}"
"-DVTKm_ENABLE_LOGGING=${VTKm_ENABLE_LOGGING}"
)
#By having this as separate tests using fixtures, it will allow us in
#the future to write tests that build against the installed version
add_test(NAME TestInstallSetup
COMMAND ${CMAKE_COMMAND}
"-DMODE=INSTALL"
${command_args}
-P "${VTKm_SOURCE_DIR}/CMake/VTKmCheckSourceInInstall.cmake"
)
add_test(NAME SourceInInstall
COMMAND ${CMAKE_COMMAND}
"-DMODE=VERIFY"
${command_args}
-P "${VTKm_SOURCE_DIR}/CMake/VTKmCheckSourceInInstall.cmake"
)
add_test(NAME TestInstallCleanup
COMMAND ${CMAKE_COMMAND}
"-DMODE=CLEANUP"
${command_args}
-P "${VTKm_SOURCE_DIR}/CMake/VTKmCheckSourceInInstall.cmake"
)
set_tests_properties(TestInstallSetup PROPERTIES FIXTURES_SETUP vtkm_installed)
set_tests_properties(SourceInInstall PROPERTIES FIXTURES_REQUIRED vtkm_installed)
set_tests_properties(TestInstallCleanup PROPERTIES FIXTURES_CLEANUP vtkm_installed)
endif()
endif()
......@@ -126,6 +126,7 @@ set(template_sources
StorageAny.hxx
StorageBasic.hxx
StorageVirtual.hxx
VirtualObjectHandle.hxx
)
set(sources
......
......@@ -33,6 +33,5 @@ endif()
#-----------------------------------------------------------------------------
add_subdirectory(internal)
if(TARGET vtkm::cuda)
add_subdirectory(cuda)
endif()
#-----------------------------------------------------------------------------
add_subdirectory(cuda)
......@@ -83,6 +83,7 @@ set(headers
View1D.h
View2D.h
View3D.h
Wireframer.h
WorldAnnotator.h
)
......@@ -105,7 +106,6 @@ set(sources
MapperQuad.cxx
MapperRayTracer.cxx
MapperVolume.cxx
#MapperWireframer.cxx
Scene.cxx
TextAnnotation.cxx
TextAnnotationBillboard.cxx
......@@ -190,14 +190,16 @@ vtkm_library(
WRAP_FOR_CUDA ${device_sources}
)
# Install all headers no matter what backend was selected
vtkm_declare_headers(${opengl_headers})
vtkm_declare_headers(${osmesa_headers})
vtkm_declare_headers(${egl_headers})
if(VTKm_ENABLE_GL_CONTEXT)
vtkm_declare_headers(${opengl_headers})
target_sources(vtkm_rendering PRIVATE ${opengl_sources})
elseif(VTKm_ENABLE_OSMESA_CONTEXT)
vtkm_declare_headers(${opengl_headers} ${osmesa_headers})
target_sources(vtkm_rendering PRIVATE ${opengl_sources} ${osmesa_sources})
elseif(VTKm_ENABLE_EGL_CONTEXT)
vtkm_declare_headers(${opengl_headers} ${egl_headers})
target_sources(vtkm_rendering PRIVATE ${opengl_sources} ${egl_sources})
endif()
......
......@@ -115,11 +115,13 @@ set(sources_device
add_subdirectory(internal)
add_subdirectory(clip)
add_subdirectory(colorconversion)
add_subdirectory(connectivities)
add_subdirectory(contour)
add_subdirectory(contourtree)
add_subdirectory(contourtree_augmented)
add_subdirectory(cosmotools)
add_subdirectory(gradient)
add_subdirectory(histogram)
add_subdirectory(splatkernels)
add_subdirectory(spatialstructure)
add_subdirectory(tetrahedralize)
......
Markdown is supported
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