From b0ee89b349aae72c274e371c1f7eb03287acd5f6 Mon Sep 17 00:00:00 2001
From: Norbert Podhorszki <pnorbert@ornl.gov>
Date: Mon, 3 Apr 2017 16:19:39 -0400
Subject: [PATCH] Add ADIOS1 dependency directly to an example's CMakeLists.txt

---
 examples/heatTransfer/CMakeLists.txt | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/heatTransfer/CMakeLists.txt b/examples/heatTransfer/CMakeLists.txt
index 8752c88e3..d8525ed27 100644
--- a/examples/heatTransfer/CMakeLists.txt
+++ b/examples/heatTransfer/CMakeLists.txt
@@ -10,12 +10,19 @@ if(ADIOS_USE_MPI)
     target_include_directories(heatTransfer_adios PRIVATE ${MPI_C_INCLUDE_PATH})
     target_link_libraries(heatTransfer_adios adios2 ${MPI_C_LIBRARIES})
 else(ADIOS_USE_MPI) 
-    add_executable(heatTransfer_adios main.cpp HeatTransfer.cpp Settings.cpp IO_adios2.cpp)
     target_link_libraries(heatTransfer_adios adios2)
 endif()
 
 if(ADIOS_USE_ADIOS1)
+    find_package(ADIOS1 REQUIRED)
     add_executable(heatTransfer_adios1 main.cpp HeatTransfer.cpp Settings.cpp IO_adios1.cpp)
+    if(ADIOS_USE_MPI)
+        target_include_directories(heatTransfer_adios1 PRIVATE ${MPI_C_INCLUDE_PATH})
+        target_link_libraries(heatTransfer_adios1  adios1::adios ${MPI_C_LIBRARIES})
+    else(ADIOS_USE_MPI) 
+        target_compile_definitions(heatTransfer_adios1 PRIVATE -D_NOMPI)
+        target_link_libraries(heatTransfer_adios1 adios1::adios)
+    endif()
 endif()
 
 #add_subdirectory(read)
-- 
GitLab