From da4245925691cdeb191aad9b0bb4b49c4afbd600 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 6 Aug 2016 11:29:41 +0100 Subject: [PATCH] Use the minimal CEF distribution It's 1/2 or 1/5 (for Windows and Linux respectively) the size of the standard distribution, compressed. However, its CMakeLists.txt is an example for including into clients' configs, and doesn't work with ExternalProject_Add, so ship a slightly modified CMakeLists.txt to replace it (the only difference is the cefsimple and cefclient include_directory lines have been removed). --- CMakeLists.txt | 9 +++++---- scripts/cmake/CEF_CMakeLists.txt | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 scripts/cmake/CEF_CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fa3fe75..66243119 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,14 +112,14 @@ set(YAML_CPP_INCLUDE_DIRS "${SOURCE_DIR}/include") set(YAML_CPP_LIBRARIES "${BINARY_DIR}/${CMAKE_CFG_INTDIR}/libyaml-cpp${CMAKE_STATIC_LIBRARY_SUFFIX}") IF (CMAKE_SYSTEM_NAME MATCHES "Windows") - set(CEF_URL "http://opensource.spotify.com/cefbuilds/cef_binary_3.2743.1442.ge29124d_windows32.tar.bz2") - set(CEF_URL_HASH "1d8fd86c412b998d31e360600548b9932145e0df") + set(CEF_URL "http://opensource.spotify.com/cefbuilds/cef_binary_3.2743.1442.ge29124d_windows32_minimal.tar.bz2") + set(CEF_URL_HASH "8d0bb1ba2abccebef1e0d45fa2bb9c7ed7ec60de") set(CEF_PRECOMPILED_BINARIES "libcef.dll" "natives_blob.bin" "snapshot_blob.bin" "d3dcompiler_47.dll" "libEGL.dll" "libGLESv2.dll") set(CEF_CONFIG_DIR_NAME ${CMAKE_CFG_INTDIR}) set(CEF_LIB libcef${CMAKE_STATIC_LIBRARY_SUFFIX}) ELSE () - set(CEF_URL "http://opensource.spotify.com/cefbuilds/cef_binary_3.2743.1442.ge29124d_linux64.tar.bz2") - set(CEF_URL_HASH "d5ea04f2bb89f5977a546c8f32ff83509f6731c6") + set(CEF_URL "http://opensource.spotify.com/cefbuilds/cef_binary_3.2743.1442.ge29124d_linux64_minimal.tar.bz2") + set(CEF_URL_HASH "9a8f227d08d9c4edb6636041375b900d6b864e12") set(CEF_PRECOMPILED_BINARIES "libcef.so" "natives_blob.bin" "snapshot_blob.bin" "chrome-sandbox") set(CEF_CONFIG_DIR_NAME "Release") set(CEF_LIB libcef${CMAKE_SHARED_LIBRARY_SUFFIX}) @@ -129,6 +129,7 @@ ExternalProject_Add(cef PREFIX "external" URL ${CEF_URL} URL_HASH SHA1=${CEF_URL_HASH} + PATCH_COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/scripts/cmake/CEF_CMakeLists.txt" "${CMAKE_BINARY_DIR}/external/src/cef/CMakeLists.txt" CMAKE_ARGS -DUSE_SANDBOX=OFF BUILD_COMMAND ${CMAKE_COMMAND} --build . --target libcef_dll_wrapper --config $(CONFIGURATION) INSTALL_COMMAND "") diff --git a/scripts/cmake/CEF_CMakeLists.txt b/scripts/cmake/CEF_CMakeLists.txt new file mode 100644 index 00000000..94fddfce --- /dev/null +++ b/scripts/cmake/CEF_CMakeLists.txt @@ -0,0 +1,20 @@ +# 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. + +cmake_minimum_required(VERSION 2.8.12.1) + +set(CMAKE_CONFIGURATION_TYPES Debug Release) + +project(cef) + +set_property(GLOBAL PROPERTY OS_FOLDERS ON) + +set(CEF_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake") + +find_package(CEF REQUIRED) + +add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper) + +PRINT_CEF_CONFIG()