Skip to content

Commit 31744be

Browse files
authored
Merge pull request #5531 from bradking/update-expat
Add script to import expat from upstream. Re-import expat 2.7.2 from upstream using our modern history structure.
2 parents 0f93d6c + 033b171 commit 31744be

34 files changed

+75
-7
lines changed

Modules/IO/XML/src/itkDOMNodeXMLReader.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*=========================================================================*/
1818

1919
#include "itkDOMNodeXMLReader.h"
20-
#include "expat.h"
20+
#include "itk_expat.h"
2121

2222
#include <fstream>
2323

Modules/IO/XML/src/itkXMLFile.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "itksys/SystemTools.hxx"
2020
#include "itkMakeUniqueForOverwrite.h"
2121
#include <fstream>
22-
#include "expat.h"
22+
#include "itk_expat.h"
2323

2424
namespace itk
2525
{
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/itkexpat/lib/xmlparse.c hooks-max-size=500000

Modules/ThirdParty/Expat/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ if(ITK_USE_SYSTEM_EXPAT)
1212
set(ITKExpat_NO_SRC 1)
1313
else()
1414
set(ITKExpat_INCLUDE_DIRS
15-
${ITKExpat_BINARY_DIR}/src/expat
16-
${ITKExpat_SOURCE_DIR}/src/expat/lib
15+
${ITKExpat_BINARY_DIR}/src
16+
${ITKExpat_BINARY_DIR}/src/itkexpat
17+
${ITKExpat_SOURCE_DIR}/src
1718
)
1819
set(ITKExpat_LIBRARIES ITKEXPAT)
1920
set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE)
2021
set(EXPAT_GE ON CACHE BOOL "Define to make general entity parsing functionality available" FORCE)
2122
set(XML_GE 1 CACHE STRING "Define to make general entity parsing functionality available" FORCE)
2223
endif()
2324

25+
configure_file(src/itk_expat.h.in src/itk_expat.h)
26+
2427
itk_module_impl()
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -x
5+
shopt -s dotglob
6+
7+
readonly name="expat"
8+
readonly ownership="Expat Upstream <[email protected]>"
9+
readonly subtree="Modules/ThirdParty/Expat/src/itk$name"
10+
readonly repo="https://github.com/libexpat/libexpat.git"
11+
readonly tag="R_2_7_2"
12+
readonly paths="
13+
expat/CMakeLists.txt
14+
expat/ConfigureChecks.cmake
15+
expat/COPYING
16+
expat/expat_config.h.cmake
17+
18+
expat/lib/*.h
19+
expat/lib/*.c
20+
"
21+
22+
extract_source () {
23+
git_archive
24+
pushd "${extractdir}/${name}-reduced"
25+
echo "* -whitespace" >> .gitattributes
26+
mv expat/* .
27+
rmdir expat
28+
fromdos ConfigureChecks.cmake CMakeLists.txt expat_config.h.cmake
29+
chmod a-x ConfigureChecks.cmake CMakeLists.txt expat_config.h.cmake
30+
popd
31+
}
32+
33+
. "${BASH_SOURCE%/*}/../../../Utilities/Maintenance/update-third-party.bash"

Modules/ThirdParty/Expat/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set(ITK3P_INSTALL_INCLUDE_DIR "${ITKExpat_INSTALL_INCLUDE_DIR}")
33
set(ITK3P_INSTALL_RUNTIME_DIR "${ITKExpat_INSTALL_RUNTIME_DIR}")
44
set(ITK3P_INSTALL_LIBRARY_DIR "${ITKExpat_INSTALL_LIBRARY_DIR}")
55
set(ITK3P_INSTALL_ARCHIVE_DIR "${ITKExpat_INSTALL_ARCHIVE_DIR}")
6-
add_subdirectory(expat)
6+
add_subdirectory(itkexpat)
77
itk_module_target(ITKEXPAT NO_INSTALL)
88
mark_as_advanced(FORCE
99
EXPAT_BUILD_DOCS
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*=========================================================================
2+
*
3+
* Copyright NumFOCUS
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0.txt
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*=========================================================================*/
18+
19+
#ifndef itk_expat_h
20+
#define itk_expat_h
21+
22+
/* Use the expat library configured for ITK. */
23+
#cmakedefine ITK_USE_SYSTEM_EXPAT
24+
#ifdef ITK_USE_SYSTEM_EXPAT
25+
# include <expat.h>
26+
#else
27+
# include "itkexpat/lib/expat.h"
28+
#endif
29+
30+
#endif
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* -whitespace

0 commit comments

Comments
 (0)