VTKm_INSTALL_ONLY_LIBRARIES allows installation of only vtk-m libs

This commit is contained in:
Robert Maynard 2018-01-02 11:06:40 -05:00
parent d07ab6bc4a
commit 5e1f7c60ad
6 changed files with 87 additions and 59 deletions

@ -180,4 +180,6 @@ if(NOT VTKm_Vectorization_flags_added)
target_compile_options(vtkm_vectorization_flags INTERFACE ${flags})
endif()
install(TARGETS vtkm_vectorization_flags EXPORT ${VTKm_EXPORT_NAME})
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(TARGETS vtkm_vectorization_flags EXPORT ${VTKm_EXPORT_NAME})
endif()

@ -117,4 +117,6 @@ elseif(VTKM_COMPILER_IS_GNU OR VTKM_COMPILER_IS_CLANG)
)
endif()
install(TARGETS vtkm_compiler_flags vtkm_developer_flags EXPORT ${VTKm_EXPORT_NAME})
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(TARGETS vtkm_compiler_flags vtkm_developer_flags EXPORT ${VTKm_EXPORT_NAME})
endif()

@ -73,17 +73,21 @@ function(vtkm_generate_export_header lib_name)
${VTKm_BINARY_DIR}/include/${dir_prefix}/${kit_name}_export.h
@ONLY)
install(FILES ${VTKm_BINARY_DIR}/include/${dir_prefix}/${kit_name}_export.h
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR}/${dir_prefix}
)
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(FILES ${VTKm_BINARY_DIR}/include/${dir_prefix}/${kit_name}_export.h
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR}/${dir_prefix}
)
endif()
endfunction(vtkm_generate_export_header)
function(vtkm_install_headers dir_prefix)
set(hfiles ${ARGN})
install(FILES ${hfiles}
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR}/${dir_prefix}
)
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
set(hfiles ${ARGN})
install(FILES ${hfiles}
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR}/${dir_prefix}
)
endif()
endfunction(vtkm_install_headers)

@ -83,8 +83,15 @@ option(VTKm_ENABLE_EXAMPLES "Build examples" OFF)
option(VTKm_USE_DOUBLE_PRECISION "Use double precision for floating point calculations" OFF)
option(VTKm_USE_64BIT_IDS "Use 64-bit indices." ON)
# When VTK-m is embedded into larger projects they may desire to turn off
# VTK-m internal assert checks when in debug mode to improve debug runtime
# performance.
option(VTKm_NO_ASSERT "Disable assertions in debugging builds." OFF)
mark_as_advanced(VTKm_NO_ASSERT)
# When VTK-m is embedded into larger projects that wish to make end user
# applications they want to only install libraries and don't want CMake/headers
# installed.
option(VTKm_INSTALL_ONLY_LIBRARIES "install only vtk-m libraries and no headers" OFF)
# VTK-m is setup by default not to export symbols unless explicitly stated.
# We prefer to only export symbols of a small set of user facing classes,
@ -92,7 +99,12 @@ mark_as_advanced(VTKm_NO_ASSERT)
# which require static builds can force all symbols on, which is something
# VTK does.
option(VTKm_USE_DEFAULT_SYMBOL_VISIBILITY "Don't explicitly hide symbols from libraries." OFF)
mark_as_advanced(VTKm_USE_DEFAULT_SYMBOL_VISIBILITY)
mark_as_advanced(
VTKm_NO_ASSERT
VTKm_INSTALL_ONLY_LIBRARIES
VTKm_USE_DEFAULT_SYMBOL_VISIBILITY
)
option(BUILD_SHARED_LIBS "Build VTK-m with shared libraries" ON)
set(VTKm_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
@ -220,49 +232,52 @@ write_basic_package_version_file(
${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR}/VTKmConfigVersion.cmake
VERSION ${VTKm_VERSION}
COMPATIBILITY ExactVersion )
install(
FILES
${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR}/VTKmConfig.cmake
${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR}/VTKmConfigVersion.cmake
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
)
# Install the readme and license files.
install(FILES ${VTKm_SOURCE_DIR}/README.md
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
RENAME VTKmREADME.md
)
install(FILES ${VTKm_SOURCE_DIR}/LICENSE.txt
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
RENAME VTKmLICENSE.txt
)
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(
FILES
${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR}/VTKmConfig.cmake
${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR}/VTKmConfigVersion.cmake
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
)
# Install helper configure files.
install(
FILES
${VTKm_SOURCE_DIR}/CMake/FindTBB.cmake
${VTKm_SOURCE_DIR}/CMake/FindOpenGL.cmake
DESTINATION ${VTKm_INSTALL_CMAKE_MODULE_DIR}
)
# Install the readme and license files.
install(FILES ${VTKm_SOURCE_DIR}/README.md
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
RENAME VTKmREADME.md
)
install(FILES ${VTKm_SOURCE_DIR}/LICENSE.txt
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
RENAME VTKmLICENSE.txt
)
# Install support files.
install(
FILES
${VTKm_SOURCE_DIR}/CMake/VTKmWrappers.cmake
${VTKm_SOURCE_DIR}/CMake/VTKmBackends.cmake
${VTKm_SOURCE_DIR}/CMake/VTKmRenderingContexts.cmake
${VTKm_SOURCE_DIR}/CMake/VTKmExportHeaderTemplate.h.in
DESTINATION ${VTKm_INSTALL_CMAKE_MODULE_DIR}
)
# Install helper configure files.
install(
FILES
${VTKm_SOURCE_DIR}/CMake/FindTBB.cmake
${VTKm_SOURCE_DIR}/CMake/FindOpenGL.cmake
DESTINATION ${VTKm_INSTALL_CMAKE_MODULE_DIR}
)
# Create and install exports for external projects
export(EXPORT ${VTKm_EXPORT_NAME}
FILE ${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR}/VTKmTargets.cmake
)
install(EXPORT ${VTKm_EXPORT_NAME}
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
FILE VTKmTargets.cmake
)
# Install support files.
install(
FILES
${VTKm_SOURCE_DIR}/CMake/VTKmWrappers.cmake
${VTKm_SOURCE_DIR}/CMake/VTKmBackends.cmake
${VTKm_SOURCE_DIR}/CMake/VTKmRenderingContexts.cmake
${VTKm_SOURCE_DIR}/CMake/VTKmExportHeaderTemplate.h.in
DESTINATION ${VTKm_INSTALL_CMAKE_MODULE_DIR}
)
# Create and install exports for external projects
export(EXPORT ${VTKm_EXPORT_NAME}
FILE ${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR}/VTKmTargets.cmake
)
install(EXPORT ${VTKm_EXPORT_NAME}
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
FILE VTKmTargets.cmake
)
endif()
# Enable CPack packaging
set(CPACK_PACKAGE_DESCRIPTION_FILE ${VTKm_SOURCE_DIR}/README.md)

@ -52,14 +52,16 @@ if(MPI_CXX_COMPILE_DEFNITIONS)
$<$<COMPILE_LANGUAGE:CXX>:${MPI_CXX_COMPILE_DEFNITIONS>)
endif()
install(TARGETS diy
EXPORT ${VTKm_EXPORT_NAME})
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(TARGETS diy
EXPORT ${VTKm_EXPORT_NAME})
# Install headers
install(DIRECTORY include/diy
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR})
# Install headers
install(DIRECTORY include/diy
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR})
# Install other files.
install(FILES LEGAL.txt LICENSE.txt
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR}/diy
)
# Install other files.
install(FILES LEGAL.txt LICENSE.txt
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR}/diy
)
endif()

@ -200,9 +200,12 @@ endif()
#-----------------------------------------------------------------------------
include(VTKmRenderingContexts)
target_link_libraries(vtkm_rendering PUBLIC vtkm_rendering_gl_context)
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(TARGETS vtkm_rendering_gl_context
EXPORT ${VTKm_EXPORT_NAME}
)
endif()
#-----------------------------------------------------------------------------
add_subdirectory(internal)