Fix config issues with headers and libraries

There were a couple of places where the configure scripts did not add
either includes to VTKm_INCLUDE_DIRS or libraries to VTKm_LIBRARIES.

The biggest offender was when the examples used find_package to load the
VTK-m configuration it needed. find_package cleared out the includes and
libraries, but it did not clear out the VTKm_<COMPONENT>_FOUND
variables. Normally, these variables would not be set before
find_package is called, but in this case the examples were called after
some partial configuration. I got around this issue by clearing out all
the *_FOUND variables in VTKmConfig.cmake.
This commit is contained in:
Kenneth Moreland 2016-08-23 14:07:38 -06:00
parent 7ece97bb87
commit 866c617cbf
12 changed files with 49 additions and 56 deletions

@ -52,6 +52,9 @@ if(VTKm_PACKAGE_IN_BUILD)
set(VTKm_INCLUDE_DIRS ${VTKm_INCLUDE_DIRS} "@VTKm_SOURCE_DIR@")
endif()
# Clear out the libraries. We will add more when loading components.
set(VTKm_LIBRARIES)
set(VTKm_REQUIRED_BOOST_VERSION "@VTKm_REQUIRED_BOOST_VERSION@")
if(NOT VTKm_PACKAGE_IN_BUILD)

@ -243,7 +243,16 @@ string(REPLACE ";" " " VTKm_AVAILABLE_COMPONENTS_LIST
"${VTKm_AVAILABLE_COMPONENTS}"
)
set(VTKm_LOAD_COMPONENTS_COMMANDS "
set(VTKm_LOAD_COMPONENTS_COMMANDS "# Clear out old FOUND flags")
foreach(component ${VTKm_AVAILABLE_COMPONENTS})
set(VTKm_LOAD_COMPONENTS_COMMANDS "${VTKm_LOAD_COMPONENTS_COMMANDS}
set(VTKm_${component}_FOUND)"
)
endforeach(component)
set(VTKm_LOAD_COMPONENTS_COMMANDS "${VTKm_LOAD_COMPONENTS_COMMANDS}
# Load each component selected in find_package
foreach(comp \${VTKm_FIND_COMPONENTS})")
foreach(component ${VTKm_AVAILABLE_COMPONENTS})

@ -20,11 +20,10 @@
##
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
find_package(VTKm REQUIRED QUIET
COMPONENTS Base
OPTIONAL_COMPONENTS Serial Cuda TBB
)
add_executable(Clipping_SERIAL Clipping.cxx)
target_include_directories(Clipping_SERIAL PRIVATE ${VTKm_INCLUDE_DIRS})

@ -21,15 +21,10 @@
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
#configure the backend components
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
#configure the OSMesa component
vtkm_configure_component_OSMESA()
find_package(VTKm QUIET REQUIRED
COMPONENTS Base
OPTIONAL_COMPONENTS Serial Cuda TBB OSMesa
)
if(VTKm_OSMesa_FOUND)

@ -21,16 +21,10 @@
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
#configure the backend components
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
#configure the rendering / interop components
vtkm_configure_component_OpenGL()
vtkm_configure_component_Interop()
find_package(VTKm REQUIRED QUIET
COMPONENTS Base
OPTIONAL_COMPONENTS Serial Cuda TBB OpenGL Interop
)
find_package(GLUT)

@ -21,12 +21,10 @@
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_OpenGL()
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
find_package(VTKm REQUIRED QUIET
COMPONENTS Base
OPTIONAL_COMPONENTS Serial Cuda TBB OpenGL
)
find_package(GLUT)

@ -21,12 +21,10 @@
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
#configure the backend components
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
find_package(VTKm REQUIRED QUIET
COMPONENTS Base
OPTIONAL_COMPONENTS Serial Cuda TBB
)
if(VTKm_CUDA_FOUND)
# Cuda compiles do not respect target_include_directories

@ -21,10 +21,10 @@
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_OpenGL()
vtkm_configure_component_Serial()
find_package(VTKm REQUIRED QUIET
COMPONENTS Base
OPTIONAL_COMPONENTS Serial OpenGL
)
find_package(GLUT)

@ -21,12 +21,10 @@
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_OpenGL()
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
find_package(VTKm REQUIRED QUIET
COMPONENTS Base
OPTIONAL_COMPONENTS Serial Cuda TBB OpenGL
)
find_package(GLUT)

@ -21,12 +21,10 @@
##=============================================================================
#Find the VTK-m package
find_package(VTKm QUIET REQUIRED COMPONENTS Base)
vtkm_configure_component_OpenGL()
vtkm_configure_component_Serial()
vtkm_configure_component_CUDA()
vtkm_configure_component_TBB()
find_package(VTKm REQUIRED QUIET
COMPONENTS Base
OPTIONAL_COMPONENTS Serial Cuda TBB OpenGL
)
find_package(GLUT)

@ -18,8 +18,6 @@
## this software.
##============================================================================
include_directories(${Boost_INCLUDE_DIRS})
set(headers
Assert.h
BinaryPredicates.h

@ -29,7 +29,10 @@ set(unit_tests
)
# Need glut for these tests
if(GLUT_FOUND)
if(VTKm_ENABLE_OPENGL_TESTS)
list(APPEND VTKm_INCLUDE_DIRS ${GLUT_INCLUDE_DIR} )
list(APPEND VTKm_LIBRARIES ${GLUT_LIBRARIES} )
vtkm_declare_headers(${headers})
vtkm_unit_tests(SOURCES ${unit_tests})