function(get_amrex_sources)
   set(AMREX_SOURCE_DIR "${CMAKE_SOURCE_DIR}/Submodules/AMReX/Src/Amr")
   add_sources(GlobalSourceList
     ${AMREX_SOURCE_DIR}/AMReX_Amr.cpp
     ${AMREX_SOURCE_DIR}/AMReX_AmrLevel.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Derive.cpp
     ${AMREX_SOURCE_DIR}/AMReX_StateData.cpp
     ${AMREX_SOURCE_DIR}/AMReX_StateDescriptor.cpp
     ${AMREX_SOURCE_DIR}/AMReX_AuxBoundaryData.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Extrapolater.cpp
     ${AMREX_SOURCE_DIR}/AMReX_extrapolater_${AMREX_DIM}d.f90
   )
   set(AMREX_SOURCE_DIR "${CMAKE_SOURCE_DIR}/Submodules/AMReX/Src/AmrCore")
   add_sources(GlobalSourceList
     ${AMREX_SOURCE_DIR}/AMReX_AmrCore.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Cluster.cpp
     ${AMREX_SOURCE_DIR}/AMReX_ErrorList.cpp 
     ${AMREX_SOURCE_DIR}/AMReX_FillPatchUtil.cpp
     ${AMREX_SOURCE_DIR}/AMReX_FluxRegister.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Interpolater.cpp
     ${AMREX_SOURCE_DIR}/AMReX_TagBox.cpp
     ${AMREX_SOURCE_DIR}/AMReX_AmrMesh.cpp
     ${AMREX_SOURCE_DIR}/AMReX_FLUXREG_nd.F90
     ${AMREX_SOURCE_DIR}/AMReX_INTERP_${AMREX_DIM}D.F90
     ${AMREX_SOURCE_DIR}/AMReX_FillPatchUtil_${AMREX_DIM}d.F90
   )
   set(AMREX_SOURCE_DIR "${CMAKE_SOURCE_DIR}/Submodules/AMReX/Src/Base")
   add_sources(GlobalSourceList
     ${AMREX_SOURCE_DIR}/AMReX_ccse-mpi.H
     ${AMREX_SOURCE_DIR}/AMReX_Array.H
     ${AMREX_SOURCE_DIR}/AMReX_Vector.H
     ${AMREX_SOURCE_DIR}/AMReX_Tuple.H
     ${AMREX_SOURCE_DIR}/AMReX.cpp
     ${AMREX_SOURCE_DIR}/AMReX_error_fi.cpp
     ${AMREX_SOURCE_DIR}/AMReX.H
     ${AMREX_SOURCE_DIR}/AMReX_Exception.H
     ${AMREX_SOURCE_DIR}/AMReX.cpp
     ${AMREX_SOURCE_DIR}/AMReX_error_fi.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Extension.H
     ${AMREX_SOURCE_DIR}/AMReX_IndexSequence.H
     ${AMREX_SOURCE_DIR}/AMReX_ParmParse.cpp
     ${AMREX_SOURCE_DIR}/AMReX_parmparse_fi.cpp
     ${AMREX_SOURCE_DIR}/AMReX_ParmParse.H
     ${AMREX_SOURCE_DIR}/AMReX_Utility.H
     ${AMREX_SOURCE_DIR}/AMReX_Utility.cpp
     ${AMREX_SOURCE_DIR}/AMReX_BLassert.H
     ${AMREX_SOURCE_DIR}/AMReX_ArrayLim.H
     ${AMREX_SOURCE_DIR}/AMReX_REAL.H
     ${AMREX_SOURCE_DIR}/AMReX_CONSTANTS.H
     ${AMREX_SOURCE_DIR}/AMReX_SPACE.H
     ${AMREX_SOURCE_DIR}/AMReX_Random.cpp
     ${AMREX_SOURCE_DIR}/AMReX_DistributionMapping.H
     ${AMREX_SOURCE_DIR}/AMReX_DistributionMapping.cpp
     ${AMREX_SOURCE_DIR}/AMReX_ParallelDescriptor.H
     ${AMREX_SOURCE_DIR}/AMReX_ParallelDescriptor.cpp
     ${AMREX_SOURCE_DIR}/AMReX_ParallelReduce.H
     ${AMREX_SOURCE_DIR}/AMReX_ForkJoin.H
     ${AMREX_SOURCE_DIR}/AMReX_ForkJoin.cpp
     ${AMREX_SOURCE_DIR}/AMReX_ParallelContext.H
     ${AMREX_SOURCE_DIR}/AMReX_ParallelContext.cpp
     ${AMREX_SOURCE_DIR}/AMReX_VisMF.H
     ${AMREX_SOURCE_DIR}/AMReX_VisMF.cpp 
     ${AMREX_SOURCE_DIR}/AMReX_Arena.H
     ${AMREX_SOURCE_DIR}/AMReX_Arena.cpp
     ${AMREX_SOURCE_DIR}/AMReX_BArena.H
     ${AMREX_SOURCE_DIR}/AMReX_BArena.cpp
     ${AMREX_SOURCE_DIR}/AMReX_CArena.H
     ${AMREX_SOURCE_DIR}/AMReX_CArena.cpp
     ${AMREX_SOURCE_DIR}/AMReX_DArena.H
     ${AMREX_SOURCE_DIR}/AMReX_DArena.cpp
     ${AMREX_SOURCE_DIR}/AMReX_EArena.H
     ${AMREX_SOURCE_DIR}/AMReX_EArena.cpp
     ${AMREX_SOURCE_DIR}/AMReX_BLProfiler.H
     ${AMREX_SOURCE_DIR}/AMReX_BLBackTrace.H
     ${AMREX_SOURCE_DIR}/AMReX_BLFort.H
     ${AMREX_SOURCE_DIR}/AMReX_NFiles.H
     ${AMREX_SOURCE_DIR}/AMReX_NFiles.cpp  
     ${AMREX_SOURCE_DIR}/AMReX_parstream.H
     ${AMREX_SOURCE_DIR}/AMReX_parstream.cpp
     ${AMREX_SOURCE_DIR}/AMReX_FabConv.H  
     ${AMREX_SOURCE_DIR}/AMReX_FabConv.cpp  
     ${AMREX_SOURCE_DIR}/AMReX_FPC.H
     ${AMREX_SOURCE_DIR}/AMReX_FPC.cpp
     ${AMREX_SOURCE_DIR}/AMReX_VectorIO.H
     ${AMREX_SOURCE_DIR}/AMReX_VectorIO.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Print.H
     ${AMREX_SOURCE_DIR}/AMReX_IntConv.H
     ${AMREX_SOURCE_DIR}/AMReX_IntConv.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Box.H
     ${AMREX_SOURCE_DIR}/AMReX_Box.cpp
     ${AMREX_SOURCE_DIR}/AMReX_BoxIterator.H 
     ${AMREX_SOURCE_DIR}/AMReX_BoxIterator.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Dim3.H
     ${AMREX_SOURCE_DIR}/AMReX_IntVect.H
     ${AMREX_SOURCE_DIR}/AMReX_IntVect.cpp
     ${AMREX_SOURCE_DIR}/AMReX_IndexType.H
     ${AMREX_SOURCE_DIR}/AMReX_IndexType.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Orientation.H 
     ${AMREX_SOURCE_DIR}/AMReX_Orientation.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Periodicity.H 
     ${AMREX_SOURCE_DIR}/AMReX_Periodicity.cpp
     ${AMREX_SOURCE_DIR}/AMReX_RealBox.H
     ${AMREX_SOURCE_DIR}/AMReX_RealBox.cpp
     ${AMREX_SOURCE_DIR}/AMReX_RealVect.H
     ${AMREX_SOURCE_DIR}/AMReX_RealVect.cpp
     ${AMREX_SOURCE_DIR}/AMReX_BoxList.H
     ${AMREX_SOURCE_DIR}/AMReX_BoxList.cpp 
     ${AMREX_SOURCE_DIR}/AMReX_BoxArray.H 
     ${AMREX_SOURCE_DIR}/AMReX_BoxArray.cpp
     ${AMREX_SOURCE_DIR}/AMReX_BoxDomain.H
     ${AMREX_SOURCE_DIR}/AMReX_BoxDomain.cpp
     ${AMREX_SOURCE_DIR}/AMReX_FArrayBox.H
     ${AMREX_SOURCE_DIR}/AMReX_FArrayBox.cpp
     ${AMREX_SOURCE_DIR}/AMReX_IArrayBox.H
     ${AMREX_SOURCE_DIR}/AMReX_IArrayBox.cpp 
     ${AMREX_SOURCE_DIR}/AMReX_BaseFab.H
     ${AMREX_SOURCE_DIR}/AMReX_BaseFab.cpp
     ${AMREX_SOURCE_DIR}/AMReX_Array4.H
     ${AMREX_SOURCE_DIR}/AMReX_MakeType.H
     ${AMREX_SOURCE_DIR}/AMReX_TypeTraits.H
     ${AMREX_SOURCE_DIR}/AMReX_FabFactory.H
     ${AMREX_SOURCE_DIR}/AMReX_BaseFabUtility.H
     ${AMREX_SOURCE_DIR}/AMReX_MultiFab.cpp 
     ${AMREX_SOURCE_DIR}/AMReX_MultiFab.H
     ${AMREX_SOURCE_DIR}/AMReX_MFCopyDescriptor.cpp
     ${AMREX_SOURCE_DIR}/AMReX_MFCopyDescriptor.H
     ${AMREX_SOURCE_DIR}/AMReX_iMultiFab.cpp
     ${AMREX_SOURCE_DIR}/AMReX_iMultiFab.H
     ${AMREX_SOURCE_DIR}/AMReX_FabArrayBase.cpp
     ${AMREX_SOURCE_DIR}/AMReX_FabArrayBase.H 
     ${AMREX_SOURCE_DIR}/AMReX_MFIter.cpp
     ${AMREX_SOURCE_DIR}/AMReX_MFIter.H
     ${AMREX_SOURCE_DIR}/AMReX_FabArray.H
     ${AMREX_SOURCE_DIR}/AMReX_FACopyDescriptor.H
     ${AMREX_SOURCE_DIR}/AMReX_FabArrayCommI.H
     ${AMREX_SOURCE_DIR}/AMReX_FabArrayUtility.H
     ${AMREX_SOURCE_DIR}/AMReX_LayoutData.H
     ${AMREX_SOURCE_DIR}/AMReX_CoordSys.cpp 
     ${AMREX_SOURCE_DIR}/AMReX_CoordSys.H
     ${AMREX_SOURCE_DIR}/AMReX_Geometry.cpp 
     ${AMREX_SOURCE_DIR}/AMReX_Geometry.H
     ${AMREX_SOURCE_DIR}/AMReX_MultiFabUtil.cpp
     ${AMREX_SOURCE_DIR}/AMReX_MultiFabUtil.H
     ${AMREX_SOURCE_DIR}/AMReX_BCRec.cpp
     ${AMREX_SOURCE_DIR}/AMReX_BCRec.H 
     ${AMREX_SOURCE_DIR}/AMReX_PhysBCFunct.cpp
     ${AMREX_SOURCE_DIR}/AMReX_PhysBCFunct.H 
     ${AMREX_SOURCE_DIR}/AMReX_BCUtil.cpp
     ${AMREX_SOURCE_DIR}/AMReX_BCUtil.H
     ${AMREX_SOURCE_DIR}/AMReX_BC_TYPES.H 
     ${AMREX_SOURCE_DIR}/AMReX_PlotFileUtil.cpp
     ${AMREX_SOURCE_DIR}/AMReX_PlotFileUtil.H
     ${AMREX_SOURCE_DIR}/AMReX_PlotFileDataImpl.H
     ${AMREX_SOURCE_DIR}/AMReX_PlotFileDataImpl.cpp
     ${AMREX_SOURCE_DIR}/AMReX_COORDSYS_${AMREX_DIM}D_C.H
     ${AMREX_SOURCE_DIR}/AMReX_COORDSYS_C.H
     ${AMREX_SOURCE_DIR}/AMReX_filcc_f.H
     ${AMREX_SOURCE_DIR}/AMReX_BLutil_F.F90
     ${AMREX_SOURCE_DIR}/AMReX_BLProfiler_F.F90
     ${AMREX_SOURCE_DIR}/AMReX_FILCC_${AMREX_DIM}D.F90
     ${AMREX_SOURCE_DIR}/AMReX_MultiFabUtil_${AMREX_DIM}D_C.H
     ${AMREX_SOURCE_DIR}/AMReX_MultiFabUtil_nd_C.H
     ${AMREX_SOURCE_DIR}/AMReX_MultiFabUtil_C.H
     ${AMREX_SOURCE_DIR}/AMReX_FilCC_${AMREX_DIM}D_C.H
     ${AMREX_SOURCE_DIR}/AMReX_FilCC_C.H
     ${AMREX_SOURCE_DIR}/AMReX_filcc_mod.F90
     ${AMREX_SOURCE_DIR}/AMReX_omp_mod.F90
     ${AMREX_SOURCE_DIR}/AMReX_acc_mod.F90
     ${AMREX_SOURCE_DIR}/AMReX_fort_mod.F90
     ${AMREX_SOURCE_DIR}/AMReX_constants_mod.f90
     ${AMREX_SOURCE_DIR}/AMReX_error_mod.F90
     ${AMREX_SOURCE_DIR}/AMReX_parmparse_mod.F90
     ${AMREX_SOURCE_DIR}/AMReX_string_mod.F90
     ${AMREX_SOURCE_DIR}/AMReX_bc_types_mod.F90
     ${AMREX_SOURCE_DIR}/AMReX_ParallelDescriptor_F.F90
     ${AMREX_SOURCE_DIR}/AMReX_io_mod.F90
     ${AMREX_SOURCE_DIR}/AMReX_Gpu.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuQualifiers.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuControl.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuControl.cpp
     ${AMREX_SOURCE_DIR}/AMReX_GpuLaunch.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuLaunch.cpp
     ${AMREX_SOURCE_DIR}/AMReX_GpuLaunchMacrosG.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuLaunchMacrosC.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuLaunchFunctsG.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuLaunchFunctsC.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuError.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuDevice.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuDevice.cpp
     ${AMREX_SOURCE_DIR}/AMReX_GpuUtility.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuUtility.cpp
     ${AMREX_SOURCE_DIR}/AMReX_GpuAsyncArray.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuAsyncArray.cpp
     ${AMREX_SOURCE_DIR}/AMReX_GpuElixir.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuElixir.cpp
     ${AMREX_SOURCE_DIR}/AMReX_GpuMemory.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuRange.H
     ${AMREX_SOURCE_DIR}/AMReX_GpuReduce.H
     ${AMREX_SOURCE_DIR}/AMReX_CudaAllocators.H
     ${AMREX_SOURCE_DIR}/AMReX_CudaAllocators.cpp
     ${AMREX_SOURCE_DIR}/AMReX_CudaAllocators.H
     ${AMREX_SOURCE_DIR}/AMReX_CudaContainers.H
     ${AMREX_SOURCE_DIR}/AMReX_CudaGraph.H
     ${AMREX_SOURCE_DIR}/AMReX_Machine.H
     ${AMREX_SOURCE_DIR}/AMReX_Machine.cpp
     ${AMREX_SOURCE_DIR}/AMReX_MemPool.cpp
     ${AMREX_SOURCE_DIR}/AMReX_MemPool.H
     ${AMREX_SOURCE_DIR}/AMReX_mempool_mod.F90 # if BL_NO_FORT = FALSE
     ${AMREX_SOURCE_DIR}/AMReX_BLProfiler.cpp
     ${AMREX_SOURCE_DIR}/AMReX_BLBackTrace.cpp   
   )
   set(AMREX_SOURCE_DIR "${CMAKE_SOURCE_DIR}/Submodules/AMReX/Src/F_Interfaces/AmrCore")
   add_sources(GlobalSourceList
      ${AMREX_SOURCE_DIR}/AMReX_FAmrCore.cpp
      ${AMREX_SOURCE_DIR}/AMReX_amr_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_amrcore_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_amrcore_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_fillpatch_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_fillpatch_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_fluxregister_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_fluxregister_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_interpolater_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_tagbox_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_tagbox_mod.F90
   )
   set(AMREX_SOURCE_DIR "${CMAKE_SOURCE_DIR}/Submodules/AMReX/Src/F_Interfaces/Base")
   add_sources(GlobalSourceList
      ${AMREX_SOURCE_DIR}/AMReX_FPhysBC.cpp
      ${AMREX_SOURCE_DIR}/AMReX_base_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_box_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_box_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_boxarray_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_boxarray_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_distromap_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_distromap_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_fab_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_geometry_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_geometry_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_init_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_init_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_multifab_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_multifab_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_multifabutil_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_multifabutil_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_parallel_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_physbc_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_physbc_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_plotfile_fi.cpp
      ${AMREX_SOURCE_DIR}/AMReX_plotfile_mod.F90
      ${AMREX_SOURCE_DIR}/AMReX_vismf_fi.cpp
   )
   if(AMREX_ENABLE_EB)
     set(AMREX_SOURCE_DIR "${CMAKE_SOURCE_DIR}/Submodules/AMReX/Src/EB")
     add_sources(GlobalSourceList
       ${AMREX_SOURCE_DIR}/AMReX_EBAmrUtil.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EBDataCollection.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EBFArrayBox.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EBInterpolater.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EBCellFlag.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EBFabFactory.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EBFluxRegister.cpp  
       ${AMREX_SOURCE_DIR}/AMReX_EBMultiFabUtil.cpp
       ${AMREX_SOURCE_DIR}/AMReX_MultiCutFab.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EB_levelset.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EB_utils.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EB_LSCoreBase.cpp 
       ${AMREX_SOURCE_DIR}/AMReX_EBFluxRegister_nd.F90
       ${AMREX_SOURCE_DIR}/AMReX_ebcellflag_mod.F90   
       ${AMREX_SOURCE_DIR}/AMReX_compute_normals.F90
       ${AMREX_SOURCE_DIR}/AMReX_eb_to_pvd.F90
       ${AMREX_SOURCE_DIR}/AMReX_EB_geometry.F90
       ${AMREX_SOURCE_DIR}/AMReX_EB_levelset_F.F90
       ${AMREX_SOURCE_DIR}/AMReX_EB_Tagging.F90
       ${AMREX_SOURCE_DIR}/AMReX_EB_bc_fill_nd.F90
       ${AMREX_SOURCE_DIR}/AMReX_distFcnElement.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EB2.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EB2_Level.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EB2_MultiGFab.cpp
       ${AMREX_SOURCE_DIR}/AMReX_EB2_${AMREX_DIM}D_C.cpp
       ${AMREX_SOURCE_DIR}/AMReX_algoim.cpp
       ${AMREX_SOURCE_DIR}/AMReX_WriteEBSurface.cpp
     )
   endif()
   set(AMREX_SOURCE_DIR "${CMAKE_SOURCE_DIR}/Submodules/AMReX/Src/Boundary")
   add_sources(GlobalSourceList
      ${AMREX_SOURCE_DIR}/AMReX_BndryData.cpp
      ${AMREX_SOURCE_DIR}/AMReX_BndryRegister.cpp
      ${AMREX_SOURCE_DIR}/AMReX_FabSet.cpp
      ${AMREX_SOURCE_DIR}/AMReX_InterpBndryData.cpp
      ${AMREX_SOURCE_DIR}/AMReX_LO_UTIL.F90
      ${AMREX_SOURCE_DIR}/AMReX_MacBndry.cpp
      ${AMREX_SOURCE_DIR}/AMReX_Mask.cpp
      ${AMREX_SOURCE_DIR}/AMReX_MultiMask.cpp
      ${AMREX_SOURCE_DIR}/AMReX_YAFluxRegister.cpp
      ${AMREX_SOURCE_DIR}/AMReX_lo_bctypes_mod.F90
   )
endfunction(get_amrex_sources)
