cef linux编译,cef 编译 linux,使用cmake

# 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:

#

# Linux: Ninja, Unix Makefiles

# Mac OS X: Ninja, Xcode 5+

# Windows: Ninja, Visual Studio 2010+

#

# 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:

#

# CMakeLists.txt Bootstrap that sets up the CMake environment.

# cmake/*.cmake CEF configuration files shared by all targets.

# libcef_dll/CMakeLists.txt Defines the libcef_dll_wrapper target.

# tests/*/CMakeLists.txt Defines the test application target.

#

# See the "TODO:" comments below for guidance on how to integrate this CEF

# binary distribution into a new or existing CMake project.

#

# BUILD REQUIREMENTS

#

# The below requirements must be met to build this CEF binary distribution.

#

# - CMake version 2.8.12.1 or newer.

#

# - Linux requirements:

# Currently supported distributions include Debian Wheezy, Ubuntu Precise, and

# related. Ubuntu 14.04 64-bit is recommended. Newer versions will likely also

# work but may not have been tested.

# Required packages include:

# build-essential

# libgtk2.0-dev (required by the cefclient target only)

# libgtkglext1-dev (required by the cefclient target only)

#

# - Mac OS X requirements:

# Xcode 5 or newer building on Mac OS X 10.9 (Mavericks) or newer. Xcode 8.3

# and OS X 10.12 are recommended. The Xcode command-line tools must also be

# installed. Only 64-bit builds are supported on OS X.

#

# - Windows requirements:

# Visual Studio 2010 or newer building on Windows 7 or newer. Visual Studio

# 2015 Update 3 and Windows 10 64-bit are recommended.

#

# 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

#

# To perform a Mac OS X build using a 64-bit CEF binary distribution:

# 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

#

# To perform a Windows build using a 32-bit CEF binary distribution:

# Using the Visual Studio 2015 IDE:

# > cmake -G "Visual Studio 14" ..

# Open build\cef.sln in Visual Studio and select Build > Build Solution.

#

# Using Ninja with Visual Studio 2015 command-line tools:

# (this path may be different depending on your Visual Studio installation)

# > "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"

# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..

# > ninja cefclient cefsimple

#

# To perform a Windows build using a 64-bit CEF binary distribution:

# Using the Visual Studio 2015 IDE:

# > cmake -G "Visual Studio 14 Win64" ..

# Open build\cef.sln in Visual Studio and select Build > Build Solution.

#

# Using Ninja with Visual Studio 2015 command-line tools:

# (this path may be different depending on your Visual Studio installation)

# > "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat"

# > cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug ..

# > ninja cefclient cefsimple

#

# Global setup.

#

cmake_minimum_required(VERSION 2.8.12.1)

# Only generate Debug and Release configuration types.

set(CMAKE_CONFIGURATION_TYPES Debug Release)

# Project name.

# TODO: Change this line to match your project name when you copy this file.

project(cef)

# Use folders in the resulting project files.

set_property(GLOBAL PROPERTY OS_FOLDERS ON)

#

# 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.

#

# Example 1: The current directory contains both the complete binary

# distribution and your project.

# A. Comment in these lines:

#

set(CEF_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")

# 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:

#

# set(CEF_ROOT "c:/path/to/cef_binary_3.2704.xxxx.gyyyyyyy_windows32")

# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")

# 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")

#

# Load the CEF configuration.

#

# Execute FindCEF.cmake which must exist in CMAKE_MODULE_PATH.

find_package(CEF REQUIRED)

#

# Define CEF-based targets.

#

# 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 /CMakeLists.txt file in the current directory.

# TODO: Change these lines to match your project target when you copy this file.

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests")

add_subdirectory(tests/cefsimple)

add_subdirectory(tests/gtest)

add_subdirectory(tests/ceftests)

endif()

if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/cefclient")

add_subdirectory(tests/cefclient)

endif()

# Display configuration settings.

PRINT_CEF_CONFIG()

标签:CEF,cmake,cef,binary,Visual,Studio,linux,distribution

来源: https://www.cnblogs.com/bigben0123/p/12583768.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CEF (Chromium Embedded Framework) 是基于 Chromium 的嵌入式框架,支持在应用程序中嵌入 Chromium 浏览器。CEF 支持多平台编译,包括 Windows、Linux 和 macOS。针对 ARM64 平台的编译,可以参考以下步骤: 1. 安装依赖项 在 Ubuntu 20.04 上,可以使用以下命令安装必要的依赖项: ``` sudo apt-get update sudo apt-get install -y build-essential cmake git libgtk-3-dev libssl-dev libudev-dev pkg-config ``` 2. 下载 CEF 源代码 从 CEF 官方网站下载最新的源代码,并解压到本地目录。 ``` wget https://cef-builds.spotifycdn.com/cef_binary_89.0.18%2Bgb62bacf%2Bchromium-89.0.4389.82_linuxarm64_minimal.tar.bz2 tar xvf cef_binary_89.0.18+gb62bacf+chromium-89.0.4389.82_linuxarm64_minimal.tar.bz2 ``` 3. 配置 CMake 进入 CEF 源代码目录,执行以下命令来配置 CMake: ``` cd cef_binary_89.0.18+gb62bacf+chromium-89.0.4389.82_linuxarm64_minimal mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=Release -DCEF_USE_SANDBOX=OFF -DCEF_USE_ATL=OFF -DCEF_USE_GNOME_KEYRING=OFF .. ``` 其中,`-DCMAKE_BUILD_TYPE=Release` 指定编译为 Release 模式,`-DCEF_USE_SANDBOX=OFF` 关闭沙箱,`-DCEF_USE_ATL=OFF` 关闭 ATL 支持,`-DCEF_USE_GNOME_KEYRING=OFF` 关闭 GNOME Keyring 支持。 4. 编译 CEF 执行以下命令进行编译: ``` make -j4 ``` 其中,`-j4` 指定使用 4 个线程进行编译。根据硬件配置和编译选项的不同,编译时间可能会有所不同。 5. 集成 CEF 编译完成后,在 build 目录下会生成相应的 CEF 库文件和示例程序。可以根据需要将 CEF 集成到自己的项目中。具体的集成方式可以参考 CEF 官方文档。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值