forked from obsproject/obs-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindCEF.cmake
91 lines (83 loc) · 2.66 KB
/
FindCEF.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
include(FindPackageHandleStandardArgs)
SET(CEF_ROOT_DIR "" CACHE PATH "Path to a CEF distributed build")
message(STATUS "Looking for Chromium Embedded Framework in ${CEF_ROOT_DIR}")
find_path(CEF_INCLUDE_DIR "include/cef_version.h"
HINTS ${CEF_ROOT_DIR})
if(APPLE)
find_library(CEF_LIBRARY
NAMES cef libcef cef.lib libcef.o "Chromium Embedded Framework"
NO_DEFAULT_PATH
PATHS ${CEF_ROOT_DIR} ${CEF_ROOT_DIR}/Release)
find_library(CEFWRAPPER_LIBRARY
NAMES cef_dll_wrapper libcef_dll_wrapper
NO_DEFAULT_PATH
PATHS ${CEF_ROOT_DIR}/build/libcef_dll/Release
${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Release
${CEF_ROOT_DIR}/build/libcef_dll
${CEF_ROOT_DIR}/build/libcef_dll_wrapper)
elseif(UNIX)
find_library(CEF_LIBRARY
NAMES libcef.so "Chromium Embedded Framework"
NO_DEFAULT_PATH
PATHS ${CEF_ROOT_DIR} ${CEF_ROOT_DIR}/Release)
find_library(CEFWRAPPER_LIBRARY
NAMES libcef_dll_wrapper.a
NO_DEFAULT_PATH
PATHS ${CEF_ROOT_DIR}/build/libcef_dll_wrapper
${CEF_ROOT_DIR}/libcef_dll_wrapper)
else()
find_library(CEF_LIBRARY
NAMES cef libcef cef.lib libcef.o "Chromium Embedded Framework"
PATHS ${CEF_ROOT_DIR} ${CEF_ROOT_DIR}/Release)
find_library(CEFWRAPPER_LIBRARY
NAMES cef_dll_wrapper libcef_dll_wrapper
PATHS ${CEF_ROOT_DIR}/build/libcef_dll/Release
${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Release
${CEF_ROOT_DIR}/build/libcef_dll
${CEF_ROOT_DIR}/build/libcef_dll_wrapper)
if(WIN32)
find_library(CEFWRAPPER_LIBRARY_DEBUG
NAMES cef_dll_wrapper libcef_dll_wrapper
PATHS ${CEF_ROOT_DIR}/build/libcef_dll/Debug ${CEF_ROOT_DIR}/build/libcef_dll_wrapper/Debug)
endif()
endif()
if(NOT CEF_LIBRARY)
message(WARNING "Could not find the CEF shared library" )
set(CEF_FOUND FALSE)
return()
endif()
if(NOT CEFWRAPPER_LIBRARY)
message(WARNING "Could not find the CEF wrapper library" )
set(CEF_FOUND FALSE)
return()
endif()
if(WIN32)
set(CEF_LIBRARIES
${CEF_LIBRARY}
optimized ${CEFWRAPPER_LIBRARY})
if (CEFWRAPPER_LIBRARY_DEBUG)
list(APPEND CEF_LIBRARIES
debug ${CEFWRAPPER_LIBRARY_DEBUG})
endif()
elseif(APPLE)
if(BROWSER_LEGACY)
if(${CMAKE_VERSION} VERSION_GREATER "3.19.0" AND XCODE)
string(REPLACE "Chromium Embedded Framework" "\"Chromium Embedded Framework\"" CEF_LIBRARY_FIXED ${CEF_LIBRARY})
else()
set(CEF_LIBRARY_FIXED ${CEF_LIBRARY})
endif()
else()
set(CEF_LIBRARY_FIXED "")
endif()
set(CEF_LIBRARIES
${CEF_LIBRARY_FIXED}
${CEFWRAPPER_LIBRARY})
else()
set(CEF_LIBRARIES
${CEF_LIBRARY}
${CEFWRAPPER_LIBRARY})
endif()
find_package_handle_standard_args(CEF DEFAULT_MSG CEF_LIBRARY
CEFWRAPPER_LIBRARY CEF_INCLUDE_DIR)
mark_as_advanced(CEF_LIBRARY CEF_WRAPPER_LIBRARY CEF_LIBRARIES
CEF_INCLUDE_DIR)