Skip to content
Snippets Groups Projects
Commit f7225fe5 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

Fix CMake additions for builtin dataman support

parent ebdd27be
No related branches found
No related tags found
1 merge request!56added DataMan into utilities
......@@ -72,7 +72,10 @@ if(ADIOS_USE_MPI)
endif()
option(ADIOS_USE_BZip2 "Enable support for BZip2 transforms" OFF)
option(ADIOS_USE_ADIOS1 "Enable support for the ADIOS 1 engine" OFF)
option(ADIOS_USE_DataMan "Enable support for the DataMan engine" OFF)
# DataMan is not a user-settable option. It will always be enabled if the
# platform supports it.
set(ADIOS_USE_DataMan ${SHARED_LIBS_SUPPORTED})
#------------------------------------------------------------------------------#
# Third party libraries
......
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
#
# FindDataMan
# ---------
#
# Try to find the DataMan library from Jason Wang, ORNL
# https://github.com/JasonRuonanWang/DataMan
#
# This module defines the following variables:
#
# DataMan_FOUND - System has DataMan
# DataMan_INCLUDE_DIRS - The DataMan include directory
# DataMan_LIBRARIES - Link these to use DataMan
#
# and the following imported targets:
# DataMan::DataMan - The core DataMan library
#
# You can also set the following variable to help guide the search:
# DataMan_ROOT_DIR - The install prefix for DataMan containing the
# include and lib folders
# Note: this can be set as a CMake variable or an
# environment variable. If specified as a CMake
# variable, it will override any setting specified
# as an environment variable.
if(NOT DataMan_FOUND)
if((NOT DataMan_ROOT_DIR) AND (NOT (ENV{DataMan_ROOT_DIR} STREQUAL "")))
set(DataMan_ROOT_DIR "$ENV{DataMan_ROOT_DIR}")
endif()
# Search for the core libraries
if(DataMan_ROOT_DIR)
# If a root directory is specified, then don't look anywhere else
find_path(DataMan_INCLUDE_DIR DataMan.h
HINTS ${DataMan_ROOT_DIR}/include
NO_DEFAULT_PATHS
)
set(_DataMan_LIBRARY_HINT HINTS ${DataMan_ROOT_DIR}/lib NO_DEFAULT_PATHS)
else()
# Otherwise use the include dir as a basis to search for the lib
find_path(DataMan_INCLUDE_DIR DataMan.h)
if(DataMan_INCLUDE_DIR)
get_filename_component(_DataMan_PREFIX "${DataMan_INCLUDE_DIR}" PATH)
set(_DataMan_LIBRARY_HINT HINTS ${_DataMan_PREFIX}/lib)
unset(_DataMan_PREFIX)
endif()
endif()
find_library(DataMan_LIBRARY dataman ${_DataMan_LIBRARY_HINT})
unset(_DataMan_LIBRARY_HINT)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DataMan
FOUND_VAR DataMan_FOUND
REQUIRED_VARS
DataMan_INCLUDE_DIR
DataMan_LIBRARY
)
if(DataMan_FOUND)
set(DataMan_INCLUDE_DIRS ${DataMan_INCLUDE_DIR})
set(DataMan_LIBRARIES ${DataMan_LIBRARY})
if(DataMan_FOUND AND NOT TARGET DataMan::DataMan)
add_library(DataMan::DataMan UNKNOWN IMPORTED)
set_target_properties(DataMan::DataMan PROPERTIES
IMPORTED_LOCATION "${DataMan_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${DataMan_INCLUDE_DIR}"
)
endif()
endif()
endif()
......@@ -25,9 +25,6 @@ foreach(adios2_target IN LISTS adios2_targets)
engine/bp/BPFileReader.cpp
engine/bp/BPFileWriter.cpp
engine/dataman/DataManReader.cpp
engine/dataman/DataManWriter.cpp
functions/adiosFunctions.cpp
......@@ -40,23 +37,21 @@ foreach(adios2_target IN LISTS adios2_targets)
utilities/format/bp1/BP1Writer.cpp
utilities/profiling/iochrono/Timer.cpp
utilities/realtime/dataman/DataManBase.cpp
utilities/realtime/dataman/DataMan.cpp
)
target_include_directories(${adios2_target}
PUBLIC ${ADIOS_SOURCE_DIR}/include
)
if(ADIOS_USE_DataMan)
find_package(DataMan REQUIRED)
target_sources(${adios2_target} PRIVATE
engine/dataman/DataManReader.cpp
engine/dataman/DataManWriter.cpp
transport/wan/MdtmMan.cpp
utilities/realtime/dataman/DataManBase.cpp
utilities/realtime/dataman/DataMan.cpp
)
target_compile_definitions(${adios2_target} PRIVATE ADIOS_HAVE_DATAMAN)
target_link_libraries(${adios2_target} PRIVATE DataMan::DataMan)
target_link_libraries(${adios2_target} PRIVATE ${CMAKE_DL_LIBS})
endif()
if(ADIOS_USE_BZip2)
......
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