Commit fb210b8c authored by Andrew Burns's avatar Andrew Burns

Merge branch 'master' into 'master'

Static build handling for utils

Removed fPIC code as it was replaced.

Added tag to utils to add static linkages.

Fix to XdmfWriter to handle intel compilers.

Added RPath back in to fix Linux builds.

@demarle Any issues with this fix?

See merge request !21
parents 6186257e d1392477
......@@ -39,12 +39,6 @@ if(XDMF_BUILD_TESTING)
endif()
if (XDMF_STATIC_AND_SHARED)
STRING(REGEX MATCH "-fPIC" IS_FPIC "${CMAKE_CXX_FLAGS}")
if ("${IS_FPIC}" STREQUAL "")
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif(UNIX)
endif ("${IS_FPIC}" STREQUAL "")
add_definitions(-DXDMFSTATIC)
endif ()
......@@ -65,10 +59,13 @@ include(XdmfFunctions)
get_filename_component(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE)
# RPath
#set(CMAKE_SKIP_BUILD_RPATH FALSE)
#set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
#set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
option(XDMF_SET_RPATH ON)
if (XDMF_SET_RPATH)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif ()
# Should we build with documentation
option(XDMF_BUILD_DOCUMENTATION OFF)
......
......@@ -54,11 +54,13 @@ endif ()
mark_as_advanced(CLEAR HDF5_C_INCLUDE_DIR)
mark_as_advanced(CLEAR HDF5_hdf5_LIBRARY_DEBUG)
mark_as_advanced(CLEAR HDF5_hdf5_LIBRARY_RELEASE)
set(HDF5_LIBRARIES ${vtkhdf5_LIBRARIES})
set(HDF5_hdf5_LIBRARY_RELEASE ${vtkhdf5_LIBRARIES})
set(HDF5_INCLUDE_DIRS ${vtkhdf5_INCLUDE_DIRS})
set(HDF5_C_INCLUDE_DIR ${vtkhdf5_INCLUDE_DIRS})
set(HDF5_FOUND TRUE)
if (NOT ("${vtkhdf5_LIBRARIES}" STREQUAL ""))
set(HDF5_LIBRARIES ${vtkhdf5_LIBRARIES})
set(HDF5_hdf5_LIBRARY_RELEASE ${vtkhdf5_LIBRARIES})
set(HDF5_INCLUDE_DIRS ${vtkhdf5_INCLUDE_DIRS})
set(HDF5_C_INCLUDE_DIR ${vtkhdf5_INCLUDE_DIRS})
set(HDF5_FOUND TRUE)
endif ()
find_package(HDF5 REQUIRED)
if(HDF5_FOUND)
mark_as_advanced(FORCE HDF5_C_INCLUDE_DIR)
......
......@@ -376,9 +376,11 @@ XdmfWriter::visit(XdmfArray & array,
// Take care of writing to single heavy data file (Default behavior)
if(!array.isInitialized() && array.getHeavyDataController(0) &&
array.getHeavyDataController(0)->getFilePath().compare(mImpl->mHeavyDataWriter->getFilePath()) != 0 &&
mImpl->mMode == Default) {
array.read();
if (array.getHeavyDataController(0)->getFilePath().compare(mImpl->mHeavyDataWriter->getFilePath()) != 0)
{
array.read();
}
}
if(array.getHeavyDataController(0) ||
......
......@@ -92,15 +92,22 @@ if(XDMF_BUILD_PARTITIONER)
set(XdmfUtilsLinkLibraries ${XdmfUtilsLinkLibraries} ${METIS_LIBRARIES})
endif(XDMF_BUILD_PARTITIONER)
add_library(XdmfUtilsObjects OBJECT ${XdmfUtilsSources})
add_library(XdmfUtils $<TARGET_OBJECTS:XdmfUtilsObjects>)
if (BUILD_SHARED_LIBS)
add_library(XdmfUtils_Static STATIC $<TARGET_OBJECTS:XdmfUtilsObjects>)
if (UNIX)
set_target_properties(XdmfUtils_Static PROPERTIES
OUTPUT_NAME "XdmfUtils")
endif (UNIX)
endif (BUILD_SHARED_LIBS)
if (XDMF_STATIC_AND_SHARED)
add_library(XdmfUtilsObjects OBJECT ${XdmfUtilsSources})
set_target_properties(XdmfUtilsObjects PROPERTIES
POSITION_INDEPENDENT_CODE True)
add_library(XdmfUtils $<TARGET_OBJECTS:XdmfUtilsObjects>)
if (BUILD_SHARED_LIBS)
add_library(XdmfUtils_Static STATIC $<TARGET_OBJECTS:XdmfUtilsObjects>)
if (UNIX)
set_target_properties(XdmfUtils_Static PROPERTIES
OUTPUT_NAME "XdmfUtils")
endif (UNIX)
endif (BUILD_SHARED_LIBS)
else ()
add_library(XdmfUtils ${XdmfUtilsSources})
endif ()
target_link_libraries(XdmfUtils ${XdmfUtilsLinkLibraries})
if (BUILD_SHARED_LIBS)
target_link_libraries(XdmfUtils_Static ${XdmfUtilsLinkLibraries})
......
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