-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
75 lines (67 loc) · 2.31 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.16)
project(webview)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# TODO: Doing so may prevent some dependencies from being built
# or installed correctly, so use with caution.
set(CMAKE_SUPPRESS_REGENERATION true)
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
set(THIRD_PARTY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party")
add_library(webview SHARED
lib/webview.cpp
lib/webview.h
lib/app.cpp
lib/app.h
lib/browser.cpp
lib/browser.h
lib/render.cpp
lib/render.h
lib/display.cpp
lib/display.h
lib/control.cpp
lib/control.h
lib/bridge.h
lib/bridge.cpp
lib/scheme_handler.h
lib/scheme_handler.cpp
lib/message_router.h
lib/message_router.cpp)
include_directories("${THIRD_PARTY_DIR}/cef")
target_link_directories(webview PRIVATE
"${THIRD_PARTY_DIR}/cef/${CMAKE_BUILD_TYPE}"
"${THIRD_PARTY_DIR}/cef/libcef_dll_wrapper/${CMAKE_BUILD_TYPE}")
target_link_libraries(webview
libcef
libcef_dll_wrapper
cef_sandbox
winmm
delayimp)
if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set_property(TARGET webview PROPERTY MSVC_RUNTIME_LIBRARY MultiThreaded)
else()
set_property(TARGET webview PROPERTY MSVC_RUNTIME_LIBRARY MultiThreadedDebug)
endif()
endif()
if(MSVC)
add_compile_definitions(WIN32
_WINDOWS
__STDC_CONSTANT_MACROS
__STDC_FORMAT_MACROS
_WIN32
UNICODE
_UNICODE
WINVER=0x0A00
_WIN32_WINNT=0x0A00
NTDDI_VERSION=NTDDI_WIN10_FE
NOMINMAX
WIN32_LEAN_AND_MEAN
_HAS_EXCEPTIONS=0
PSAPI_VERSION=1
_HAS_ITERATOR_DEBUGGING=0
CEF_USE_ATL
CEF_USE_SANDBOX)
endif()