Commit 761ffdf3 authored by Ben Boeckel's avatar Ben Boeckel

cmake: remove library directory manipulation

The logic does not work with imported targets and CMake prefers to link
with absolute paths anyways.
parent 322b946a
......@@ -70,8 +70,6 @@ find_package(TIFF)
if (TIFF_FOUND)
add_definitions(-DXDMF_BUILD_TIFF)
include_directories(${TIFF_INCLUDE_DIR})
get_filename_component(TIFF_LIBRARY_DIR "${TIFF_LIBRARY}" PATH)
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} ${TIFF_LIBRARY_DIR})
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${TIFF_LIBRARIES})
endif (TIFF_FOUND)
......@@ -83,8 +81,6 @@ if(XDMF_BUILD_DSM)
if(MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
get_filename_component(MPI_LIBRARY_DIR ${MPI_LIBRARY} PATH)
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} ${MPI_LIBRARY_DIR})
# 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 "")
......@@ -293,7 +289,6 @@ endif()
add_subdirectory(core)
include_directories(${XdmfCore_INCLUDE_DIRS} ${XdmfDSM_INCLUDE_DIRS})
link_directories(${XDMF_LIBRARY_DIRS})
include(GNUInstallDirs)
......
......@@ -40,7 +40,6 @@ endif()
if ("$ENV{HDF5_ROOT}" STREQUAL "")
find_file (HDF5_LIB libhdf5.so HINTS ENV LD_LIBRARY_PATH)
if (NOT "${HDF5_LIB}" STREQUAL "")
get_filename_component(HDF5_LIBRARY_DIR "${HDF5_LIB}" PATH)
get_filename_component(HDF5_ROOT "${HDF5_LIBRARY_DIR}/../" ABSOLUTE)
set(ENV{HDF5_ROOT} ${HDF5_ROOT})
endif ()
......@@ -57,8 +56,6 @@ find_package(HDF5 REQUIRED)
if(HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIRS})
include_directories(${HDF5_C_INCLUDE_DIR})
get_filename_component(HDF5_LIBRARY_DIR "${HDF5_hdf5_LIBRARY_RELEASE}" PATH)
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} ${HDF5_LIBRARY_DIR})
set(HDF5_LIBRARIES ${HDF5_hdf5_LIBRARY_RELEASE})
# FIXME: Would like to get this info from HDF5 so we don't have conflicting
# MPI versions
......@@ -68,8 +65,6 @@ if(HDF5_FOUND)
if(MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
get_filename_component(MPI_LIBRARY_DIR ${MPI_LIBRARY} PATH)
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} ${MPI_LIBRARY_DIR})
endif()
endif ()
endif()
......@@ -188,8 +183,6 @@ SET_TARGET_PROPERTIES(
SOVERSION ${XDMF_MAJOR_VERSION}
)
link_directories(${XDMF_LIBRARY_DIRS})
target_link_libraries(XdmfCore ${XDMF_LIBRARIES})
if (COMMAND vtk_target_install)
......@@ -216,7 +209,6 @@ if(XDMF_WRAP_PYTHON)
XDMF_SWIG_PYTHON(XdmfCore)
endif()
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} PARENT_SCOPE)
if(WIN32)
set(XDMFCORE_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/XdmfCore.lib PARENT_SCOPE)
endif()
......
project(XdmfDSM)
set(XdmfDSMLinkLibraries XdmfCore)
set(XdmfDSMLinkLibraryDir )
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
......@@ -14,8 +13,6 @@ if(HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIRS})
include_directories(${HDF5_C_INCLUDE_DIR})
set(HDF5_LIBRARIES ${HDF5_hdf5_LIBRARY_RELEASE})
get_filename_component(HDF5_LIBRARY_DIR "${HDF5_hdf5_LIBRARY_RELEASE}" PATH)
set(XdmfDSMLinkLibraryDir ${XdmfDSMLinkLibraryDir} ${HDF5_LIBRARY_DIR})
# FIXME: Would like to get this info from HDF5 so we don't have conflicting
# MPI versions
if(HDF5_IS_PARALLEL)
......@@ -83,7 +80,6 @@ SET_TARGET_PROPERTIES(
VERSION ${XDMF_VERSION}
SOVERSION ${XDMF_MAJOR_VERSION}
)
link_directories(${XDMF_LIBRARY_DIRS} ${XdmfDSMLinkLibraryDir})
target_link_libraries(XdmfDSM ${XdmfDSMLinkLibraries})
if(WIN32)
......@@ -111,8 +107,6 @@ if(XDMF_WRAP_PYTHON)
endif()
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} PARENT_SCOPE)
if(WIN32)
set(XDMFDSM_LIBRARY ${CMAKE_INSTALL_PREFIX}/lib/XdmfDSM.lib PARENT_SCOPE)
endif()
......
......@@ -8,7 +8,6 @@ ADD_TEST_C_DEPENDENCIES("XdmfDSM")
# Add any ldpath directories that the cxx tests may need
ADD_TEST_C_LDPATH("${CMAKE_BINARY_DIR}")
ADD_TEST_C_LDPATH("${XDMF_LIBRARY_DIRS}")
# Add any path directoreis that the Cxx tests may need
ADD_TEST_C_PATH("${CMAKE_BINARY_DIR}")
......
......@@ -8,7 +8,6 @@ ADD_TEST_CXX_DEPENDENCIES("XdmfDSM")
# Add any ldpath directories that the cxx tests may need
ADD_TEST_CXX_LDPATH("${CMAKE_BINARY_DIR}")
ADD_TEST_CXX_LDPATH("${XDMF_LIBRARY_DIRS}")
# Add any path directoreis that the Cxx tests may need
ADD_TEST_CXX_PATH("${CMAKE_BINARY_DIR}")
......
......@@ -11,7 +11,6 @@ ADD_TEST_PYTHON_PYTHONPATH("${PYTHON_INCLUDE_MPI4PY_DIR}/../..")
# Add any ldpath directories that the python tests may need
ADD_TEST_PYTHON_LDPATH("${CMAKE_BINARY_DIR}")
ADD_TEST_PYTHON_LDPATH("${XDMF_LIBRARY_DIRS}")
# Add any path directories that the python tests may need
ADD_TEST_PYTHON_PATH("${CMAKE_BINARY_DIR}")
......
......@@ -7,7 +7,6 @@ ADD_TEST_C_DEPENDENCIES("XdmfCore")
# Add any ldpath directories that the cxx tests may need
ADD_TEST_C_LDPATH("${CMAKE_BINARY_DIR}")
ADD_TEST_C_LDPATH("${XDMF_LIBRARY_DIRS}")
# Add any path directoreis that the Cxx tests may need
ADD_TEST_C_PATH("${CMAKE_BINARY_DIR}")
......
......@@ -7,7 +7,6 @@ ADD_TEST_CXX_DEPENDENCIES("XdmfCore")
# Add any ldpath directories that the cxx tests may need
ADD_TEST_CXX_LDPATH("${CMAKE_BINARY_DIR}")
ADD_TEST_CXX_LDPATH("${XDMF_LIBRARY_DIRS}")
# Add any path directoreis that the Cxx tests may need
ADD_TEST_CXX_PATH("${CMAKE_BINARY_DIR}")
......
......@@ -9,7 +9,6 @@ ADD_TEST_PYTHON_PYTHONPATH("${CMAKE_BINARY_DIR}")
# Add any ldpath directories that the python tests may need
ADD_TEST_PYTHON_LDPATH("${CMAKE_BINARY_DIR}")
ADD_TEST_PYTHON_LDPATH("${XDMF_LIBRARY_DIRS}")
# Add any path directories that the python tests may need
ADD_TEST_PYTHON_PATH("${CMAKE_BINARY_DIR}")
......
......@@ -7,7 +7,6 @@ ADD_TEST_C_DEPENDENCIES("Xdmf")
# Add any ldpath directories that the cxx tests may need
ADD_TEST_C_LDPATH("${CMAKE_BINARY_DIR}")
ADD_TEST_C_LDPATH("${XDMF_LIBRARY_DIRS}")
# Add any path directoreis that the Cxx tests may need
ADD_TEST_C_PATH("${CMAKE_BINARY_DIR}")
......
......@@ -8,7 +8,6 @@ ADD_TEST_C_DEPENDENCIES("XdmfUtils")
# Add any ldpath directories that the cxx tests may need
ADD_TEST_C_LDPATH("${CMAKE_BINARY_DIR}")
ADD_TEST_C_LDPATH("${XDMF_LIBRARY_DIRS}")
# Add any path directoreis that the Cxx tests may need
ADD_TEST_C_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