#
# cmake/_Libraries.cmake is generated by `mulle-sde`. Edits will be lost.
#
if( MULLE_TRACE_INCLUDE)
   message( STATUS "# Include \"${CMAKE_CURRENT_LIST_FILE}\"" )
endif()

# sourcetree: GL;no-all-load,no-header,no-import;
if( NOT GL_LIBRARY)
   find_library( GL_LIBRARY NAMES GL)
   message( STATUS "GL_LIBRARY is ${GL_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( GL_LIBRARY)
      #
      # Add to GL_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${GL_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_GL_ROOT "${GL_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_GL_ROOT "${_TMP_GL_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_GL_NAME "GL")
         set( _TMP_GL_DIR "${_TMP_GL_ROOT}/include/${_TMP_GL_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_GL_DIR}/DependenciesAndLibraries.cmake")
            unset( GL_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_GL_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_GL_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_GL_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${GL_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_GL_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "GL_LIBRARY was not found")
   endif()
endif()


# sourcetree: GLGLU;no-all-load,no-header,no-import;
if( NOT GLGLU_LIBRARY)
   find_library( GLGLU_LIBRARY NAMES GLU)
   message( STATUS "GLGLU_LIBRARY is ${GLGLU_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( GLGLU_LIBRARY)
      #
      # Add to GLGLU_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${GLGLU_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_GLGLU_ROOT "${GLGLU_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_GLGLU_ROOT "${_TMP_GLGLU_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_GLGLU_NAME "GLU")
         set( _TMP_GLGLU_DIR "${_TMP_GLGLU_ROOT}/include/${_TMP_GLGLU_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_GLGLU_DIR}/DependenciesAndLibraries.cmake")
            unset( GLGLU_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_GLGLU_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_GLGLU_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_GLGLU_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${GLGLU_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_GLGLU_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "GLGLU_LIBRARY was not found")
   endif()
endif()


# sourcetree: GLGLUX11;no-all-load,no-header,no-import;
if( NOT GLGLUX11_LIBRARY)
   find_library( GLGLUX11_LIBRARY NAMES X11)
   message( STATUS "GLGLUX11_LIBRARY is ${GLGLUX11_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( GLGLUX11_LIBRARY)
      #
      # Add to GLGLUX11_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${GLGLUX11_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_GLGLUX11_ROOT "${GLGLUX11_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_GLGLUX11_ROOT "${_TMP_GLGLUX11_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_GLGLUX11_NAME "X11")
         set( _TMP_GLGLUX11_DIR "${_TMP_GLGLUX11_ROOT}/include/${_TMP_GLGLUX11_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_GLGLUX11_DIR}/DependenciesAndLibraries.cmake")
            unset( GLGLUX11_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_GLGLUX11_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_GLGLUX11_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_GLGLUX11_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${GLGLUX11_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_GLGLUX11_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "GLGLUX11_LIBRARY was not found")
   endif()
endif()


# sourcetree: XRANDR;no-all-load,no-header,no-import;
if( NOT XRANDR_LIBRARY)
   find_library( XRANDR_LIBRARY NAMES Xrandr)
   message( STATUS "XRANDR_LIBRARY is ${XRANDR_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( XRANDR_LIBRARY)
      #
      # Add to XRANDR_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${XRANDR_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_XRANDR_ROOT "${XRANDR_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_XRANDR_ROOT "${_TMP_XRANDR_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_XRANDR_NAME "Xrandr")
         set( _TMP_XRANDR_DIR "${_TMP_XRANDR_ROOT}/include/${_TMP_XRANDR_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_XRANDR_DIR}/DependenciesAndLibraries.cmake")
            unset( XRANDR_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_XRANDR_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_XRANDR_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_XRANDR_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${XRANDR_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_XRANDR_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "XRANDR_LIBRARY was not found")
   endif()
endif()


# sourcetree: XXF86VM;no-all-load,no-header,no-import;
if( NOT XXF86VM_LIBRARY)
   find_library( XXF86VM_LIBRARY NAMES Xxf86vm)
   message( STATUS "XXF86VM_LIBRARY is ${XXF86VM_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( XXF86VM_LIBRARY)
      #
      # Add to XXF86VM_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${XXF86VM_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_XXF86VM_ROOT "${XXF86VM_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_XXF86VM_ROOT "${_TMP_XXF86VM_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_XXF86VM_NAME "Xxf86vm")
         set( _TMP_XXF86VM_DIR "${_TMP_XXF86VM_ROOT}/include/${_TMP_XXF86VM_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_XXF86VM_DIR}/DependenciesAndLibraries.cmake")
            unset( XXF86VM_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_XXF86VM_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_XXF86VM_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_XXF86VM_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${XXF86VM_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_XXF86VM_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "XXF86VM_LIBRARY was not found")
   endif()
endif()


# sourcetree: XINERAMA;no-all-load,no-header,no-import;
if( NOT XINERAMA_LIBRARY)
   find_library( XINERAMA_LIBRARY NAMES Xinerama)
   message( STATUS "XINERAMA_LIBRARY is ${XINERAMA_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( XINERAMA_LIBRARY)
      #
      # Add to XINERAMA_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${XINERAMA_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_XINERAMA_ROOT "${XINERAMA_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_XINERAMA_ROOT "${_TMP_XINERAMA_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_XINERAMA_NAME "Xinerama")
         set( _TMP_XINERAMA_DIR "${_TMP_XINERAMA_ROOT}/include/${_TMP_XINERAMA_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_XINERAMA_DIR}/DependenciesAndLibraries.cmake")
            unset( XINERAMA_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_XINERAMA_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_XINERAMA_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_XINERAMA_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${XINERAMA_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_XINERAMA_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "XINERAMA_LIBRARY was not found")
   endif()
endif()


# sourcetree: XCURSOR;no-all-load,no-header,no-import;
if( NOT XCURSOR_LIBRARY)
   find_library( XCURSOR_LIBRARY NAMES Xcursor)
   message( STATUS "XCURSOR_LIBRARY is ${XCURSOR_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( XCURSOR_LIBRARY)
      #
      # Add to XCURSOR_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${XCURSOR_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_XCURSOR_ROOT "${XCURSOR_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_XCURSOR_ROOT "${_TMP_XCURSOR_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_XCURSOR_NAME "Xcursor")
         set( _TMP_XCURSOR_DIR "${_TMP_XCURSOR_ROOT}/include/${_TMP_XCURSOR_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_XCURSOR_DIR}/DependenciesAndLibraries.cmake")
            unset( XCURSOR_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_XCURSOR_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_XCURSOR_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_XCURSOR_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${XCURSOR_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_XCURSOR_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "XCURSOR_LIBRARY was not found")
   endif()
endif()


# sourcetree: DL;no-all-load,no-header,no-import;
if( NOT DL_LIBRARY)
   find_library( DL_LIBRARY NAMES dl)
   message( STATUS "DL_LIBRARY is ${DL_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( DL_LIBRARY)
      #
      # Add to DL_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${DL_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_DL_ROOT "${DL_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_DL_ROOT "${_TMP_DL_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_DL_NAME "dl")
         set( _TMP_DL_DIR "${_TMP_DL_ROOT}/include/${_TMP_DL_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_DL_DIR}/DependenciesAndLibraries.cmake")
            unset( DL_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_DL_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_DL_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_DL_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${DL_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_DL_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "DL_LIBRARY was not found")
   endif()
endif()


# sourcetree: PTHREAD;no-all-load,no-header,no-import;
if( NOT PTHREAD_LIBRARY)
   find_library( PTHREAD_LIBRARY NAMES pthread)
   message( STATUS "PTHREAD_LIBRARY is ${PTHREAD_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( PTHREAD_LIBRARY)
      #
      # Add to PTHREAD_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${PTHREAD_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_PTHREAD_ROOT "${PTHREAD_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_PTHREAD_ROOT "${_TMP_PTHREAD_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_PTHREAD_NAME "pthread")
         set( _TMP_PTHREAD_DIR "${_TMP_PTHREAD_ROOT}/include/${_TMP_PTHREAD_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_PTHREAD_DIR}/DependenciesAndLibraries.cmake")
            unset( PTHREAD_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_PTHREAD_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_PTHREAD_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_PTHREAD_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${PTHREAD_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_PTHREAD_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "PTHREAD_LIBRARY was not found")
   endif()
endif()


# sourcetree: M;no-all-load,no-header,no-import;
if( NOT M_LIBRARY)
   find_library( M_LIBRARY NAMES m)
   message( STATUS "M_LIBRARY is ${M_LIBRARY}")
   #
   # the order looks ascending, but due to the way this file is read
   # it ends up being descending, which is what we need
   if( M_LIBRARY)
      #
      # Add to M_LIBRARY list.
      # Disable with: `mark no-cmakeadd`
      #
      set( OS_SPECIFIC_LIBRARIES
         ${OS_SPECIFIC_LIBRARIES}
         ${M_LIBRARY}
         CACHE INTERNAL "need to cache this"
      )
      #
      # Inherit ObjC loader and link dependency info.
      # Disable with: `mark no-cmakeinherit`
      #
      # // temporarily expand CMAKE_MODULE_PATH
      get_filename_component( _TMP_M_ROOT "${M_LIBRARY}" DIRECTORY)
      get_filename_component( _TMP_M_ROOT "${_TMP_M_ROOT}" DIRECTORY)
      #
      #
      # Search for "DependenciesAndLibraries.cmake" to include.
      # Disable with: `mark no-cmakedependency`
      #
      foreach( _TMP_M_NAME "m")
         set( _TMP_M_DIR "${_TMP_M_ROOT}/include/${_TMP_M_NAME}/cmake")
         # use explicit path to avoid "surprises"
         if( EXISTS "${_TMP_M_DIR}/DependenciesAndLibraries.cmake")
            unset( M_DEFINITIONS)
            list( INSERT CMAKE_MODULE_PATH 0 "${_TMP_M_DIR}")
            # we only want top level INHERIT_OBJC_LOADERS, so disable them
            if( NOT NO_INHERIT_OBJC_LOADERS)
               set( NO_INHERIT_OBJC_LOADERS OFF)
            endif()
            list( APPEND _TMP_INHERIT_OBJC_LOADERS ${NO_INHERIT_OBJC_LOADERS})
            set( NO_INHERIT_OBJC_LOADERS ON)
            #
            include( "${_TMP_M_DIR}/DependenciesAndLibraries.cmake")
            #
            list( GET _TMP_INHERIT_OBJC_LOADERS -1 NO_INHERIT_OBJC_LOADERS)
            list( REMOVE_AT _TMP_INHERIT_OBJC_LOADERS -1)
            #
            list( REMOVE_ITEM CMAKE_MODULE_PATH "${_TMP_M_DIR}")
            set( INHERITED_DEFINITIONS
               ${INHERITED_DEFINITIONS}
               ${M_DEFINITIONS}
               CACHE INTERNAL "need to cache this"
            )
            break()
         else()
            message( STATUS "${_TMP_M_DIR}/DependenciesAndLibraries.cmake not found")
         endif()
      endforeach()
   else()
      message( FATAL_ERROR "M_LIBRARY was not found")
   endif()
endif()
