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.
This commit is contained in:
Kenneth Moreland 2019-03-20 10:29:03 -06:00
parent 184fe79298
commit 7237c46898
5 changed files with 84 additions and 2951 deletions

@ -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()