Config.cmake.in raw

   1  @PACKAGE_INIT@
   2  
   3  # CMake find_package compatible package file, for downstream CMake projects
   4  #
   5  # Based on https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html#adding-components
   6  
   7  set(_Libmultiprocess_supported_components Bin Lib)
   8  
   9  # If no components specified, include all components.
  10  list(LENGTH ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS_len)
  11  if(${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS_len EQUAL 0)
  12    set(${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS ${_Libmultiprocess_supported_components})
  13  endif()
  14  
  15  if ("Bin" IN_LIST ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
  16    include("${CMAKE_CURRENT_LIST_DIR}/TargetCapnpSources.cmake")
  17  endif()
  18  
  19  if ("Lib" IN_LIST ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
  20    # Setting FOUND_LIBATOMIC is needed on Debian & Ubuntu systems to work around bug in
  21    # their capnproto packages. See compat_find.cmake for a more complete explanation.
  22    set(FOUND_LIBATOMIC TRUE)
  23    include(CMakeFindDependencyMacro)
  24    find_dependency(CapnProto)
  25  endif()
  26  
  27  foreach(_comp ${${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS})
  28    if (NOT _comp IN_LIST _Libmultiprocess_supported_components)
  29      set(${CMAKE_FIND_PACKAGE_NAME}_FOUND False)
  30      set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}")
  31    endif()
  32    include("${CMAKE_CURRENT_LIST_DIR}/${_comp}Targets.cmake")
  33  endforeach()
  34