FindCEF.cmake 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
  2. # reserved. Use of this source code is governed by a BSD-style license that
  3. # can be found in the LICENSE file.
  4. #
  5. # This file is the CEF CMake configuration entry point and should be loaded
  6. # using `find_package(CEF REQUIRED)`. See the top-level CMakeLists.txt file
  7. # included with the CEF binary distribution for usage information.
  8. #
  9. # Find the CEF binary distribution root directory.
  10. set(_CEF_ROOT "")
  11. if(CEF_ROOT AND IS_DIRECTORY "${CEF_ROOT}")
  12. set(_CEF_ROOT "${CEF_ROOT}")
  13. set(_CEF_ROOT_EXPLICIT 1)
  14. else()
  15. set(_ENV_CEF_ROOT "")
  16. if(DEFINED ENV{CEF_ROOT})
  17. file(TO_CMAKE_PATH "$ENV{CEF_ROOT}" _ENV_CEF_ROOT)
  18. endif()
  19. if(_ENV_CEF_ROOT AND IS_DIRECTORY "${_ENV_CEF_ROOT}")
  20. set(_CEF_ROOT "${_ENV_CEF_ROOT}")
  21. set(_CEF_ROOT_EXPLICIT 1)
  22. endif()
  23. unset(_ENV_CEF_ROOT)
  24. endif()
  25. if(NOT DEFINED _CEF_ROOT_EXPLICIT)
  26. message(FATAL_ERROR "Must specify a CEF_ROOT value via CMake or environment variable.")
  27. endif()
  28. if(NOT IS_DIRECTORY "${_CEF_ROOT}/cmake")
  29. message(FATAL_ERROR "No CMake bootstrap found for CEF binary distribution at: ${CEF_ROOT}.")
  30. endif()
  31. # Execute additional cmake files from the CEF binary distribution.
  32. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${_CEF_ROOT}/cmake")
  33. include("cef_variables")
  34. include("cef_macros")