### Installing Application Executable (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Defines an installation rule to copy the main application executable (`BINARY_NAME`) to the installation prefix (`CMAKE_INSTALL_PREFIX`). It assigns the executable to the 'Runtime' component for grouping. ```CMake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) ``` -------------------------------- ### Configuring Installation Bundle Directory - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Defines the default installation prefix (`CMAKE_INSTALL_PREFIX`) to point to a bundle directory (`BUILD_BUNDLE_DIR`) within the build output directory, making 'installing' the equivalent of creating the application bundle. ```CMake # === Installation === # By default, "installing" just makes a relocatable bundle in the build # directory. set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() ``` -------------------------------- ### Installing Application Executable - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Installs the application executable target to the root of the installation prefix, making it the main executable within the application bundle. ```CMake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) ``` -------------------------------- ### Installing Flutter Engine Library (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Defines an installation rule to copy the main Flutter engine library file (`FLUTTER_LIBRARY`) to the designated library installation directory (`INSTALL_BUNDLE_LIB_DIR`). This is a core dependency for running the application. ```CMake install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Installing Bundled Plugin Libraries (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Defines an installation rule to copy any bundled plugin libraries (`PLUGIN_BUNDLED_LIBRARIES`) to the library installation directory. This step is conditional and only executes if there are bundled plugins. ```CMake if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Installing AOT Library for Profile/Release Builds (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Defines an installation rule to copy the Ahead-Of-Time (AOT) compiled snapshot library (`AOT_LIBRARY`) to the data installation directory. This is only done for 'Profile' and 'Release' builds, as Debug builds use the Dart VM. ```CMake install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Configuring Installation Directory and Visual Studio Default (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Sets the installation directory (`BUILD_BUNDLE_DIR`) to be next to the executable and makes the 'install' step the default in Visual Studio. It also sets `CMAKE_INSTALL_PREFIX` to the bundle directory if it hasn't been explicitly set. ```CMake set(BUILD_BUNDLE_DIR "$") set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() ``` -------------------------------- ### Installing Flutter Assets Directory (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Defines installation rules for the Flutter assets directory. It includes a pre-installation code step to remove the existing assets directory before copying the new one, ensuring the installed assets are always up-to-date. ```CMake set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Installing Flutter Main Library - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Installs the main Flutter shared library (the engine) into the library subdirectory of the bundle, making the core Flutter runtime available to the application executable. ```CMake install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Initializing CMake Project Basics - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Sets the minimum required CMake version and defines the project name and enabled languages (C++ in this case). This is the standard starting point for any CMake project. ```CMake cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) ``` -------------------------------- ### Installing Bundled Plugin Libraries - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Iterates through a list of bundled plugin libraries (`PLUGIN_BUNDLED_LIBRARIES`) and installs each one into the library subdirectory of the application bundle. ```CMake foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) ``` -------------------------------- ### Cleaning Installation Bundle Directory - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Adds a CMake `install(CODE)` rule that removes the contents of the build bundle directory before installing new files, ensuring a clean bundle on each installation run. ```CMake # Start with a clean build bundle directory every time. install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) ``` -------------------------------- ### Installing Application Assets Directory - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Adds installation rules to clean and copy the `flutter_assets` directory (containing fonts, images, etc.) from the build directory into the data subdirectory of the application bundle. ```CMake # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Defining Installation Subdirectories - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Sets variables for the standard data and library subdirectories within the installation prefix, where application resources and libraries will be placed in the bundle. ```CMake set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") ``` -------------------------------- ### Installing Flutter ICU Data File (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Defines an installation rule to copy the Flutter ICU data file (`FLUTTER_ICU_DATA_FILE`), which is needed for internationalization, to the designated data installation directory (`INSTALL_BUNDLE_DATA_DIR`). ```CMake install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Defining Installation Subdirectories (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Sets variables for the specific subdirectories within the installation prefix where application data and libraries will be placed. `INSTALL_BUNDLE_DATA_DIR` is for assets and data, `INSTALL_BUNDLE_LIB_DIR` is for libraries. ```CMake set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") ``` -------------------------------- ### Initializing CMake Project Configuration (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/runner/CMakeLists.txt Sets the minimum required CMake version for the build process to 3.14 and defines the project named "runner" using the C++ language. This is the standard starting point for a CMakeLists.txt file, ensuring compatibility and specifying the primary language. ```cmake cmake_minimum_required(VERSION 3.14) project(runner LANGUAGES CXX) ``` -------------------------------- ### Installing AOT Library (Non-Debug) - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Conditionally installs the Ahead-Of-Time (AOT) compiled code library (`AOT_LIBRARY`) into the bundle's library directory only for non-Debug builds (Profile and Release), as AOT compilation is typically skipped in Debug builds. ```CMake # Install the AOT library on non-Debug builds only. if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Installing Flutter ICU Data File - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Installs the Flutter International Components for Unicode (ICU) data file into the data subdirectory of the bundle, which is required by the Flutter engine for internationalization support. ```CMake install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Listing and Prepending Flutter Library Headers CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Creates a list of Flutter Linux embedder header files and then uses the custom `list_prepend` function to add the ephemeral directory path to each header, creating a full list of header paths for inclusion. ```CMake list(APPEND FLUTTER_LIBRARY_HEADERS "fl_basic_message_channel.h" "fl_binary_codec.h" "fl_binary_messenger.h" "fl_dart_project.h" "fl_engine.h" "fl_json_message_codec.h" "fl_json_method_codec.h" "fl_message_codec.h" "fl_method_call.h" "fl_method_channel.h" "fl_method_codec.h" "fl_method_response.h" "fl_plugin_registrar.h" "fl_plugin_registry.h" "fl_standard_message_codec.h" "fl_standard_method_codec.h" "fl_string_codec.h" "fl_value.h" "fl_view.h" "flutter_linux.h" ) list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") ``` -------------------------------- ### Applying Standard Settings to Executable - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Calls the previously defined `APPLY_STANDARD_SETTINGS` function to apply the common compilation options and features to the main application executable target. ```CMake # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Initializing CMake Project for Flutter Desktop (CXX) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Sets the minimum required CMake version and initializes the project with a name and specified languages. This is the foundational step for the CMake build process. ```CMake cmake_minimum_required(VERSION 3.14) project(example LANGUAGES CXX) ``` -------------------------------- ### Finding System Dependencies CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Uses PkgConfig to find required system libraries (GTK, GLIB, GIO) necessary for the Flutter Linux embedder. `REQUIRED` ensures that the build fails if these dependencies are not found, and `IMPORTED_TARGET` makes them available as linkable targets. ```CMake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) ``` -------------------------------- ### Linking Libraries to Executable - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Links necessary libraries to the application executable target, including the Flutter library and the GTK library found via PkgConfig. ```CMake # Add dependency libraries. Add any application-specific dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) ``` -------------------------------- ### Adding Application Executable Target - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Defines the main application executable target using the `BINARY_NAME` variable and lists the source files (`main.cc`, `my_application.cc`, and generated plugin registrant) that make up the executable. ```CMake # Define the application target. To change its name, change BINARY_NAME above, # not the value here, or `flutter run` will no longer work. # # Any new source files that you add to the application should be added here. add_executable(${BINARY_NAME} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) ``` -------------------------------- ### Displaying Menu95 at Position in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Displays a previously created `Menu95` instance at a specific `Offset` on the screen relative to its context. Requires a `BuildContext` and an `Offset` (x, y coordinates) for precise positioning. ```dart menu.show( context, Offset(50, 100), ); ``` -------------------------------- ### Listing and Transforming C++ Wrapper Source Paths CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Defines three lists (`CPP_WRAPPER_SOURCES_CORE`, `CPP_WRAPPER_SOURCES_PLUGIN`, `CPP_WRAPPER_SOURCES_APP`) containing the names of C++ source files for the core wrapper, plugin wrapper, and app wrapper components. It then transforms each list by prepending the `WRAPPER_ROOT` path to create full paths to the source files. ```CMake list(APPEND CPP_WRAPPER_SOURCES_CORE "core_implementations.cc" "standard_codec.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") list(APPEND CPP_WRAPPER_SOURCES_PLUGIN "plugin_registrar.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") list(APPEND CPP_WRAPPER_SOURCES_APP "flutter_engine.cc" "flutter_view_controller.cc" ) list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") ``` -------------------------------- ### Initializing Scaffold95 Window in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Initializes a Windows95 styled Scaffold widget. It provides a title bar and an optional toolbar for actions using `Item95`. A close button appears automatically if `canPop` is true, indicating it's not a root page. ```dart Scaffold95( title: 'Flutter95', toolbar: Toolbar95( actions: [ Item95( label: 'File', onTap: () {}, ), ], ), body: Container(), ) ``` -------------------------------- ### Finding System Dependencies (GTK) - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Uses `find_package` and `pkg_check_modules` to locate required system libraries like GTK+ 3.0 using PkgConfig, making them available as imported targets for linking. ```CMake # System-level dependencies. find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) ``` -------------------------------- ### Defining Flutter Windows Runner Executable (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/runner/CMakeLists.txt Defines the main executable target for the Windows runner application, named using the variable ${BINARY_NAME}. It specifies that it's a WIN32 application and lists all the source files and resource files required to build the executable. Dependencies are implicit from the listed files and later linkage. ```cmake add_executable(${BINARY_NAME} WIN32 "flutter_window.cpp" "main.cpp" "utils.cpp" "win32_window.cpp" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" "Runner.rc" "runner.exe.manifest" ) ``` -------------------------------- ### Defining Flutter App Wrapper Static Library CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Defines a `STATIC` library target named `flutter_wrapper_app` using the specified source files (`CPP_WRAPPER_SOURCES_CORE` and `CPP_WRAPPER_SOURCES_APP`). It applies standard settings, links it publicly against the `flutter` interface library, adds include directories, and sets a dependency on the `flutter_assemble` target. ```CMake add_library(flutter_wrapper_app STATIC ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_APP} ) apply_standard_settings(flutter_wrapper_app) target_link_libraries(flutter_wrapper_app PUBLIC flutter) target_include_directories(flutter_wrapper_app PUBLIC "${WRAPPER_ROOT}/include" ) add_dependencies(flutter_wrapper_app flutter_assemble) ``` -------------------------------- ### Configuring RPATH for Bundled Libraries - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Sets the `CMAKE_INSTALL_RPATH` to `$ORIGIN/lib`, which tells the linker/loader to look for dynamic libraries in a `lib` subdirectory relative to the executable at runtime. This is crucial for creating self-contained application bundles. ```CMake # Load bundled libraries from the lib/ directory relative to the binary. set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") ``` -------------------------------- ### Creating Menu95 with Items in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Creates a Windows95 styled menu with a list of `MenuItem95` widgets. Each menu item has a `value` and a `label`. The `onItemSelected` callback is triggered when an item is selected, similar to Material's `showMenu`. ```dart Menu95( items: [ MenuItem95( value: 1, label: 'New', ), MenuItem95( value: 2, label: 'Open', ), MenuItem95( value: 3, label: 'Exit', ), ], onItemSelected: (item) {}, ); ``` -------------------------------- ### Including Generated Plugin Rules - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Includes the `generated_plugins.cmake` file, which contains CMake rules automatically generated by the Flutter tool for building and integrating any desktop plugins used by the application. ```CMake # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Defining Flutter Tool Backend Custom Command CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Defines a custom command (`add_custom_command`) that specifies several output files (including the Flutter library, headers, and wrapper sources) and the command to execute. The command invokes the Flutter tool backend script (`tool_backend.bat`) via `cmake -E env` with environment variables and configuration arguments. A phony output is used to force the command to run. ```CMake set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ${PHONY_OUTPUT} COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" windows-x64 $ VERBATIM ) ``` -------------------------------- ### Defining Standard Compile Settings Function - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Defines a CMake function `APPLY_STANDARD_SETTINGS` that applies common C++ settings to a specified target, such as enabling C++14 standard, enforcing strict compiler warnings (`-Wall`, `-Werror`), and applying optimization/debug definitions based on build configuration. ```CMake # Compilation settings that should be applied to most targets. # # Be cautious about adding new options here, as plugins use this function by # default. In most cases, you should add new options to specific targets instead # of modifying this function. function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_14) target_compile_options(${TARGET} PRIVATE -Wall -Werror) target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") endfunction() ``` -------------------------------- ### Defining Flutter Tool Backend Custom Command CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Defines a custom command that executes the Flutter tool backend script (`tool_backend.sh`). This script is responsible for tasks like copying the Flutter engine library and headers into the ephemeral directory. The command is set up to always run because of the `_phony_` output. ```CMake add_custom_command( OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/_phony_ COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} VERBATIM ) ``` -------------------------------- ### Including Flutter Library and Tool Build Rules (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Sets the directory for Flutter's managed build files and includes the subdirectory containing the CMake rules for building Flutter's libraries and tools required for the desktop embedding. ```CMake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) ``` -------------------------------- ### Applying Standard Build Settings to Target (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/runner/CMakeLists.txt Invokes a CMake macro or function named apply_standard_settings, passing the executable target name ${BINARY_NAME}. This macro is expected to apply a predefined set of common build settings to the target, potentially including compiler flags, linker options, or other standard configurations. ```cmake apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Including Generated Configuration CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Includes a CMake configuration file that is generated by the Flutter tool. This file typically contains build variables and settings specific to the current project and build environment. ```CMake include(${EPHEMERAL_DIR}/generated_config.cmake) ``` -------------------------------- ### Linking Required Libraries to Target (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/runner/CMakeLists.txt Links the necessary libraries to the executable target ${BINARY_NAME}. It links against the flutter and flutter_wrapper_app targets (defined elsewhere by the Flutter CMake infrastructure) and the Windows system library dwmapi.lib, used for desktop window management. The linkage is marked as PRIVATE. ```cmake target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") ``` -------------------------------- ### Defining Flutter Plugin Wrapper Static Library CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Defines a `STATIC` library target named `flutter_wrapper_plugin` using the specified source files (`CPP_WRAPPER_SOURCES_CORE` and `CPP_WRAPPER_SOURCES_PLUGIN`). It applies standard settings, sets properties for position-independent code and symbol visibility, links it publicly against the `flutter` interface library, adds include directories, and sets a dependency on the `flutter_assemble` target. ```CMake add_library(flutter_wrapper_plugin STATIC ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ) apply_standard_settings(flutter_wrapper_plugin) set_target_properties(flutter_wrapper_plugin PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(flutter_wrapper_plugin PROPERTIES CXX_VISIBILITY_PRESET hidden) target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) target_include_directories(flutter_wrapper_plugin PUBLIC "${WRAPPER_ROOT}/include" ) add_dependencies(flutter_wrapper_plugin flutter_assemble) ``` -------------------------------- ### Including Application Runner Build Rules (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Includes the CMake rules defined in the 'runner' subdirectory. This subdirectory typically contains the build configuration for the main application executable, which hosts the Flutter content. ```CMake add_subdirectory("runner") ``` -------------------------------- ### Linking Libraries for Flutter Library CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Specifies the libraries that targets linking to the `flutter` INTERFACE library should link against. This includes the generated Flutter shared library (`libflutter_linux_gtk.so`) and the system libraries found via PkgConfig (GTK, GLIB, GIO). ```CMake target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") target_link_libraries(flutter INTERFACE PkgConfig::GTK PkgConfig::GLIB PkgConfig::GIO ) ``` -------------------------------- ### Setting Minimum CMake Version and Ephemeral Directory CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Specifies the minimum required CMake version for the project and sets a variable for the ephemeral build directory used by the Flutter tool. The ephemeral directory contains generated build artifacts and configuration. ```CMake cmake_minimum_required(VERSION 3.10) set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") ``` -------------------------------- ### Adding Flutter Assemble Dependency - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Adds a dependency on the `flutter_assemble` target, ensuring that the Flutter tool's build process (which generates assets, kernel snapshots, etc.) runs before the application executable is built. ```CMake # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Adding Dependencies to Flutter Library CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Adds a dependency to the `flutter` INTERFACE library on the custom target `flutter_assemble`. This ensures that the `flutter_assemble` target runs and generates the necessary files before any target that uses the `flutter` library is built. ```CMake add_dependencies(flutter flutter_assemble) ``` -------------------------------- ### Defining Flutter Interface Library CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Defines an `INTERFACE` library target named `flutter`. It specifies include directories and link libraries that consumers of this interface library should use, referencing the ephemeral directory and the Flutter engine import library (`.lib`). It also adds a build dependency on the `flutter_assemble` target. ```CMake add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") add_dependencies(flutter flutter_assemble) ``` -------------------------------- ### Integrating Item95 with Menu95 in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Creates an `Item95` widget, typically used in a toolbar or menu bar, that automatically displays the provided `Menu95` instance when tapped. The menu is positioned correctly relative to the `Item95`. ```dart Item95( label: 'File', menu: Menu95(...), ), ``` -------------------------------- ### Defining list_prepend Function CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Defines a custom CMake function to prepend a given prefix to each element in a list. This function is used here as a workaround for CMake versions older than 3.14 which lack the `list(TRANSFORM ... PREPEND ...)` command. ```CMake function(list_prepend LIST_NAME PREFIX) set(NEW_LIST "") foreach(element ${${LIST_NAME}}) list(APPEND NEW_LIST "${PREFIX}${element}") endforeach(element) set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) endfunction() ``` -------------------------------- ### Including Generated Plugin Build Rules (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Includes a CMake file generated by the Flutter build process that contains rules for building any plugins used by the application and integrating them into the main application build. ```CMake include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Defining Function for Standard Compilation Settings (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Defines a CMake function `APPLY_STANDARD_SETTINGS` that takes a target name as input. It applies common compilation features (C++17) and options (warning level, exceptions) to the specified target. ```CMake function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() ``` -------------------------------- ### Adding Unicode Definitions (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Adds preprocessor definitions `UNICODE` and `_UNICODE` to all projects. This is typically done on Windows platforms to enable support for wide character strings and APIs. ```CMake add_definitions(-DUNICODE -D_UNICODE) ``` -------------------------------- ### Listing and Transforming Flutter Header Paths CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Appends a list of required Flutter engine header file names to the `FLUTTER_LIBRARY_HEADERS` list. It then uses `list(TRANSFORM)` to prepend the `EPHEMERAL_DIR` path to each header file name, creating full paths. ```CMake list(APPEND FLUTTER_LIBRARY_HEADERS "flutter_export.h" "flutter_windows.h" "flutter_messenger.h" "flutter_plugin_registrar.h" "flutter_texture_registrar.h" ) list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") ``` -------------------------------- ### Defining Application Names and IDs - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Defines variables for the executable's on-disk name (`BINARY_NAME`) and the unique GTK application identifier (`APPLICATION_ID`). These variables are used later in the build process. ```CMake # The name of the executable created for the application. Change this to change # the on-disk name of your application. set(BINARY_NAME "example") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID set(APPLICATION_ID "com.example.example") ``` -------------------------------- ### Setting Include Directories for Flutter Library CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Adds the ephemeral directory to the include paths for targets that use the `flutter` INTERFACE library. This allows dependent targets to find the generated Flutter headers. ```CMake target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) ``` -------------------------------- ### Setting Wrapper Root Directory CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Defines the CMake variable `WRAPPER_ROOT` to specify the location of the C++ client wrapper source files, which is within the ephemeral directory. ```CMake set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") ``` -------------------------------- ### Setting Modern CMake Policy - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Explicitly opts into modern CMake behaviors (specifically policy CMP0063) to ensure compatibility and avoid warnings with recent CMake versions. ```CMake # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(SET CMP0063 NEW) ``` -------------------------------- ### Including Flutter Build Subdirectory - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Sets a variable pointing to the directory containing Flutter's managed build files and includes that directory as a subdirectory in the CMake build, allowing CMake to process the Flutter-specific build logic. ```CMake # Flutter library and tool build rules. set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) ``` -------------------------------- ### Applying Windows95 Text Style in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Applies the predefined `TextStyle` provided by `Flutter95.textStyle` to a standard `Text` widget. This ensures the text uses the font, size, and weight characteristic of Windows95 interfaces. ```dart Text( 'Text with Flutter95.textStyle', style: Flutter95.textStyle, ); ``` -------------------------------- ### Defining Flutter Assemble Custom Target CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Defines a custom target named `flutter_assemble` which depends on the outputs generated by the custom command. This target serves as a dependency that triggers the execution of the custom command, ensuring the Flutter engine artifacts are prepared. ```CMake add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ) ``` -------------------------------- ### Displaying Dialog95 in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Displays a modal dialog box styled in the Windows95 theme. This function requires a `BuildContext`, a `title` for the dialog window's title bar, and a `message` string to be displayed in the dialog body. ```dart showDialog95( context: context, title: 'Error', message: 'Task failed successfully', ); ``` -------------------------------- ### Handling Multi-Config and Build Type Settings (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Checks if the CMake generator is multi-config (like Visual Studio) and sets `CMAKE_CONFIGURATION_TYPES` accordingly. If not, it sets the default `CMAKE_BUILD_TYPE` to 'Debug' if not already defined, and lists allowed build type strings. ```CMake get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" CACHE STRING "" FORCE) elif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() ``` -------------------------------- ### Adding Source Directory Include Path (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/runner/CMakeLists.txt Adds the top-level source directory (${CMAKE_SOURCE_DIR}) as a private include directory for the executable target ${BINARY_NAME}. This allows source files within the target to include headers located in the project's root directory without specifying a relative path. ```cmake target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### Creating Button95 with Tap Handler in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Creates a Windows95 styled button. It wraps a child widget (like `Text`) and provides default styling and padding. If the `onTap` callback is null, the button is rendered in a disabled state. ```dart Button95( onTap: () {}, child: Text('Button95'), ) ``` -------------------------------- ### Setting Minimum CMake Version Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Specifies the minimum version of CMake required to process this configuration file. This ensures compatibility with the commands and features used. ```CMake cmake_minimum_required(VERSION 3.14) ``` -------------------------------- ### Setting Profile Build Flags based on Release (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Copies the linker and compiler flags from the 'Release' configuration to the 'Profile' configuration. This ensures that the Profile build uses similar optimization and linking settings as Release. ```CMake set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") ``` -------------------------------- ### Defining Application ID Macro - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Adds a preprocessor definition `APPLICATION_ID` using the variable defined earlier, making the application ID available within the C++ source code. ```CMake add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") ``` -------------------------------- ### Setting Executable Output Directory - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Configures the `RUNTIME_OUTPUT_DIRECTORY` property for the executable target, directing the built executable to a subdirectory named `intermediates_do_not_run` within the build directory. This prevents users from accidentally running the unbundled executable. ```CMake # Only the install-generated bundle's copy of the executable will launch # correctly, since the resources must in the right relative locations. To avoid # people trying to run the unbundled copy, put it in a subdirectory instead of # the default top-level location. set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) ``` -------------------------------- ### Including Generated Configuration CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Includes a CMake file named `generated_config.cmake` located in the directory specified by `EPHEMERAL_DIR`. This file is expected to be generated externally (likely by the Flutter tool) and provides configuration settings. ```CMake include(${EPHEMERAL_DIR}/generated_config.cmake) ``` -------------------------------- ### Adding Flutter Assemble Build Dependency (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/runner/CMakeLists.txt Adds a build dependency relationship in CMake, ensuring that the flutter_assemble target is built before the ${BINARY_NAME} executable target. The flutter_assemble target is responsible for running the Flutter tool to build the application bundle and generated files. This dependency is crucial for integrating CMake with the Flutter build system. ```cmake add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Creating TextField95 in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Creates a basic text input field styled to resemble a Windows95 text box. It provides the visual appearance of the classic era text field and uses a standard Material `TextField` internally for functionality. ```dart TextField95() ``` -------------------------------- ### Defining Flutter INTERFACE Library CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Defines a CMake INTERFACE library named `flutter`. INTERFACE libraries do not compile sources but are used to propagate usage requirements like include directories and link libraries to targets that link against them. ```CMake add_library(flutter INTERFACE) ``` -------------------------------- ### Setting Application Binary Name (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Defines a variable `BINARY_NAME` which specifies the desired name for the final executable file of the application. This allows easily changing the output file name. ```CMake set(BINARY_NAME "example") ``` -------------------------------- ### Setting Build Path Variables CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/flutter/CMakeLists.txt Defines variables pointing to key build artifacts generated by the Flutter tool, such as the Flutter shared library (`libflutter_linux_gtk.so`), the ICU data file (`icudtl.dat`), the project build directory, and the application AOT library (`libapp.so`). These variables are exported to the parent scope for use in the main application's CMakeLists.txt. ```CMake set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") # Published to parent scope for install step. set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) ``` -------------------------------- ### Defining Flutter Assemble Custom Target CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Defines a custom target named `flutter_assemble` that depends on the output files specified in the preceding `add_custom_command`. Building this target triggers the custom command that runs the Flutter tool backend, ensuring that necessary files are generated before dependent libraries are built. ```CMake add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} ${CPP_WRAPPER_SOURCES_APP} ) ``` -------------------------------- ### Defining Flutter Version Preprocessor Macros (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/runner/CMakeLists.txt Adds private compile definitions to the executable target ${BINARY_NAME}. These definitions make Flutter version information (full version string, major, minor, patch, and build numbers) available as preprocessor macros within the C++ source code. This is typically used for embedding version information or conditional compilation. ```cmake target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") ``` -------------------------------- ### Configuring Sysroot for Cross-Building - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Conditionally sets the `CMAKE_SYSROOT` and related variables if `FLUTTER_TARGET_PLATFORM_SYSROOT` is defined, which is necessary for cross-compiling the application for a specific target platform. ```CMake # Root filesystem for cross-building. if(FLUTTER_TARGET_PLATFORM_SYSROOT) set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) endif() ``` -------------------------------- ### Creating Checkbox95 with Label in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Creates a Windows95 styled checkbox. It requires a boolean `value` for its state and an `onChanged` callback. An optional `label` string can be provided. If `onChanged` is null, the checkbox becomes disabled. ```dart Checkbox95( value: value, label: "Some Label", // optional, if null no label is shown onChanged: (value) {}, // optional, if null acts as a disabled checkbox ) ``` -------------------------------- ### Adding Tooltip95 to Widget in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Wraps a child widget to display a Windows95 styled tooltip when hovered over. The `message` property contains the text shown in the tooltip, functioning similarly to the standard Material `Tooltip` widget. ```dart Tooltip95( message: 'Hello from Flutter95!', child: Text('I have a tooltip for you!'), ) ``` -------------------------------- ### Applying Elevation95 Effect in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Applies a distinct Windows95-style visual effect that simulates deepness or elevation around a child widget. This is essential for creating the characteristic raised or sunken borders found in the classic UI. ```dart Elevation95( child: Text('Elevated Text') ) ``` -------------------------------- ### Setting CMake Policy Version for Modern Behaviors Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/CMakeLists.txt Explicitly opts into modern CMake behaviors up to version 3.25 to avoid warnings and leverage newer features and practices. This helps ensure compatibility with recent CMake versions. ```CMake cmake_policy(VERSION 3.14...3.25) ``` -------------------------------- ### Disabling Windows NOMINMAX Macro (CMake) Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/runner/CMakeLists.txt Adds the NOMINMAX definition as a private compile definition for the executable target ${BINARY_NAME}. This macro prevents the Windows headers from defining min and max as preprocessor macros, which can conflict with the std::min and std::max functions from the C++ standard library. ```cmake target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") ``` -------------------------------- ### Setting Ephemeral Directory Variable CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Defines the CMake variable `EPHEMERAL_DIR` to point to the 'ephemeral' subdirectory within the current source directory. This directory likely contains generated build files or temporary assets. ```CMake set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") ``` -------------------------------- ### Setting Default Build Type - CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/linux/CMakeLists.txt Checks if `CMAKE_BUILD_TYPE` is already set and, if not, defaults it to `Debug`. It also defines the available build type options (`Debug`, `Profile`, `Release`) in the CMake cache. ```CMake # Define build configuration options. if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() ``` -------------------------------- ### Setting Flutter Library Path CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Sets the CMake variable `FLUTTER_LIBRARY` to the full path of the Flutter engine Windows DLL, located in the ephemeral build directory. This variable is used later for linking. ```CMake set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") ``` -------------------------------- ### Creating Divider95 Line in Flutter Source: https://github.com/miquelbeltran/flutter95/blob/master/README.md Creates a horizontal line styled like a Windows95 divider. It works similarly to the standard Material `Divider`, supporting properties like `indent`, `endIndent`, and `height` to control its appearance and spacing. ```dart Divider95() ``` -------------------------------- ### Exporting Variables to Parent Scope CMake Source: https://github.com/miquelbeltran/flutter95/blob/master/example/windows/flutter/CMakeLists.txt Exports several key variables (`FLUTTER_LIBRARY`, `FLUTTER_ICU_DATA_FILE`, `PROJECT_BUILD_DIR`, `AOT_LIBRARY`) to the parent scope using the `PARENT_SCOPE` argument. This makes these variables accessible in the CMakeLists.txt file that included this one. ```CMake set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.