Commit 8816034b authored by Ben Boeckel's avatar Ben Boeckel

cmake: use public/private linking from XdmfCore

parent 3114fa3d
......@@ -59,7 +59,6 @@ find_package(TIFF)
if (TIFF_FOUND)
add_definitions(-DXDMF_BUILD_TIFF)
include_directories(${TIFF_INCLUDE_DIR})
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${TIFF_LIBRARIES})
endif (TIFF_FOUND)
# Test for DSM
......@@ -69,7 +68,6 @@ if(XDMF_BUILD_DSM)
find_package(MPI REQUIRED)
if(MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
# intel compiler requires an extra tag for CXX_FLAGS in order to properly build
STRING(REGEX MATCH "icpc" IS_INTEL "${CMAKE_CXX_COMPILER}")
if (NOT "${IS_INTEL}" STREQUAL "")
......
......@@ -53,7 +53,6 @@ if(HDF5_FOUND)
find_package(MPI REQUIRED)
if(MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
endif()
endif ()
endif()
......@@ -62,7 +61,6 @@ if(HDF5_FOUND)
if (NOT HDF5_LIBRARIES)
find_library (HDF5_LIBRARIES hdf5 HINTS ${HDF5_ROOT} ENV LD_LIBRARY_PATH)
endif ()
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${HDF5_LIBRARIES})
set(XDMF_HDF5_BINARY_DIRS ${HDF5_BINARY_DIRS} PARENT_SCOPE)
set(XDMF_BINARIES ${XDMF_BINARIES} ${HDF5_BINARY_DIRS})
endif()
......@@ -77,7 +75,6 @@ if(LIBXML2_FOUND)
get_filename_component(LIBXML2_ROOT "${LIBXML2_INCLUDE_DIR}/../" REALPATH)
set(LIBXML2_BINARY_DIRS ${LIBXML2_ROOT}/bin)
set(LIBXML2_BINARY_DIRS ${LIBXML2_BINARY_DIRS} PARENT_SCOPE)
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${LIBXML2_LIBRARIES})
set(XDMF_BINARIES ${XDMF_BINARIES} ${LIBXML2_BINARY_DIRS})
endif()
......@@ -172,7 +169,15 @@ SET_TARGET_PROPERTIES(
SOVERSION ${XDMF_MAJOR_VERSION}
)
target_link_libraries(XdmfCore ${XDMF_LIBRARIES})
target_link_libraries(XdmfCore
PUBLIC
${HDF5_C_LIBRARIES}
${LIBXML2_LIBRARIES})
if (TIFF_FOUND)
target_link_libraries(XdmfCore
PRIVATE
${TIFF_LIBRARIES})
endif ()
if (COMMAND vtk_target_install)
vtk_target_install(XdmfCore)
......@@ -239,7 +244,6 @@ set(XdmfCore_INCLUDE_DIRS
CACHE INTERNAL "")
set(XDMF_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include PARENT_SCOPE)
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${CMAKE_INSTALL_PREFIX}/lib)
set(XDMF_DIR ${CMAKE_INSTALL_PREFIX} PARENT_SCOPE)
set(XDMF_BINARIES ${XDMF_BINARIES} ${CMAKE_INSTALL_PREFIX}/bin)
......@@ -252,5 +256,4 @@ if(XDMF_BUILD_TESTING)
add_subdirectory(tests)
endif()
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} PARENT_SCOPE)
set(XDMF_BINARIES ${XDMF_BINARIES} PARENT_SCOPE)
......@@ -9,7 +9,6 @@ ADD_TEST_JAVA_CLASSPATH("${XdmfCore_JAVA_JAR}")
# Add any ldpath directories that the java tests may need
ADD_TEST_JAVA_LDPATH("${CMAKE_BINARY_DIR}")
ADD_TEST_JAVA_LDPATH("${XDMF_LIBRARIES}")
# Add any path directories that the java tests may need
ADD_TEST_JAVA_PATH("${CMAKE_BINARY_DIR}")
......
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