2014-12-13 21:18:31 +01:00
|
|
|
# Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
|
|
|
|
# reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
# can be found in the LICENSE file.
|
|
|
|
|
|
|
|
# OVERVIEW
|
|
|
|
#
|
|
|
|
# CMake is a cross-platform open-source build system that can generate project
|
|
|
|
# files in many different formats. It can be downloaded from
|
|
|
|
# http://www.cmake.org or installed via a platform package manager.
|
|
|
|
#
|
|
|
|
# CMake-generated project formats that have been tested with this CEF binary
|
|
|
|
# distribution include:
|
|
|
|
#
|
2021-06-22 23:50:33 +02:00
|
|
|
# Linux: Ninja, GCC 7.5.0+, Unix Makefiles
|
2023-12-06 19:18:23 +01:00
|
|
|
# MacOS: Ninja, Xcode 12.2 to 15.0
|
2023-06-01 12:03:29 +02:00
|
|
|
# Windows: Ninja, Visual Studio 2022
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
|
|
|
# Ninja is a cross-platform open-source tool for running fast builds using
|
|
|
|
# pre-installed platform toolchains (GNU, clang, Xcode or MSVC). It can be
|
|
|
|
# downloaded from http://martine.github.io/ninja/ or installed via a platform
|
|
|
|
# package manager.
|
|
|
|
#
|
|
|
|
# CMAKE STRUCTURE
|
|
|
|
#
|
|
|
|
# This CEF binary distribution includes the following CMake files:
|
|
|
|
#
|
2016-05-12 23:41:30 +02:00
|
|
|
# CMakeLists.txt Bootstrap that sets up the CMake environment.
|
|
|
|
# cmake/*.cmake CEF configuration files shared by all targets.
|
2014-12-13 21:18:31 +01:00
|
|
|
# libcef_dll/CMakeLists.txt Defines the libcef_dll_wrapper target.
|
2016-11-18 00:52:42 +01:00
|
|
|
# tests/*/CMakeLists.txt Defines the test application target.
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
2016-05-12 23:41:30 +02:00
|
|
|
# See the "TODO:" comments below for guidance on how to integrate this CEF
|
|
|
|
# binary distribution into a new or existing CMake project.
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
|
|
|
# BUILD REQUIREMENTS
|
|
|
|
#
|
|
|
|
# The below requirements must be met to build this CEF binary distribution.
|
|
|
|
#
|
2023-12-06 19:18:23 +01:00
|
|
|
# - CMake version 3.21 or newer.
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
|
|
|
# - Linux requirements:
|
2021-06-22 23:50:33 +02:00
|
|
|
# Currently supported distributions include Debian 10 (Buster), Ubuntu 18
|
|
|
|
# (Bionic Beaver), and related. Ubuntu 18.04 64-bit with GCC 7.5.0+ is
|
|
|
|
# recommended. Newer versions will likely also work but may not have been
|
|
|
|
# tested.
|
2014-12-13 21:18:31 +01:00
|
|
|
# Required packages include:
|
|
|
|
# build-essential
|
2021-03-01 20:41:27 +01:00
|
|
|
# libgtk3.0-dev (required by the cefclient target only)
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
2020-07-21 22:12:33 +02:00
|
|
|
# - MacOS requirements:
|
2024-08-26 14:44:25 +02:00
|
|
|
# Xcode 12.2 to 15.4 building on MacOS 11.0 (Big Sur) or newer. The Xcode
|
|
|
|
# command-line tools must also be installed. Newer Xcode versions may not have
|
|
|
|
# been been tested and are not recommended.
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
|
|
|
# - Windows requirements:
|
2023-06-01 12:03:29 +02:00
|
|
|
# Visual Studio 2022 building on Windows 10 or newer. Windows 10/11 64-bit is
|
|
|
|
# recommended. Newer versions will likely also work but may not have been
|
|
|
|
# tested.
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
|
|
|
# BUILD EXAMPLES
|
|
|
|
#
|
|
|
|
# The below commands will generate project files and create a Debug build of all
|
|
|
|
# CEF targets using CMake and the platform toolchain.
|
|
|
|
#
|
|
|
|
# Start by creating and entering the CMake build output directory:
|
|
|
|
# > cd path/to/cef_binary_*
|
|
|
|
# > mkdir build && cd build
|
|
|
|
#
|
|
|
|
# To perform a Linux build using a 32-bit CEF binary distribution on a 32-bit
|
|
|
|
# Linux platform or a 64-bit CEF binary distribution on a 64-bit Linux platform:
|
|
|
|
# Using Unix Makefiles:
|
|
|
|
# > cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
|
|
|
|
# > make -j4 cefclient cefsimple
|
|
|
|
#
|
|
|
|
# Using Ninja:
|
|
|
|
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
|
|
|
# > ninja cefclient cefsimple
|
|
|
|
#
|
2020-07-21 22:12:33 +02:00
|
|
|
# To perform a MacOS build using a 64-bit CEF binary distribution:
|
2014-12-13 21:18:31 +01:00
|
|
|
# Using the Xcode IDE:
|
|
|
|
# > cmake -G "Xcode" -DPROJECT_ARCH="x86_64" ..
|
|
|
|
# Open build\cef.xcodeproj in Xcode and select Product > Build.
|
|
|
|
#
|
|
|
|
# Using Ninja:
|
|
|
|
# > cmake -G "Ninja" -DPROJECT_ARCH="x86_64" -DCMAKE_BUILD_TYPE=Debug ..
|
|
|
|
# > ninja cefclient cefsimple
|
|
|
|
#
|
2020-11-20 22:00:56 +01:00
|
|
|
# To perform a MacOS build using an ARM64 CEF binary distribution:
|
|
|
|
# Using the Xcode IDE:
|
|
|
|
# > cmake -G "Xcode" -DPROJECT_ARCH="arm64" ..
|
|
|
|
# Open build\cef.xcodeproj in Xcode and select Product > Build.
|
|
|
|
#
|
|
|
|
# Using Ninja:
|
|
|
|
# > cmake -G "Ninja" -DPROJECT_ARCH="arm64" -DCMAKE_BUILD_TYPE=Debug ..
|
|
|
|
# > ninja cefclient cefsimple
|
|
|
|
#
|
2014-12-13 21:18:31 +01:00
|
|
|
# To perform a Windows build using a 32-bit CEF binary distribution:
|
2023-06-01 12:03:29 +02:00
|
|
|
# Using the Visual Studio 2022 IDE:
|
|
|
|
# > cmake -G "Visual Studio 17" -A Win32 ..
|
2014-12-13 21:18:31 +01:00
|
|
|
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
|
|
|
|
#
|
2023-06-01 12:03:29 +02:00
|
|
|
# Using Ninja with Visual Studio 2022 command-line tools:
|
2014-12-13 21:18:31 +01:00
|
|
|
# (this path may be different depending on your Visual Studio installation)
|
2023-06-01 12:03:29 +02:00
|
|
|
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars32.bat"
|
2014-12-13 21:18:31 +01:00
|
|
|
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
|
|
|
# > ninja cefclient cefsimple
|
|
|
|
#
|
|
|
|
# To perform a Windows build using a 64-bit CEF binary distribution:
|
2023-06-01 12:03:29 +02:00
|
|
|
# Using the Visual Studio 2022 IDE:
|
|
|
|
# > cmake -G "Visual Studio 17" -A x64 ..
|
2014-12-13 21:18:31 +01:00
|
|
|
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
|
|
|
|
#
|
2023-06-01 12:03:29 +02:00
|
|
|
# Using Ninja with Visual Studio 2022 command-line tools:
|
2014-12-13 21:18:31 +01:00
|
|
|
# (this path may be different depending on your Visual Studio installation)
|
2023-06-01 12:03:29 +02:00
|
|
|
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat"
|
2014-12-13 21:18:31 +01:00
|
|
|
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
|
|
|
# > ninja cefclient cefsimple
|
2020-12-15 20:11:11 +01:00
|
|
|
#
|
|
|
|
# To perform a Windows build using an ARM64 CEF binary distribution:
|
2023-06-01 12:03:29 +02:00
|
|
|
# Using the Visual Studio 2022 IDE:
|
|
|
|
# > cmake -G "Visual Studio 17" -A arm64 ..
|
2020-12-15 20:11:11 +01:00
|
|
|
# Open build\cef.sln in Visual Studio and select Build > Build Solution.
|
|
|
|
#
|
2023-06-01 12:03:29 +02:00
|
|
|
# Using Ninja with Visual Studio 2022 command-line tools:
|
2020-12-15 20:11:11 +01:00
|
|
|
# (this path may be different depending on your Visual Studio installation)
|
2023-06-01 12:03:29 +02:00
|
|
|
# > "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
|
2020-12-15 20:11:11 +01:00
|
|
|
# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..
|
|
|
|
# > ninja cefsimple
|
2014-12-13 21:18:31 +01:00
|
|
|
|
|
|
|
#
|
2016-05-12 23:41:30 +02:00
|
|
|
# Global setup.
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
|
|
|
|
2023-06-01 12:03:29 +02:00
|
|
|
# For VS2022 and Xcode 12+ support.
|
|
|
|
cmake_minimum_required(VERSION 3.21)
|
2014-12-13 21:18:31 +01:00
|
|
|
|
|
|
|
# Only generate Debug and Release configuration types.
|
|
|
|
set(CMAKE_CONFIGURATION_TYPES Debug Release)
|
|
|
|
|
|
|
|
# Project name.
|
2016-05-12 23:41:30 +02:00
|
|
|
# TODO: Change this line to match your project name when you copy this file.
|
2014-12-13 21:18:31 +01:00
|
|
|
project(cef)
|
|
|
|
|
|
|
|
# Use folders in the resulting project files.
|
|
|
|
set_property(GLOBAL PROPERTY OS_FOLDERS ON)
|
|
|
|
|
|
|
|
|
|
|
|
#
|
2016-05-12 23:41:30 +02:00
|
|
|
# CEF_ROOT setup.
|
|
|
|
# This variable must be set to locate the binary distribution.
|
|
|
|
# TODO: Choose one of the below examples and comment out the rest.
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
|
|
|
|
2016-05-12 23:41:30 +02:00
|
|
|
# Example 1: The current directory contains both the complete binary
|
|
|
|
# distribution and your project.
|
|
|
|
# A. Comment in these lines:
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
2016-05-12 23:41:30 +02:00
|
|
|
set(CEF_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")
|
2014-12-13 21:18:31 +01:00
|
|
|
|
2016-05-12 23:41:30 +02:00
|
|
|
# Example 2: The binary distribution is in a separate directory from your
|
|
|
|
# project. Locate the binary distribution using the CEF_ROOT CMake
|
|
|
|
# variable.
|
|
|
|
# A. Create a directory structure for your project like the following:
|
|
|
|
# myproject/
|
|
|
|
# CMakeLists.txt <= top-level CMake configuration
|
|
|
|
# mytarget/
|
|
|
|
# CMakeLists.txt <= CMake configuration for `mytarget`
|
|
|
|
# ... other `mytarget` source files
|
|
|
|
# B. Copy this file to "myproject/CMakeLists.txt" as the top-level CMake
|
|
|
|
# configuration.
|
|
|
|
# C. Create the target-specific "myproject/mytarget/CMakeLists.txt" file for
|
|
|
|
# your application. See the included cefclient and cefsimple CMakeLists.txt
|
|
|
|
# files as an example.
|
|
|
|
# D. Comment in these lines:
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
2016-05-12 23:41:30 +02:00
|
|
|
# set(CEF_ROOT "c:/path/to/cef_binary_3.2704.xxxx.gyyyyyyy_windows32")
|
|
|
|
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")
|
2014-12-13 21:18:31 +01:00
|
|
|
|
2016-05-12 23:41:30 +02:00
|
|
|
# Example 3: The binary distribution is in a separate directory from your
|
|
|
|
# project. Locate the binary distribution using the CEF_ROOT
|
|
|
|
# environment variable.
|
|
|
|
# A. Create a directory structure for your project like the following:
|
|
|
|
# myproject/
|
|
|
|
# CMakeLists.txt <= top-level CMake configuration
|
|
|
|
# cmake/
|
|
|
|
# FindCEF.cmake <= CEF CMake configuration entry point
|
|
|
|
# mytarget/
|
|
|
|
# CMakeLists.txt <= CMake configuration for `mytarget`
|
|
|
|
# ... other `mytarget` source files
|
|
|
|
# B. Copy this file to "myproject/CMakeLists.txt" as the top-level CMake
|
|
|
|
# configuration.
|
|
|
|
# C. Copy the cmake/FindCEF.cmake file to "myproject/cmake/FindCEF.cmake".
|
|
|
|
# D. Create the target-specific "myproject/mytarget/CMakeLists.txt" file for
|
|
|
|
# your application. See the included cefclient and cefsimple CMakeLists.txt
|
|
|
|
# files as an example.
|
|
|
|
# E. Set the CEF_ROOT environment variable before executing CMake. For example:
|
|
|
|
# > set CEF_ROOT=c:\path\to\cef_binary_3.2704.xxxx.gyyyyyyy_windows32
|
|
|
|
# F. Comment in these lines:
|
|
|
|
#
|
|
|
|
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
2014-12-13 21:18:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
#
|
2016-05-12 23:41:30 +02:00
|
|
|
# Load the CEF configuration.
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
|
|
|
|
2016-05-12 23:41:30 +02:00
|
|
|
# Execute FindCEF.cmake which must exist in CMAKE_MODULE_PATH.
|
|
|
|
find_package(CEF REQUIRED)
|
2014-12-13 21:18:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
#
|
2016-05-12 23:41:30 +02:00
|
|
|
# Define CEF-based targets.
|
2014-12-13 21:18:31 +01:00
|
|
|
#
|
|
|
|
|
2016-05-12 23:41:30 +02:00
|
|
|
# Include the libcef_dll_wrapper target.
|
|
|
|
# Comes from the libcef_dll/CMakeLists.txt file in the binary distribution
|
|
|
|
# directory.
|
|
|
|
add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)
|
|
|
|
|
|
|
|
# Include application targets.
|
|
|
|
# Comes from the <target>/CMakeLists.txt file in the current directory.
|
|
|
|
# TODO: Change these lines to match your project target when you copy this file.
|
2017-12-27 21:50:38 +01:00
|
|
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
|
2017-05-12 08:27:28 +02:00
|
|
|
add_subdirectory(tests/cefsimple)
|
|
|
|
add_subdirectory(tests/gtest)
|
|
|
|
add_subdirectory(tests/ceftests)
|
|
|
|
endif()
|
2014-12-13 21:18:31 +01:00
|
|
|
|
2019-04-23 19:00:14 +02:00
|
|
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/cefclient")
|
|
|
|
add_subdirectory(tests/cefclient)
|
|
|
|
endif()
|
|
|
|
|
2014-12-13 21:18:31 +01:00
|
|
|
# Display configuration settings.
|
2016-05-12 23:41:30 +02:00
|
|
|
PRINT_CEF_CONFIG()
|
2022-09-02 19:10:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Define the API documentation target.
|
|
|
|
#
|
|
|
|
|
2024-06-06 15:54:11 +02:00
|
|
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile")
|
|
|
|
find_package(Doxygen)
|
|
|
|
if(DOXYGEN_FOUND)
|
|
|
|
add_custom_target(apidocs ALL
|
|
|
|
# Generate documentation in the docs/html directory.
|
|
|
|
COMMAND "${DOXYGEN_EXECUTABLE}" Doxyfile
|
|
|
|
# Write a docs/index.html file.
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL='html/index.html'\"/></head></html>" > docs/index.html
|
|
|
|
WORKING_DIRECTORY "${CEF_ROOT}"
|
|
|
|
COMMENT "Generating API documentation with Doxygen..."
|
|
|
|
VERBATIM )
|
|
|
|
else()
|
|
|
|
message(WARNING "Doxygen must be installed to generate API documentation.")
|
|
|
|
endif()
|
2024-08-26 14:44:25 +02:00
|
|
|
endif()
|