• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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# Must be loaded via FindCEF.cmake.
6if(NOT DEFINED _CEF_ROOT_EXPLICIT)
7  message(FATAL_ERROR "Use find_package(CEF) to load this file.")
8endif()
9
10
11#
12# Shared configuration.
13#
14
15# Determine the platform.
16if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
17  set(OS_MAC 1)
18  set(OS_MACOSX 1)  # For backwards compatibility.
19  set(OS_POSIX 1)
20elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
21  set(OS_LINUX 1)
22  set(OS_POSIX 1)
23elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
24  set(OS_WINDOWS 1)
25endif()
26
27# Determine the project architecture.
28if(NOT DEFINED PROJECT_ARCH)
29  if(OS_WINDOWS AND "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "arm64")
30    set(PROJECT_ARCH "arm64")
31  elseif(CMAKE_SIZEOF_VOID_P MATCHES 8)
32    set(PROJECT_ARCH "x86_64")
33  else()
34    set(PROJECT_ARCH "x86")
35  endif()
36
37  if(OS_MAC)
38    # PROJECT_ARCH should be specified on Mac OS X.
39    message(WARNING "No PROJECT_ARCH value specified, using ${PROJECT_ARCH}")
40  endif()
41endif()
42
43if(${CMAKE_GENERATOR} STREQUAL "Ninja")
44  set(GEN_NINJA 1)
45elseif(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
46  set(GEN_MAKEFILES 1)
47endif()
48
49# Determine the build type.
50if(NOT CMAKE_BUILD_TYPE AND (GEN_NINJA OR GEN_MAKEFILES))
51  # CMAKE_BUILD_TYPE should be specified when using Ninja or Unix Makefiles.
52  set(CMAKE_BUILD_TYPE Release)
53  message(WARNING "No CMAKE_BUILD_TYPE value selected, using ${CMAKE_BUILD_TYPE}")
54endif()
55
56
57# Path to the include directory.
58set(CEF_INCLUDE_PATH "${_CEF_ROOT}")
59
60# Path to the libcef_dll_wrapper target.
61set(CEF_LIBCEF_DLL_WRAPPER_PATH "${_CEF_ROOT}/libcef_dll")
62
63
64# Shared compiler/linker flags.
65list(APPEND CEF_COMPILER_DEFINES
66  # Allow C++ programs to use stdint.h macros specified in the C99 standard that aren't
67  # in the C++ standard (e.g. UINT8_MAX, INT64_MIN, etc)
68  __STDC_CONSTANT_MACROS __STDC_FORMAT_MACROS
69  )
70
71
72# Configure use of the sandbox.
73option(USE_SANDBOX "Enable or disable use of the sandbox." ON)
74
75
76#
77# Linux configuration.
78#
79
80if(OS_LINUX)
81  # Platform-specific compiler/linker flags.
82  set(CEF_LIBTYPE SHARED)
83  list(APPEND CEF_COMPILER_FLAGS
84    -fno-strict-aliasing            # Avoid assumptions regarding non-aliasing of objects of different types
85    -fPIC                           # Generate position-independent code for shared libraries
86    -fstack-protector               # Protect some vulnerable functions from stack-smashing (security feature)
87    -funwind-tables                 # Support stack unwinding for backtrace()
88    -fvisibility=hidden             # Give hidden visibility to declarations that are not explicitly marked as visible
89    --param=ssp-buffer-size=4       # Set the minimum buffer size protected by SSP (security feature, related to stack-protector)
90    -pipe                           # Use pipes rather than temporary files for communication between build stages
91    -pthread                        # Use the pthread library
92    -Wall                           # Enable all warnings
93    -Werror                         # Treat warnings as errors
94    -Wno-missing-field-initializers # Don't warn about missing field initializers
95    -Wno-unused-parameter           # Don't warn about unused parameters
96    -Wno-error=comment              # Don't warn about code in comments
97    -Wno-comment                    # Don't warn about code in comments
98    -Wno-deprecated-declarations    # Don't warn about using deprecated methods
99    )
100  list(APPEND CEF_C_COMPILER_FLAGS
101    -std=c99                        # Use the C99 language standard
102    )
103  list(APPEND CEF_CXX_COMPILER_FLAGS
104    -fno-exceptions                 # Disable exceptions
105    -fno-rtti                       # Disable real-time type information
106    -fno-threadsafe-statics         # Don't generate thread-safe statics
107    -fvisibility-inlines-hidden     # Give hidden visibility to inlined class member functions
108    -std=c++14                      # Use the C++14 language standard
109    -Wsign-compare                  # Warn about mixed signed/unsigned type comparisons
110    )
111  list(APPEND CEF_COMPILER_FLAGS_DEBUG
112    -O0                             # Disable optimizations
113    -g                              # Generate debug information
114    )
115  list(APPEND CEF_COMPILER_FLAGS_RELEASE
116    -O2                             # Optimize for maximum speed
117    -fdata-sections                 # Enable linker optimizations to improve locality of reference for data sections
118    -ffunction-sections             # Enable linker optimizations to improve locality of reference for function sections
119    -fno-ident                      # Ignore the #ident directive
120    -U_FORTIFY_SOURCE               # Undefine _FORTIFY_SOURCE in case it was previously defined
121    -D_FORTIFY_SOURCE=2             # Add memory and string function protection (security feature, related to stack-protector)
122    )
123  list(APPEND CEF_LINKER_FLAGS
124    -fPIC                           # Generate position-independent code for shared libraries
125    -pthread                        # Use the pthread library
126    -Wl,--disable-new-dtags         # Don't generate new-style dynamic tags in ELF
127    -Wl,--fatal-warnings            # Treat warnings as errors
128    -Wl,-rpath,.                    # Set rpath so that libraries can be placed next to the executable
129    -Wl,-z,noexecstack              # Mark the stack as non-executable (security feature)
130    -Wl,-z,now                      # Resolve symbols on program start instead of on first use (security feature)
131    -Wl,-z,relro                    # Mark relocation sections as read-only (security feature)
132    )
133  list(APPEND CEF_LINKER_FLAGS_RELEASE
134    -Wl,-O1                         # Enable linker optimizations
135    -Wl,--as-needed                 # Only link libraries that export symbols used by the binary
136    -Wl,--gc-sections               # Remove unused code resulting from -fdata-sections and -function-sections
137    )
138  list(APPEND CEF_COMPILER_DEFINES
139    _FILE_OFFSET_BITS=64            # Allow the Large File Support (LFS) interface to replace the old interface
140    )
141  list(APPEND CEF_COMPILER_DEFINES_RELEASE
142    NDEBUG                          # Not a debug build
143    )
144
145  include(CheckCCompilerFlag)
146  include(CheckCXXCompilerFlag)
147
148  CHECK_CXX_COMPILER_FLAG(-Wno-undefined-var-template COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
149  if(COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
150    list(APPEND CEF_CXX_COMPILER_FLAGS
151      -Wno-undefined-var-template   # Don't warn about potentially uninstantiated static members
152      )
153  endif()
154
155  CHECK_C_COMPILER_FLAG(-Wno-unused-local-typedefs COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS)
156  if(COMPILER_SUPPORTS_NO_UNUSED_LOCAL_TYPEDEFS)
157    list(APPEND CEF_C_COMPILER_FLAGS
158      -Wno-unused-local-typedefs  # Don't warn about unused local typedefs
159      )
160  endif()
161
162  CHECK_CXX_COMPILER_FLAG(-Wno-literal-suffix COMPILER_SUPPORTS_NO_LITERAL_SUFFIX)
163  if(COMPILER_SUPPORTS_NO_LITERAL_SUFFIX)
164    list(APPEND CEF_CXX_COMPILER_FLAGS
165      -Wno-literal-suffix         # Don't warn about invalid suffixes on literals
166      )
167  endif()
168
169  CHECK_CXX_COMPILER_FLAG(-Wno-narrowing COMPILER_SUPPORTS_NO_NARROWING)
170  if(COMPILER_SUPPORTS_NO_NARROWING)
171    list(APPEND CEF_CXX_COMPILER_FLAGS
172      -Wno-narrowing              # Don't warn about type narrowing
173      )
174  endif()
175
176  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
177    list(APPEND CEF_CXX_COMPILER_FLAGS
178      -Wno-attributes             # The cfi-icall attribute is not supported by the GNU C++ compiler
179      )
180  endif()
181
182  if(PROJECT_ARCH STREQUAL "x86_64")
183    # 64-bit architecture.
184    list(APPEND CEF_COMPILER_FLAGS
185      -m64
186      -march=x86-64
187      )
188    list(APPEND CEF_LINKER_FLAGS
189      -m64
190      )
191  elseif(PROJECT_ARCH STREQUAL "x86")
192    # 32-bit architecture.
193    list(APPEND CEF_COMPILER_FLAGS
194      -msse2
195      -mfpmath=sse
196      -mmmx
197      -m32
198      )
199    list(APPEND CEF_LINKER_FLAGS
200      -m32
201      )
202  endif()
203
204  # Standard libraries.
205  set(CEF_STANDARD_LIBS
206    X11
207    )
208
209  # CEF directory paths.
210  set(CEF_RESOURCE_DIR        "${_CEF_ROOT}/Resources")
211  set(CEF_BINARY_DIR          "${_CEF_ROOT}/${CMAKE_BUILD_TYPE}")
212  set(CEF_BINARY_DIR_DEBUG    "${_CEF_ROOT}/Debug")
213  set(CEF_BINARY_DIR_RELEASE  "${_CEF_ROOT}/Release")
214
215  # CEF library paths.
216  set(CEF_LIB_DEBUG   "${CEF_BINARY_DIR_DEBUG}/libcef.so")
217  set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/libcef.so")
218
219  # List of CEF binary files.
220  set(CEF_BINARY_FILES
221    chrome-sandbox
222    libcef.so
223    libEGL.so
224    libGLESv2.so
225    libvk_swiftshader.so
226    libvulkan.so.1
227    snapshot_blob.bin
228    v8_context_snapshot.bin
229    vk_swiftshader_icd.json
230    swiftshader
231    )
232
233  # List of CEF resource files.
234  set(CEF_RESOURCE_FILES
235    chrome_100_percent.pak
236    chrome_200_percent.pak
237    resources.pak
238    icudtl.dat
239    locales
240    )
241
242  if(USE_SANDBOX)
243    list(APPEND CEF_COMPILER_DEFINES
244      CEF_USE_SANDBOX   # Used by apps to test if the sandbox is enabled
245      )
246  endif()
247endif()
248
249
250#
251# Mac OS X configuration.
252#
253
254if(OS_MAC)
255  # Platform-specific compiler/linker flags.
256  # See also Xcode target properties in cef_macros.cmake.
257  set(CEF_LIBTYPE SHARED)
258  list(APPEND CEF_COMPILER_FLAGS
259    -fno-strict-aliasing            # Avoid assumptions regarding non-aliasing of objects of different types
260    -fstack-protector               # Protect some vulnerable functions from stack-smashing (security feature)
261    -funwind-tables                 # Support stack unwinding for backtrace()
262    -fvisibility=hidden             # Give hidden visibility to declarations that are not explicitly marked as visible
263    -Wall                           # Enable all warnings
264    -Werror                         # Treat warnings as errors
265    -Wextra                         # Enable additional warnings
266    -Wendif-labels                  # Warn whenever an #else or an #endif is followed by text
267    -Wnewline-eof                   # Warn about no newline at end of file
268    -Wno-missing-field-initializers # Don't warn about missing field initializers
269    -Wno-unused-parameter           # Don't warn about unused parameters
270    )
271  list(APPEND CEF_C_COMPILER_FLAGS
272    -std=c99                        # Use the C99 language standard
273    )
274  list(APPEND CEF_CXX_COMPILER_FLAGS
275    -fno-exceptions                 # Disable exceptions
276    -fno-rtti                       # Disable real-time type information
277    -fno-threadsafe-statics         # Don't generate thread-safe statics
278    -fobjc-call-cxx-cdtors          # Call the constructor/destructor of C++ instance variables in ObjC objects
279    -fvisibility-inlines-hidden     # Give hidden visibility to inlined class member functions
280    -std=c++14                      # Use the C++14 language standard
281    -Wno-narrowing                  # Don't warn about type narrowing
282    -Wsign-compare                  # Warn about mixed signed/unsigned type comparisons
283    )
284  list(APPEND CEF_COMPILER_FLAGS_DEBUG
285    -O0                             # Disable optimizations
286    -g                              # Generate debug information
287    )
288  list(APPEND CEF_COMPILER_FLAGS_RELEASE
289    -O3                             # Optimize for maximum speed plus a few extras
290    )
291  list(APPEND CEF_LINKER_FLAGS
292    -Wl,-search_paths_first         # Search for static or shared library versions in the same pass
293    -Wl,-ObjC                       # Support creation of ObjC static libraries
294    -Wl,-pie                        # Generate position-independent code suitable for executables only
295    )
296  list(APPEND CEF_LINKER_FLAGS_RELEASE
297    -Wl,-dead_strip                 # Strip dead code
298    )
299
300  include(CheckCXXCompilerFlag)
301
302  CHECK_CXX_COMPILER_FLAG(-Wno-undefined-var-template COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
303  if(COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE)
304    list(APPEND CEF_CXX_COMPILER_FLAGS
305      -Wno-undefined-var-template   # Don't warn about potentially uninstantiated static members
306      )
307  endif()
308
309  # Standard libraries.
310  set(CEF_STANDARD_LIBS
311    -lpthread
312    "-framework Cocoa"
313    "-framework AppKit"
314    )
315
316  # Find the newest available base SDK.
317  execute_process(COMMAND xcode-select --print-path OUTPUT_VARIABLE XCODE_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
318  foreach(OS_VERSION 10.15 10.14 10.13 10.12 10.11)
319    set(SDK "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OS_VERSION}.sdk")
320    if(NOT "${CMAKE_OSX_SYSROOT}" AND EXISTS "${SDK}" AND IS_DIRECTORY "${SDK}")
321      set(CMAKE_OSX_SYSROOT ${SDK})
322    endif()
323  endforeach()
324
325  # Target SDK.
326  set(CEF_TARGET_SDK               "10.11")
327  list(APPEND CEF_COMPILER_FLAGS
328    -mmacosx-version-min=${CEF_TARGET_SDK}
329  )
330  set(CMAKE_OSX_DEPLOYMENT_TARGET  ${CEF_TARGET_SDK})
331
332  # Target architecture.
333  if(PROJECT_ARCH STREQUAL "x86_64")
334    set(CMAKE_OSX_ARCHITECTURES "x86_64")
335  elseif(PROJECT_ARCH STREQUAL "arm64")
336    set(CMAKE_OSX_ARCHITECTURES "arm64")
337  else()
338    set(CMAKE_OSX_ARCHITECTURES "i386")
339  endif()
340
341  # Prevent Xcode 11 from doing automatic codesigning.
342  set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
343
344  # CEF directory paths.
345  set(CEF_BINARY_DIR          "${_CEF_ROOT}/$<CONFIGURATION>")
346  set(CEF_BINARY_DIR_DEBUG    "${_CEF_ROOT}/Debug")
347  set(CEF_BINARY_DIR_RELEASE  "${_CEF_ROOT}/Release")
348
349  if(USE_SANDBOX)
350    list(APPEND CEF_COMPILER_DEFINES
351      CEF_USE_SANDBOX   # Used by apps to test if the sandbox is enabled
352      )
353
354    # CEF sandbox library paths.
355    set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a")
356    set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a")
357  endif()
358
359  # CEF Helper app suffixes.
360  # Format is "<name suffix>:<target suffix>:<plist suffix>".
361  set(CEF_HELPER_APP_SUFFIXES
362    "::"
363    " (GPU):_gpu:.gpu"
364    " (Plugin):_plugin:.plugin"
365    " (Renderer):_renderer:.renderer"
366    )
367endif()
368
369
370#
371# Windows configuration.
372#
373
374if(OS_WINDOWS)
375  if (GEN_NINJA)
376    # When using the Ninja generator clear the CMake defaults to avoid excessive
377    # console warnings (see issue #2120).
378    set(CMAKE_CXX_FLAGS "")
379    set(CMAKE_CXX_FLAGS_DEBUG "")
380    set(CMAKE_CXX_FLAGS_RELEASE "")
381  endif()
382
383  if(USE_SANDBOX)
384    # Check if the current MSVC version is compatible with the cef_sandbox.lib
385    # static library. We require VS2015 or newer.
386    if(MSVC_VERSION LESS 1900)
387      message(WARNING "CEF sandbox is not compatible with the current MSVC version (${MSVC_VERSION})")
388      set(USE_SANDBOX OFF)
389    endif()
390  endif()
391
392  # Consumers who run into LNK4099 warnings can pass /Z7 instead (see issue #385).
393  set(CEF_DEBUG_INFO_FLAG "/Zi" CACHE STRING "Optional flag specifying specific /Z flag to use")
394
395  # Consumers using different runtime types may want to pass different flags
396  set(CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Optional flag specifying which runtime to use")
397  if (CEF_RUNTIME_LIBRARY_FLAG)
398    list(APPEND CEF_COMPILER_FLAGS_DEBUG ${CEF_RUNTIME_LIBRARY_FLAG}d)
399    list(APPEND CEF_COMPILER_FLAGS_RELEASE ${CEF_RUNTIME_LIBRARY_FLAG})
400  endif()
401
402  # Platform-specific compiler/linker flags.
403  set(CEF_LIBTYPE STATIC)
404  list(APPEND CEF_COMPILER_FLAGS
405    /MP           # Multiprocess compilation
406    /Gy           # Enable function-level linking
407    /GR-          # Disable run-time type information
408    /W4           # Warning level 4
409    /WX           # Treat warnings as errors
410    /wd4100       # Ignore "unreferenced formal parameter" warning
411    /wd4127       # Ignore "conditional expression is constant" warning
412    /wd4244       # Ignore "conversion possible loss of data" warning
413    /wd4324       # Ignore "structure was padded due to alignment specifier" warning
414    /wd4481       # Ignore "nonstandard extension used: override" warning
415    /wd4512       # Ignore "assignment operator could not be generated" warning
416    /wd4701       # Ignore "potentially uninitialized local variable" warning
417    /wd4702       # Ignore "unreachable code" warning
418    /wd4996       # Ignore "function or variable may be unsafe" warning
419    ${CEF_DEBUG_INFO_FLAG}
420    )
421  list(APPEND CEF_COMPILER_FLAGS_DEBUG
422    /RTC1         # Disable optimizations
423    /Od           # Enable basic run-time checks
424    )
425  list(APPEND CEF_COMPILER_FLAGS_RELEASE
426    /O2           # Optimize for maximum speed
427    /Ob2          # Inline any suitable function
428    /GF           # Enable string pooling
429    )
430  list(APPEND CEF_LINKER_FLAGS_DEBUG
431    /DEBUG        # Generate debug information
432    )
433  list(APPEND CEF_EXE_LINKER_FLAGS
434    /MANIFEST:NO        # No default manifest (see ADD_WINDOWS_MANIFEST macro usage)
435    /LARGEADDRESSAWARE  # Allow 32-bit processes to access 3GB of RAM
436    )
437  list(APPEND CEF_COMPILER_DEFINES
438    WIN32 _WIN32 _WINDOWS             # Windows platform
439    UNICODE _UNICODE                  # Unicode build
440    WINVER=0x0601 _WIN32_WINNT=0x601  # Targeting Windows 7
441    NOMINMAX                          # Use the standard's templated min/max
442    WIN32_LEAN_AND_MEAN               # Exclude less common API declarations
443    _HAS_EXCEPTIONS=0                 # Disable exceptions
444    )
445  list(APPEND CEF_COMPILER_DEFINES_RELEASE
446    NDEBUG _NDEBUG                    # Not a debug build
447    )
448
449  # Standard libraries.
450  set(CEF_STANDARD_LIBS
451    comctl32.lib
452    gdi32.lib
453    rpcrt4.lib
454    shlwapi.lib
455    ws2_32.lib
456    )
457
458  # CEF directory paths.
459  set(CEF_RESOURCE_DIR        "${_CEF_ROOT}/Resources")
460  set(CEF_BINARY_DIR          "${_CEF_ROOT}/$<CONFIGURATION>")
461  set(CEF_BINARY_DIR_DEBUG    "${_CEF_ROOT}/Debug")
462  set(CEF_BINARY_DIR_RELEASE  "${_CEF_ROOT}/Release")
463
464  # CEF library paths.
465  set(CEF_LIB_DEBUG   "${CEF_BINARY_DIR_DEBUG}/libcef.lib")
466  set(CEF_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/libcef.lib")
467
468  # List of CEF binary files.
469  set(CEF_BINARY_FILES
470    chrome_elf.dll
471    libcef.dll
472    libEGL.dll
473    libGLESv2.dll
474    snapshot_blob.bin
475    v8_context_snapshot.bin
476    vk_swiftshader.dll
477    vk_swiftshader_icd.json
478    vulkan-1.dll
479    swiftshader
480    )
481
482  if(NOT PROJECT_ARCH STREQUAL "arm64")
483    list(APPEND CEF_BINARY_FILES
484      d3dcompiler_47.dll
485      )
486  endif()
487
488  # List of CEF resource files.
489  set(CEF_RESOURCE_FILES
490    chrome_100_percent.pak
491    chrome_200_percent.pak
492    resources.pak
493    icudtl.dat
494    locales
495    )
496
497  if(USE_SANDBOX)
498    list(APPEND CEF_COMPILER_DEFINES
499      PSAPI_VERSION=1   # Required by cef_sandbox.lib
500      CEF_USE_SANDBOX   # Used by apps to test if the sandbox is enabled
501      )
502    list(APPEND CEF_COMPILER_DEFINES_DEBUG
503      _HAS_ITERATOR_DEBUGGING=0   # Disable iterator debugging
504      )
505
506    # Libraries required by cef_sandbox.lib.
507    set(CEF_SANDBOX_STANDARD_LIBS
508      Advapi32.lib
509      dbghelp.lib
510      Delayimp.lib
511      OleAut32.lib
512      PowrProf.lib
513      Propsys.lib
514      psapi.lib
515      SetupAPI.lib
516      Shell32.lib
517      version.lib
518      wbemuuid.lib
519      winmm.lib
520      )
521
522    # CEF sandbox library paths.
523    set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.lib")
524    set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.lib")
525  endif()
526
527  # Configure use of ATL.
528  option(USE_ATL "Enable or disable use of ATL." ON)
529  if(USE_ATL)
530    # Locate the atlmfc directory if it exists. It may be at any depth inside
531    # the VC directory. The cl.exe path returned by CMAKE_CXX_COMPILER may also
532    # be at different depths depending on the toolchain version
533    # (e.g. "VC/bin/cl.exe", "VC/bin/amd64_x86/cl.exe",
534    # "VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe", etc).
535    set(HAS_ATLMFC 0)
536    get_filename_component(VC_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
537    get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
538    while(NOT ${VC_DIR_NAME} STREQUAL "VC")
539      get_filename_component(VC_DIR ${VC_DIR} DIRECTORY)
540      if(IS_DIRECTORY "${VC_DIR}/atlmfc")
541        set(HAS_ATLMFC 1)
542        break()
543      endif()
544      get_filename_component(VC_DIR_NAME ${VC_DIR} NAME)
545    endwhile()
546
547    # Determine if the Visual Studio install supports ATL.
548    if(NOT HAS_ATLMFC)
549      message(WARNING "ATL is not supported by your VC installation.")
550      set(USE_ATL OFF)
551    endif()
552  endif()
553
554  if(USE_ATL)
555    list(APPEND CEF_COMPILER_DEFINES
556      CEF_USE_ATL   # Used by apps to test if ATL support is enabled
557      )
558  endif()
559endif()
560