Skip to content

Commit

Permalink
itk: fix handling of expat dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Aug 21, 2024
1 parent 1499c54 commit 09004bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion recipes/itk/all/conan_cmake_project_include.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(ITKDoubleConversion_LIBRARIES double-conversion::double-conversion)

# https://github.com/InsightSoftwareConsortium/ITK/blob/v5.4rc01/Modules/ThirdParty/Expat/CMakeLists.txt
custom_find_package(EXPAT REQUIRED CONFIG)
set(ITKExpat_LIBRARIES EXPAT::EXPAT)
set(ITKExpat_LIBRARIES expat::expat)

# https://github.com/InsightSoftwareConsortium/ITK/blob/v5.4rc01/CMake/itkExternal_FFTW.cmake#L180
custom_find_package(FFTW REQUIRED CONFIG)
Expand Down
3 changes: 3 additions & 0 deletions recipes/itk/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ def _patch_sources(self):
"-DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}")
# Ensure that new versions don't introduce any vendored libs by accident
replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "include(ExternalProject)", "")
# Force the use of Conan Expat target
replace_in_file(self, os.path.join(self.source_folder, "Modules", "ThirdParty", "GIFTI", "src", "gifticlib", "CMakeLists.txt"),
"${ITKExpat_LIBRARIES}", "expat::expat")
# Truncate some third-party modules that are provided by conan_cmake_project_include.cmake
for pkg in ["DCMTK", "DoubleConversion", "GDCM"]:
save(self, os.path.join(self.source_folder, "Modules", "ThirdParty", pkg, "CMakeLists.txt"),
Expand Down

0 comments on commit 09004bd

Please sign in to comment.