FindX11.cmake 914 B

123456789101112131415161718192021222324252627282930
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. # Open a new scope so we can make changes to CMAKE_MODULE_PATH, and restore it
  9. # when we're done
  10. function(FindX11)
  11. # O3DE's FindX11.cmake is a wrapper for the one that CMake provides. Remove
  12. # our current directory from CMAKE_MODULE_PATH to avoid recursive includes
  13. list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
  14. find_package(X11 COMPONENTS ${X11_FIND_COMPONENTS} QUIET)
  15. foreach(component IN LISTS X11_FIND_COMPONENTS)
  16. ly_add_external_target(
  17. SYSTEM
  18. PACKAGE X11
  19. NAME ${component}
  20. VERSION ""
  21. BUILD_DEPENDENCIES
  22. X11::${component}
  23. )
  24. endforeach()
  25. endfunction()
  26. FindX11()