Skip to content
Snippets Groups Projects
Verified Commit 14aaa12e authored by Lars Bilke's avatar Lars Bilke
Browse files

[CMake] Rename xdmf libs to avoid clash with vtk xdmf.

parent 34c35474
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ ogs_add_library(MeshLib ${SOURCES})
target_link_libraries(
MeshLib
PUBLIC BaseLib GeoLib GitInfoLib MathLib ${VTK_LIBRARIES} Xdmf
PUBLIC BaseLib GeoLib GitInfoLib MathLib ${VTK_LIBRARIES} OgsXdmf
PRIVATE spdlog::spdlog)
if(OGS_USE_MPI AND TARGET MPI::MPI_CXX)
......
add_executable(xdmfdiff xdmfdiff.cpp)
target_link_libraries(xdmfdiff Xdmf std::filesystem)
target_link_libraries(xdmfdiff OgsXdmf std::filesystem)
install(PROGRAMS $<TARGET_FILE:xdmfdiff> DESTINATION bin COMPONENT ogs_extras)
......@@ -95,18 +95,28 @@ foreach(TARGET ${DISABLE_WARNINGS_TARGETS})
endforeach()
find_package(ZLIB REQUIRED) # ZLIB is a HDF5 dependency
set(XDMF_LIBNAME OgsXdmf CACHE INTERNAL "")
add_subdirectory(xdmf)
target_include_directories(Xdmf PUBLIC
target_include_directories(${XDMF_LIBNAME} PUBLIC
${PROJECT_SOURCE_DIR}/ThirdParty/xdmf
${PROJECT_BINARY_DIR}/ThirdParty/xdmf
)
if(OGS_USE_CONAN AND UNIX AND APPLE)
find_package(Iconv REQUIRED)
endif()
target_link_libraries(Xdmf Boost::boost ${Iconv_LIBRARIES} ZLIB::ZLIB)
target_include_directories(XdmfCore PUBLIC
target_link_libraries(${XDMF_LIBNAME} Boost::boost ${Iconv_LIBRARIES} ZLIB::ZLIB)
target_include_directories(${XDMF_LIBNAME}Core 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 LibXml2::LibXml2)
target_link_libraries(${XDMF_LIBNAME}Core PUBLIC LibXml2::LibXml2)
set_target_properties(${XDMF_LIBNAME} ${XDMF_LIBNAME}Core PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}
LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
)
if(BUILD_SHARED_LIBS)
install(TARGETS ${XDMF_LIBNAME} ${XDMF_LIBNAME}Core LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
Subproject commit 2b47639bd296d2e77443c34bcda700cbb388ec72
Subproject commit 79807fd005f3ce7e59c805e6c2382b81915998a1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment