Skip to content

Commit 20fd88b

Browse files
committed
ENH: itkexpat: Update includes to reliably use ITK's expat headers
1 parent 8ec19eb commit 20fd88b

6 files changed

Lines changed: 39 additions & 6 deletions

File tree

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
{

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/itkexpat
16-
${ITKExpat_SOURCE_DIR}/src/itkexpat/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: 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

Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcm_expat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* Use the expat library configured for gdcm. */
1818
#include "gdcmTypes.h"
1919
#ifdef GDCM_USE_SYSTEM_EXPAT
20-
# include "expat.h"
20+
# include "itk_expat.h"
2121
#else
2222
# include "gdcmexpat/lib/expat.h"
2323
#endif

Modules/ThirdParty/GIFTI/src/gifticlib/gifti_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define GIFTI_IO_H
33

44
#include <itk_zlib.h>
5-
#include <expat.h>
5+
#include <itk_expat.h>
66
#include <nifti1_io.h>
77

88
#ifdef __cplusplus

0 commit comments

Comments
 (0)