Commit 5f71df3f authored by Lars Bilke's avatar Lars Bilke

[CMake] Correct linking to xdmf.

Reverted custom naming for xdmf libs.
Added Iconv as a dependency (dependency of libxml2).
parent ada3721f
......@@ -271,6 +271,7 @@ endif()
# xdmfdiff
if(EXISTS ${PROJECT_SOURCE_DIR}/ThirdParty/xdmfdiff/CMakeLists.txt AND BUILD_TESTING)
add_subdirectory(ThirdParty/xdmfdiff)
target_link_libraries(xdmfdiff Xdmf)
install(PROGRAMS $<TARGET_FILE:xdmfdiff> DESTINATION bin COMPONENT ogs_extras)
endif()
......
......@@ -26,7 +26,7 @@ ogs_add_library(MeshLib ${SOURCES})
target_link_libraries(
MeshLib
PUBLIC BaseLib GeoLib GitInfoLib MathLib ${VTK_LIBRARIES}
PUBLIC BaseLib GeoLib GitInfoLib MathLib ${VTK_LIBRARIES} Xdmf
PRIVATE spdlog::spdlog)
if(OGS_USE_MPI AND TARGET MPI::MPI_CXX)
......
......@@ -94,8 +94,16 @@ foreach(TARGET ${DISABLE_WARNINGS_TARGETS})
$<$<CXX_COMPILER_ID:MSVC>:/W0>)
endforeach()
set(XDMF_LIBNAME "ogs_xdmf" CACHE INTERNAL "")
find_package(ZLIB REQUIRED) # ZLIB is a HDF5 dependency
add_subdirectory(xdmf)
# ZLIB is HDF5 dependency
find_package(ZLIB REQUIRED)
target_link_libraries(ogs_xdmf ZLIB::ZLIB)
target_include_directories(Xdmf PUBLIC
${PROJECT_SOURCE_DIR}/ThirdParty/xdmf
${PROJECT_BINARY_DIR}/ThirdParty/xdmf
)
target_link_libraries(Xdmf Boost::boost ${Iconv_LIBRARIES} ZLIB::ZLIB)
target_include_directories(XdmfCore PUBLIC
${PROJECT_SOURCE_DIR}/ThirdParty/xdmf/core
${PROJECT_BINARY_DIR}/ThirdParty/xdmf/core
)
find_package(LibXml2 REQUIRED) # LibXml2 is a XdmfCore dependency
target_link_libraries(XdmfCore PUBLIC ${Iconv_LIBRARIES} LibXml2::LibXml2)
Subproject commit 8d5ae1e1cbf506b8ca2160745fc914e25690c8a4
Subproject commit 2b47639bd296d2e77443c34bcda700cbb388ec72
......@@ -191,3 +191,5 @@ endif()
find_package(Filesystem REQUIRED COMPONENTS Final Experimental)
configure_file(${PROJECT_SOURCE_DIR}/BaseLib/filesystem.h.in
${PROJECT_BINARY_DIR}/BaseLib/filesystem.h)
find_package(Iconv REQUIRED)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment