function(IncludeLibraries Entry Needed_Libraries)
  message("IncludeLibraries() Entry: ${Entry} Needed_Libraries: ${Needed_Libraries}")

  if ("<omp.h>" IN_LIST Needed_Libraries)
    find_package(OpenMP QUIET)
    if (OPENMP_FOUND)
      set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" PARENT_SCOPE)
      set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" PARENT_SCOPE)
    else()
      message("OpenMP NOT FOUND")
      set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp" PARENT_SCOPE)
      set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp" PARENT_SCOPE)
    endif()
  endif()

  if ("<CL/cl.h>" IN_LIST Needed_Libraries OR "<CL/cl.hpp>" IN_LIST Needed_Libraries)
      find_package(OpenCL REQUIRED)
      if (OPENCL_FOUND)
        include_directories (${OpenCL_INCLUDE_DIRS})
        link_directories(${OPENCL_LIBRARIES})
      endif()
  endif()
endfunction()

function(LinkLibraries Entry Needed_Libraries )
  message("LinkLibraries() Entry: ${Entry} Needed_Libraries: ${Needed_Libraries}")

  if ("<CL/cl.h>" IN_LIST Needed_Libraries OR "<CL/cl.hpp>" IN_LIST Needed_Libraries)
      find_package(OpenCL)
      if (OPENCL_FOUND)
        target_link_libraries (${Entry} ${OpenCL_LIBRARIES})
      endif()
  endif()

  if ("<pthread.h>" IN_LIST Needed_Libraries)
    target_link_libraries (${Entry} "pthread")
  endif()

  if ("<experimental/filesystem>" IN_LIST Needed_Libraries)
    target_link_libraries (${Entry} "stdc++fs")
  endif()

  if ("<yaml.h>" IN_LIST Needed_Libraries)
    target_link_libraries (${Entry} "yaml")
  endif()
endfunction()
