forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (29 loc) · 1.34 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
cmake_minimum_required(VERSION 3.15)
project(FlutterEmbedderGLFW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
add_executable(flutter_glfw FlutterEmbedderGLFW.cc)
############################################################
# GLFW
############################################################
find_path(GLFW_INCLUDE_PATH "glfw3.h"
/usr/local/Cellar/glfw/3.3/include/GLFW/
/usr/local/include/include/GLFW/
/usr/include/GLFW)
include_directories(${GLFW_INCLUDE_PATH})
find_library(GLFW_LIB glfw /usr/local/Cellar/glfw/3.3/lib)
target_link_libraries(flutter_glfw ${GLFW_LIB})
############################################################
# Flutter Engine
############################################################
# This is assuming you've built a local version of the Flutter Engine. If you
# downloaded yours is from the internet you'll have to change this.
include_directories(${CMAKE_SOURCE_DIR}/../../shell/platform/embedder)
find_library(FLUTTER_LIB flutter_engine PATHS ${CMAKE_SOURCE_DIR}/../../../out/host_debug_unopt)
target_link_libraries(flutter_glfw ${FLUTTER_LIB})
# Copy the flutter library here since the shared library
# name is `./libflutter_engine.dylib`.
add_custom_command(
TARGET flutter_glfw POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${FLUTTER_LIB}
${CMAKE_CURRENT_BINARY_DIR})