Add template sources to built library
Previously there was a special build for the template source files (.hxx) that installed them but did not create the test builds (because they cannot be built outside of their enclosing .h file). It also added an entry into the IDE that let them show up on the file list. However, because they were not explicitly built as part of something actually compiled, they did not have an compile options associated with them. This caused confusion in some IDEs where it could not find the header files it included, which made it more frustrating to edit them.
This commit is contained in:
parent
22f38ecc43
commit
0d2309aba3
@ -195,16 +195,6 @@ function(vtkm_install_headers dir_prefix)
|
||||
)
|
||||
endfunction(vtkm_install_headers)
|
||||
|
||||
function(vtkm_install_template_sources)
|
||||
vtkm_get_kit_name(name dir_prefix)
|
||||
set(hfiles ${ARGN})
|
||||
vtkm_install_headers("${dir_prefix}" ${hfiles})
|
||||
# CMake does not add installed files as project files, and template sources
|
||||
# are not declared as source files anywhere, add a fake target here to let
|
||||
# an IDE know that these sources exist.
|
||||
add_custom_target(${name}_template_srcs SOURCES ${hfiles})
|
||||
endfunction(vtkm_install_template_sources)
|
||||
|
||||
# Declare a list of headers that require thrust to be enabled
|
||||
# for them to header tested. In cases of thrust version 1.5 or less
|
||||
# we have to make sure openMP is enabled, otherwise we are okay
|
||||
@ -233,7 +223,7 @@ endfunction(vtkm_requires_thrust_to_test)
|
||||
function(vtkm_declare_headers)
|
||||
set(options CUDA)
|
||||
set(oneValueArgs TESTABLE)
|
||||
set(multiValueArgs)
|
||||
set(multiValueArgs EXCLUDE_FROM_TESTING)
|
||||
cmake_parse_arguments(VTKm_DH "${options}"
|
||||
"${oneValueArgs}" "${multiValueArgs}"
|
||||
${ARGN}
|
||||
@ -247,11 +237,15 @@ function(vtkm_declare_headers)
|
||||
set(VTKm_DH_TESTABLE ON)
|
||||
endif()
|
||||
|
||||
set(hfiles ${VTKm_DH_UNPARSED_ARGUMENTS})
|
||||
set(hfiles ${VTKm_DH_UNPARSED_ARGUMENTS} ${VTKm_DH_EXCLUDE_FROM_TESTING})
|
||||
vtkm_get_kit_name(name dir_prefix)
|
||||
|
||||
#only do header testing if enable testing is turned on
|
||||
if (VTKm_ENABLE_TESTING AND VTKm_DH_TESTABLE)
|
||||
set_source_files_properties(${VTKm_DH_EXCLUDE_FROM_TESTING}
|
||||
PROPERTIES VTKm_CANT_BE_HEADER_TESTED TRUE
|
||||
)
|
||||
|
||||
vtkm_add_header_build_test(
|
||||
"${name}" "${dir_prefix}" "${VTKm_DH_CUDA}" ${hfiles})
|
||||
endif()
|
||||
|
@ -102,9 +102,9 @@ set(header_template_sources
|
||||
VertexClustering.hxx
|
||||
)
|
||||
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
vtkm_install_template_sources(${header_template_sources})
|
||||
vtkm_declare_headers(${headers}
|
||||
EXCLUDE_FROM_TESTING ${header_template_sources}
|
||||
)
|
||||
|
||||
add_subdirectory(internal)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user