Merge branch 'optionparser-to-third-party' into 'master'

Wrap third party optionparser.h in vtkm/cont/internal/OptionParser.h

See merge request vtk/vtk-m!1593
This commit is contained in:
Robert Maynard 2019-04-01 10:56:01 -04:00
commit e787d52afc
8 changed files with 2968 additions and 2951 deletions

1
.gitattributes vendored

@ -15,3 +15,4 @@ data/* filter=lfs diff=lfs merge=lfs -text
*.txt whitespace=tab-in-indent
vtkm/thirdparty/diy/vtkmdiy/** -format.clang-format -whitespace
vtkm/thirdparty/optionparser/vtkmoptionparser/** -format.clang-format -whitespace

@ -0,0 +1,13 @@
# Wrap third party optionparser.h in vtkm/cont/internal/OptionParser.h
Previously we just took the optionparser.h file and stuck it right in
our source code. That was problematic for a variety of reasons.
1. It incorrectly assigned our license to external code.
2. It made lots of unnecessary changes to the original source (like
reformatting).
3. It made it near impossible to track patches we make and updates to
the original software.
Instead, use the third-party system to track changes to optionparser.h
in a different repository and then pull that into ours.

@ -81,6 +81,7 @@ vtkm_declare_headers(
#-----------------------------------------------------------------------------
#first add all the components vtkm that are shared between control and exec
add_subdirectory(thirdparty/diy)
add_subdirectory(thirdparty/optionparser)
add_subdirectory(thirdparty/taotuple)
if(VTKm_ENABLE_LOGGING)
add_subdirectory(thirdparty/loguru)

@ -205,9 +205,10 @@ if (VTKm_ENABLE_LOGGING)
list(APPEND DL_LIBS ${CMAKE_DL_LIBS} Threads::Threads) # dladdr function
endif()
target_link_libraries(vtkm_cont PUBLIC vtkm_compiler_flags ${backends} ${DL_LIBS})
target_link_libraries(vtkm_cont PUBLIC vtkm_taotuple vtkm_optionparser)
if(TARGET vtkm_diy)
# This will become a required dependency eventually.
target_link_libraries(vtkm_cont PUBLIC vtkm_diy vtkm_taotuple)
target_link_libraries(vtkm_cont PUBLIC vtkm_diy)
endif()
#-----------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff

@ -0,0 +1,37 @@
##=============================================================================
##
## 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 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
## Copyright 2019 UT-Battelle, LLC.
## Copyright 2019 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.
##
##=============================================================================
add_library(vtkm_optionparser INTERFACE)
vtkm_get_kit_name(kit_name kit_dir)
target_include_directories(vtkm_optionparser INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${VTKm_INSTALL_INCLUDE_DIR}/vtkm/thirdparty/optionparser>)
install(TARGETS vtkm_optionparser
EXPORT ${VTKm_EXPORT_NAME})
## Install headers
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(DIRECTORY vtkmoptionparser
DESTINATION ${VTKm_INSTALL_INCLUDE_DIR}/${kit_dir}/)
endif()

25
vtkm/thirdparty/optionparser/update.sh vendored Executable file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -e
set -x
shopt -s dotglob
readonly name="optionparser"
readonly ownership="Lean Mean C++ Option Parser Upstream <kwrobot@kitware.com>"
readonly subtree="vtkm/thirdparty/$name/vtkm$name"
readonly repo="https://gitlab.kitware.com/third-party/$name.git"
readonly tag="for/vtk-m"
readonly paths="
src/optionparser.h
"
extract_source () {
git_archive
# The archive has sources in a src directory, but it is a header-only
# library. Just put the headers in the base directory for easier include.
mv "${extractdir}/${name}-reduced/src"/* "${extractdir}/${name}-reduced"
rmdir "${extractdir}/${name}-reduced/src"
}
. "${BASH_SOURCE%/*}/../update-common.sh"

File diff suppressed because it is too large Load Diff