Skip to content
Merged
8 changes: 8 additions & 0 deletions cmake/ADIOSFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ function(adios2_add_thirdparty_target PackageName TargetName)
target_link_libraries(adios2::thirdparty::${PackageName}
INTERFACE ${TargetName}
)

if (TargetName)
get_target_property(interface_include_directories ${TargetName} INTERFACE_INCLUDE_DIRECTORIES)
if (interface_include_directories)
set_target_properties(adios2::thirdparty::${PackageName} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${interface_include_directories}")
endif()
endif()
endfunction()

# Setup the test dependencies and fixtures for a given pipeline:
Expand Down
9 changes: 7 additions & 2 deletions cmake/adios2-config-common.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,16 @@ if(NOT @BUILD_SHARED_LIBS@)
target_link_libraries(adios2::thirdparty::pugixml INTERFACE pugixml)
endif()

adios2_add_thirdparty_target(yaml-cpp)
set(ADIOS2_USE_EXTERNAL_YAMLCPP @ADIOS2_USE_EXTERNAL_YAMLCPP@)
set(yaml_cpp_target "yaml-cpp")
if(ADIOS2_USE_EXTERNAL_YAMLCPP)
find_dependency(yaml-cpp)
target_link_libraries(adios2::thirdparty::yaml-cpp INTERFACE yaml-cpp)
if (yaml-cpp_VERSION VERSION_GREATER_EQUAL 0.8)
set(yaml_cpp_target "yaml-cpp::yaml-cpp")
endif()
adios2_add_thirdparty_target(yaml-cpp ${yaml_cpp_target})
else()
adios2_add_thirdparty_target(yaml-cpp)
endif()

# No concrete implementation, just put this here to satisfy quasi-dependency
Expand Down
10 changes: 5 additions & 5 deletions cmake/adios2-config-install.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ set(_ADIOS2_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}")

if(NOT @BUILD_SHARED_LIBS@)
if(NOT @ADIOS2_USE_EXTERNAL_EVPATH@)
if(NOT "@ADIOS2_USE_EXTERNAL_EVPATH@")
set(EVPath_DIR ${CMAKE_CURRENT_LIST_DIR}/thirdparty)
endif()

if(NOT @ADIOS2_USE_EXTERNAL_ATL@)
if(NOT "@ADIOS2_USE_EXTERNAL_ATL@")
set(atl_DIR ${CMAKE_CURRENT_LIST_DIR}/thirdparty)
endif()

if(NOT @ADIOS2_USE_EXTERNAL_DILL@)
if(NOT "@ADIOS2_USE_EXTERNAL_DILL@")
set(dill_DIR ${CMAKE_CURRENT_LIST_DIR}/thirdparty)
endif()

if(NOT @ADIOS2_USE_EXTERNAL_FFS@)
if(NOT "@ADIOS2_USE_EXTERNAL_FFS@")
set(ffs_DIR ${CMAKE_CURRENT_LIST_DIR}/thirdparty)
endif()

if(NOT @ADIOS2_USE_EXTERNAL_ENET@)
if(NOT "@ADIOS2_USE_EXTERNAL_ENET@")
set(enet_DIR ${CMAKE_CURRENT_LIST_DIR}/thirdparty)
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/toolkit/remote/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (NOT ADIOS2_USE_PIP)
add_executable(adios2_remote_server ./remote_server.cpp)

target_link_libraries(adios2_remote_server
PUBLIC EVPath::EVPath adios2_core adios2sys
PUBLIC adios2::thirdparty::EVPath adios2_core adios2sys
PRIVATE adios2::thirdparty::pugixml $<$<PLATFORM_ID:Windows>:shlwapi>)

target_include_directories(adios2_remote_server PRIVATE ${PROJECT_BINARY_DIR})
Expand Down
6 changes: 3 additions & 3 deletions testing/adios2/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ gtest_add_tests_helper(CoreDims MPI_NONE "" Unit. "")
if(ADIOS2_HAVE_SST)
gtest_add_tests_helper(Remote MPI_NONE "" Unit. "" WORKING_DIRECTORY ${REMOTE_DIR})
set_tests_properties(Unit.Remote.OpenRead.Serial PROPERTIES FIXTURES_REQUIRED Server)
get_target_property(EVPATH_INCLUDES EVPath::EVPath INCLUDE_DIRECTORIES)
get_target_property(FFS_INCLUDES ffs::ffs INCLUDE_DIRECTORIES)
get_target_property(ATL_INCLUDES atl::atl INCLUDE_DIRECTORIES)
get_target_property(EVPATH_INCLUDES adios2::thirdparty::EVPath INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(FFS_INCLUDES adios2::thirdparty::ffs INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(ATL_INCLUDES adios2::thirdparty::atl INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(Test.Unit.Remote.Serial PRIVATE ${EVPATH_INCLUDES};${FFS_INCLUDES};${ATL_INCLUDES})
endif()
if(UNIX)
Expand Down
15 changes: 10 additions & 5 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ adios2_add_thirdparty_target(pugixml pugixml)
add_subdirectory(nlohmann_json)
adios2_add_thirdparty_target(nlohmann_json nlohmann_json_wrapper)

set(yaml_cpp_target "yaml-cpp")
if(ADIOS2_USE_EXTERNAL_YAMLCPP)
find_package(yaml-cpp 0.7.0 REQUIRED)
if (yaml-cpp_VERSION VERSION_GREATER_EQUAL 0.8)
set(yaml_cpp_target "yaml-cpp::yaml-cpp")
endif()
else()
add_subdirectory(yaml-cpp)
endif()

adios2_add_thirdparty_target(yaml-cpp yaml-cpp)
adios2_add_thirdparty_target(yaml-cpp ${yaml_cpp_target})

# YAML-cpp does not add the incdir/libdir to its target rather it exposes it
# through the cmake variables YAML_CPP_INCLUDE_DIR and YAML_CPP_LIBRARY_DIR
Expand All @@ -97,19 +101,19 @@ cmake_dependent_option(ADIOS2_USE_EXTERNAL_EVPATH
)
cmake_dependent_option(ADIOS2_USE_EXTERNAL_ATL
"Use an externally supplied ATL library" OFF
"NOT ADIOS2_USE_EXTERNAL_EVPATH" OFF
Comment thread
vicentebolea marked this conversation as resolved.
"NOT ADIOS2_USE_EXTERNAL_EVPATH" ON
)
cmake_dependent_option(ADIOS2_USE_EXTERNAL_FFS
"Use an externally supplied FFS library" OFF
"NOT ADIOS2_USE_EXTERNAL_EVPATH" OFF
"NOT ADIOS2_USE_EXTERNAL_EVPATH" ON
)
cmake_dependent_option(ADIOS2_USE_EXTERNAL_DILL
"Use an externally supplied DILL library" OFF
"NOT ADIOS2_USE_EXTERNAL_FFS" OFF
"NOT ADIOS2_USE_EXTERNAL_FFS" ON
)
cmake_dependent_option(ADIOS2_USE_EXTERNAL_ENET
"Use an externally supplied ENET library" OFF
"NOT ADIOS2_USE_EXTERNAL_EVPATH" OFF
"NOT ADIOS2_USE_EXTERNAL_EVPATH" ON
)

if(NOT ADIOS2_USE_EXTERNAL_FFS)
Expand All @@ -126,6 +130,7 @@ if(NOT ADIOS2_USE_EXTERNAL_FFS)
add_subdirectory(ffs)
endif()
find_package(ffs REQUIRED)
adios2_add_thirdparty_target(atl atl::atl)
Comment thread
vicentebolea marked this conversation as resolved.
adios2_add_thirdparty_target(ffs ffs::ffs)

if(NOT ADIOS2_USE_EXTERNAL_EVPATH)
Expand Down