1+ # Project-level configuration.
12cmake_minimum_required (VERSION 3.14 )
23project (window_manager_example LANGUAGES CXX )
34
5+ # The name of the executable created for the application. Change this to change
6+ # the on-disk name of your application.
47set (BINARY_NAME "window_manager_example" )
58
6- cmake_policy (SET CMP0063 NEW )
9+ # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
10+ # versions of CMake.
11+ cmake_policy (VERSION 3.14...3.25 )
712
8- set (CMAKE_INSTALL_RPATH "$ORIGIN/lib" )
9-
10- # Configure build options.
13+ # Define build configuration option.
1114get_property (IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG )
1215if (IS_MULTICONFIG)
1316 set (CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"
2023 "Debug" "Profile" "Release" )
2124 endif ()
2225endif ()
23-
26+ # Define settings for the Profile build mode.
2427set (CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} " )
2528set (CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} " )
2629set (CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} " )
@@ -30,6 +33,10 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")
3033add_definitions (-DUNICODE -D_UNICODE )
3134
3235# Compilation settings that should be applied to most targets.
36+ #
37+ # Be cautious about adding new options here, as plugins use this function by
38+ # default. In most cases, you should add new options to specific targets instead
39+ # of modifying this function.
3340function (APPLY_STANDARD_SETTINGS TARGET )
3441 target_compile_features (${TARGET} PUBLIC cxx_std_17 )
3542 target_compile_options (${TARGET} PRIVATE /W4 /WX /wd "4100" )
@@ -38,14 +45,14 @@ function(APPLY_STANDARD_SETTINGS TARGET)
3845 target_compile_definitions (${TARGET} PRIVATE "$<$<CONFIG :Debug >:_DEBUG >" )
3946endfunction ()
4047
41- set (FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR} /flutter" )
42-
4348# Flutter library and tool build rules.
49+ set (FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR} /flutter" )
4450add_subdirectory (${FLUTTER_MANAGED_DIR} )
4551
46- # Application build
52+ # Application build; see runner/CMakeLists.txt.
4753add_subdirectory ("runner" )
4854
55+
4956# Generated plugin build rules, which manage building the plugins and adding
5057# them to the application.
5158include (flutter/generated_plugins.cmake )
@@ -80,6 +87,12 @@ if(PLUGIN_BUNDLED_LIBRARIES)
8087 COMPONENT Runtime )
8188endif ()
8289
90+ # Copy the native assets provided by the build.dart from all packages.
91+ set (NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR} native_assets/windows/" )
92+ install (DIRECTORY "${NATIVE_ASSETS_DIR} "
93+ DESTINATION "${INSTALL_BUNDLE_LIB_DIR} "
94+ COMPONENT Runtime )
95+
8396# Fully re-copy the assets directory on each build to avoid having stale files
8497# from a previous install.
8598set (FLUTTER_ASSET_DIR_NAME "flutter_assets" )
0 commit comments