### Setting Installation Prefix and Bundle Directory Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Configures the installation prefix and the directory for the relocatable bundle. This is used during the 'install' step to package the application. ```cmake 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() ``` -------------------------------- ### Defining Installation Directories Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Sets variables for the installation paths of data and library files within the application bundle. ```cmake set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") ``` -------------------------------- ### Install Application Executable Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Installs the application's main executable to the specified runtime destination. This component is labeled 'Runtime'. ```cmake install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) ``` -------------------------------- ### Install Iconoir NPM Package Source: https://github.com/iconoir-icons/iconoir/blob/main/README.md Install the Iconoir package using npm, yarn, pnpm, or bun. ```bash npm i iconoir ``` ```bash yarn add iconoir ``` ```bash pnpm add iconoir ``` ```bash bun add iconoir ``` -------------------------------- ### Install Flutter Library Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Installs the main Flutter library file to the application bundle's root directory. This is also a runtime component. ```cmake install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Install AOT Library Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Installs the Ahead-Of-Time (AOT) compiled library to the application's data directory. This installation is conditional and only occurs for Profile and Release build configurations. ```cmake install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Set Installation Prefix for Bundle Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Configures the installation directory for the application bundle. Support files are placed next to the executable for in-place execution, especially for Visual Studio compatibility. ```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() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") ``` -------------------------------- ### Basic CMake Project Setup Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Initializes CMake, sets the project name, and specifies the minimum required version. This is standard for all CMake projects. ```cmake cmake_minimum_required(VERSION 3.10) project(runner LANGUAGES CXX) ``` -------------------------------- ### Install iconoir-react Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-react/README.md Use npm, Yarn, or pnpm to add the iconoir-react package to your project. ```bash npm i iconoir-react ``` ```bash yarn add iconoir-react ``` ```bash pnpm add iconoir-react ``` -------------------------------- ### Cleaning Build Bundle Directory on Install Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Ensures the build bundle directory is clean before installation by removing its contents. This is executed as part of the 'Runtime' component installation. ```cmake install(CODE " file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") " COMPONENT Runtime) ``` -------------------------------- ### Installing Bundled Plugin Libraries Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Installs any bundled plugin libraries to the lib directory within the application bundle. This loop handles multiple plugin libraries. ```cmake foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) install(FILES "${bundled_library}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endforeach(bundled_library) ``` -------------------------------- ### Install Bundled Plugin Libraries Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Installs any bundled plugin libraries to the application bundle's library directory. This is conditional on `PLUGIN_BUNDLED_LIBRARIES` being defined and is part of the runtime components. ```cmake if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Install Flutter Assets Directory Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Installs the Flutter assets directory. It first removes any existing assets to ensure a clean copy, then copies the assets from the build directory to the application's data directory. This is a runtime component. ```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) ``` -------------------------------- ### Install @iconoir/vue Package Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-vue/README.md Use npm, yarn, or pnpm to add the @iconoir/vue package to your project dependencies. ```bash npm i @iconoir/vue ``` ```bash yarn add @iconoir/vue ``` ```bash pnpm add @iconoir/vue ``` -------------------------------- ### Install iconoir-react-native and react-native-svg Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-react-native/README.md Use npm or yarn to install the necessary packages for using Iconoir icons in your React Native application. ```bash npm i iconoir-react-native react-native-svg ``` ```bash yarn add iconoir-react-native react-native-svg ``` -------------------------------- ### Install ICU Data File Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Installs the ICU data file to the data directory within the application bundle. This is part of the runtime components. ```cmake install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) ``` -------------------------------- ### Add iconoir_flutter Dependency Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/README.md Install the iconoir_flutter package using Flutter's package manager. ```bash flutter pub add iconoir_flutter ``` -------------------------------- ### Basic Iconoir Usage in React Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-react/README.md Import and render the Iconoir component in your React application. Ensure you have React installed. ```javascript import { Iconoir } from 'iconoir-react'; import React from 'react'; function App() { return ; } export default App; ``` -------------------------------- ### Set Project Name and Minimum CMake Version Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Sets the minimum required CMake version and the project name. This is a standard starting point for CMake projects. ```cmake cmake_minimum_required(VERSION 3.14) project(example LANGUAGES CXX) ``` -------------------------------- ### Install AOT Library on Non-Debug Builds Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt This CMake script installs the AOT library to the specified destination only when the build type is not 'Debug'. Ensure the AOT_LIBRARY variable is correctly set. ```cmake if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() ``` -------------------------------- ### Basic Icon Usage in React Native Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-react-native/README.md Import and render an Iconoir icon component within your React Native application's view hierarchy. Ensure react-native-svg is installed. ```javascript import { Iconoir } from 'iconoir-react-native'; import React from 'react'; import { View } from 'react-native'; function App() { return ( ); } export default App; ``` -------------------------------- ### Basic Iconoir Vue Component Usage Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-vue/README.md Import and render the default Iconoir component in your Vue application. Ensure you have the necessary setup for Vue 3. ```vue ``` -------------------------------- ### Configure Flutter Library and Headers Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/flutter/CMakeLists.txt Sets the path to the Flutter Linux shared library and its associated header files. These paths are published to the parent scope for use in other build steps, such as installation. The `FLUTTER_ICU_DATA_FILE` is also defined here. ```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) ``` -------------------------------- ### Add Dependency Libraries and Include Directories Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/runner/CMakeLists.txt Links necessary libraries and specifies include directories for the application. Add any application-specific dependencies here to ensure they are available during the build process. ```cmake # Add dependency libraries and include directories. Add any application-specific # dependencies here. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") ``` -------------------------------- ### Cross-Building System Root Configuration Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Sets up the system root and search paths for cross-compilation environments. This is conditional and only applied when FLUTTER_TARGET_PLATFORM_SYSROOT is defined. ```cmake 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() ``` -------------------------------- ### Import Iconoir CSS Source: https://github.com/iconoir-icons/iconoir/blob/main/css/README.md Include this line in your HTML's section to load the Iconoir CSS file from a CDN. ```html ``` -------------------------------- ### System Dependencies and Application ID Definition Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Finds required system packages using PkgConfig and defines the application ID as a preprocessor macro. This links the application to necessary system libraries. ```cmake find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") ``` -------------------------------- ### Apply Standard Build Settings Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/runner/CMakeLists.txt Applies a standard set of build settings to the application target. This can be customized for applications requiring different build configurations. ```cmake # Apply the standard set of build settings. This can be removed for applications # that need different build settings. apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Basic Flutter Usage of Iconoir Widget Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/README.md Demonstrates how to import and use the Iconoir widget within a Flutter application. Ensure necessary imports are included. ```dart import 'package:flutter/material.dart'; import 'package:iconoir_flutter/iconoir_flutter.dart'; void main() { runApp(const App()); } class App extends StatelessWidget { const App({ super.key }); @override Widget build(BuildContext context) { return const MaterialApp( home: DemoPage(), ); } } class DemoPage extends StatelessWidget { const DemoPage({ super.key }); @override Widget build(BuildContext context) { return Scaffold( body: Container( child: const Iconoir(), ), ); } } ``` -------------------------------- ### Setting Runtime Output Directory Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Configures the runtime output directory for the executable to a subdirectory. This prevents users from accidentally running the unbundled copy, which may not function correctly. ```cmake set_target_properties(${BINARY_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) ``` -------------------------------- ### Enable Unicode Support Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Adds definitions to enable Unicode support in the project. This ensures proper handling of international characters. ```cmake add_definitions(-DUNICODE -D_UNICODE) ``` -------------------------------- ### Setting Executable and Application IDs Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Defines the on-disk name of the application executable and its unique GTK application identifier. Ensure these are set correctly for proper application functioning. ```cmake set(BINARY_NAME "example") set(APPLICATION_ID "com.example.example") ``` -------------------------------- ### Defining the Application Executable Target Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Defines the main executable target for the application, listing its source files. Any new source files should be added here. ```cmake add_executable(${BINARY_NAME} "main.cc" "my_application.cc" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" ) apply_standard_settings(${BINARY_NAME}) ``` -------------------------------- ### Custom Command to Assemble Flutter Library Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/flutter/CMakeLists.txt Defines a custom command to assemble the Flutter library and headers using the Flutter tool backend script. This command is executed during the build process. The `_phony_` output is a common technique to ensure the command runs every time, as direct input/output tracking for `flutter_tools` is not yet fully supported. ```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 ) ``` -------------------------------- ### Define Profile Build Mode Settings Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Sets linker and compiler flags for the Profile build mode to match those of the Release build mode. This ensures consistent performance characteristics between Profile and Release builds. ```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}") ``` -------------------------------- ### Using IconoirProvider for Default Props Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-react/README.md Wrap your application or a section of it with IconoirProvider to set default props for all icons within its scope. This avoids repetitive prop definitions. ```tsx import { Check, IconoirProvider } from 'iconoir-react'; return ( ); ``` -------------------------------- ### Opt-in to Modern CMake Behaviors Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Explicitly enables modern CMake behaviors to avoid warnings with recent CMake versions. This ensures compatibility and adherence to current best practices. ```cmake cmake_policy(SET CMP0063 NEW) ``` -------------------------------- ### Find and Check GTK Dependencies with PkgConfig Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/flutter/CMakeLists.txt This snippet uses PkgConfig to find and check for required GTK development libraries (gtk+-3.0, glib-2.0, gio-2.0). It ensures these system-level dependencies are available before proceeding with the build. The `REQUIRED` keyword will cause CMake to error if the packages are not found. ```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) ``` -------------------------------- ### Include Generated Plugin Build Rules Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Includes CMake rules for generated plugins. These rules manage the building of plugins and their integration into the application. ```cmake include(flutter/generated_plugins.cmake) ``` -------------------------------- ### Apply Standard Compilation Settings Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt A function to apply common compilation settings to a target. It sets the C++ standard to C++17, enables verbose warnings, treats warnings as errors, and disables specific warnings. It also enables exceptions and defines `_DEBUG` for Debug configurations. ```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() ``` -------------------------------- ### Display an Iconoir Icon Source: https://github.com/iconoir-icons/iconoir/blob/main/css/README.md Use the 'iconoir-' prefix followed by the icon name as a class on an element to display an icon. Find icon names on the official Iconoir website. ```html ``` -------------------------------- ### Set Default Icon Props with IconoirProvider Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-react-native/README.md Wrap your application or a section of it with IconoirProvider to define default props (color, strokeWidth, width, height) for all nested Iconoir icons, reducing repetitive prop definitions. ```tsx import { Check, IconoirProvider } from 'iconoir-react-native'; return ( ); ``` -------------------------------- ### Initialize Flutter Web Service Worker Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/web/index.html This script is injected by the Flutter build process. It sets up the service worker to load the main Dart entry point and initialize the Flutter engine. ```javascript var serviceWorkerVersion = null; window.addEventListener('load', function(ev) { // Download main.dart.js _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, }, onEntrypointLoaded: function(engineInitializer) { engineInitializer.initializeEngine().then(function(appRunner) { appRunner.runApp(); }); } }); }); ``` -------------------------------- ### Linking Application Dependencies Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Links the application target to the Flutter library and GTK. Add any other application-specific dependencies here. ```cmake target_link_libraries(${BINARY_NAME} PRIVATE flutter) target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) ``` -------------------------------- ### Include Runner Subdirectory Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Includes the 'runner' subdirectory, which likely contains the main application's build configuration. This is a common pattern for organizing application targets. ```cmake add_subdirectory("runner") ``` -------------------------------- ### Define Build Configuration Types Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Configures the available build types (Debug, Profile, Release) for multi-configuration generators. For single-configuration generators, it sets the default build type if not already specified. ```cmake get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" CACHE STRING "" FORCE) else() 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() endif() ``` -------------------------------- ### Set Executable Name Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Defines the on-disk name for the application's executable. This can be changed to customize the application's name. ```cmake set(BINARY_NAME "example") ``` -------------------------------- ### Configuring CMake Policies and RPATH Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Explicitly opts into modern CMake behaviors and sets the RPATH to load bundled libraries from the 'lib/' directory relative to the binary. This ensures libraries are found at runtime. ```cmake cmake_policy(SET CMP0063 NEW) set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") ``` -------------------------------- ### Add Preprocessor Definitions for Build Version Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/runner/CMakeLists.txt Adds preprocessor definitions to the build, embedding Flutter version information directly into the compiled code. This is useful for runtime version checks or logging. ```cmake # Add preprocessor definitions for the build version. 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}") ``` -------------------------------- ### Define List Prepend Function in CMake Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/flutter/CMakeLists.txt A custom CMake function to prepend a prefix to all elements of a list. This is used as a fallback for older CMake versions that do not support `list(TRANSFORM ... PREPEND ...)`. Ensure the list variable is correctly passed and modified. ```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() ``` -------------------------------- ### UIKit Iconoir Integration Source: https://github.com/iconoir-icons/iconoir/blob/main/README.md Use Iconoir icons in UIKit projects by converting them to UIImage. Ensure the Iconoir package is imported. ```swift import UIKit import Iconoir let imageView = UIImageView(image: Iconoir.bell.asUIImage) ``` -------------------------------- ### Standard Compilation Settings Function Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Defines a function to apply common compilation settings like C++ standard, warning levels, optimization, and NDEBUG definition. This promotes code consistency across targets. ```cmake 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() ``` -------------------------------- ### Import Iconoir SVG Source: https://github.com/iconoir-icons/iconoir/blob/main/README.md Import a specific SVG icon from the iconoir package for use in your project. ```javascript import Iconoir from 'iconoir/icons/iconoir.svg'; ``` -------------------------------- ### Define Executable Target Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/runner/CMakeLists.txt Defines the main executable target for the Flutter application, including all necessary source files and generated files. Ensure BINARY_NAME is consistent with the top-level CMakeLists.txt for `flutter run` compatibility. ```cmake cmake_minimum_required(VERSION 3.14) project(runner LANGUAGES CXX) # Define the application target. To change its name, change BINARY_NAME in the # top-level CMakeLists.txt, 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} WIN32 "flutter_window.cpp" "main.cpp" "utils.cpp" "win32_window.cpp" "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" "Runner.rc" "runner.exe.manifest" ) ``` -------------------------------- ### Add Flutter Assemble Dependency Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/runner/CMakeLists.txt Ensures that the Flutter tool's assembly process is completed before the application target is built. This is a mandatory step for Flutter projects. ```cmake # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Configure Default Icon Props with IconoirProvider Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-vue/README.md Use IconoirProvider to set default properties for all icons within its scope, reducing repetitive prop definitions. This is useful for maintaining consistent styling across your application. ```vue ``` -------------------------------- ### Include Flutter Managed Directory Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/CMakeLists.txt Adds the Flutter managed directory as a subdirectory to the CMake project. This is typically used to include Flutter's build rules. ```cmake set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) ``` -------------------------------- ### Define Flutter Library Headers Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/flutter/CMakeLists.txt Appends a list of Flutter Linux header file names to the `FLUTTER_LIBRARY_HEADERS` variable. These headers are essential for compiling code that interacts with the Flutter engine on Linux. The `list_prepend` function is used to add the directory prefix to each header file. ```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/") ``` -------------------------------- ### Create Flutter Interface Library Target Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/flutter/CMakeLists.txt Defines an INTERFACE library target named 'flutter'. This target includes the necessary header directories and links against the Flutter shared library and required GTK packages. Interface libraries are useful for managing dependencies without creating actual library files. ```cmake add_library(flutter INTERFACE) target_include_directories(flutter INTERFACE "${EPHEMERAL_DIR}" ) target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") target_link_libraries(flutter INTERFACE PkgConfig::GTK PkgConfig::GLIB PkgConfig::GIO ) add_dependencies(flutter flutter_assemble) ``` -------------------------------- ### SwiftUI Iconoir Integration Source: https://github.com/iconoir-icons/iconoir/blob/main/README.md Integrate Iconoir icons into SwiftUI views. Icons can be styled with modifiers like foregroundColor and font. ```swift import SwiftUI import Iconoir struct ContentView: View { var body: some View { Iconoir.bell.asImage .foregroundColor(.blue) .font(.system(size: 24)) } } ``` -------------------------------- ### Setting Default Build Type Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Sets the default build type to 'Debug' if not already specified. This ensures a consistent build mode for development. ```cmake 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() ``` -------------------------------- ### Custom Target for Flutter Assembly Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/flutter/CMakeLists.txt Creates a custom target `flutter_assemble` that depends on the Flutter library and its headers. This target ensures that the custom command for assembling these artifacts is executed when needed. It serves as a dependency for other build steps that rely on the generated Flutter library. ```cmake add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" ${FLUTTER_LIBRARY_HEADERS} ) ``` -------------------------------- ### Ensuring Flutter Assembly Dependency Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/linux/CMakeLists.txt Adds a dependency on the 'flutter_assemble' target, ensuring that Flutter's build artifacts are available before the application executable is built. ```cmake add_dependencies(${BINARY_NAME} flutter_assemble) ``` -------------------------------- ### Customize Icon Properties in Vue Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-vue/README.md Apply standard SVG properties like color, height, and width directly to Iconoir components as props for individual customization. ```vue ``` -------------------------------- ### Customize Icon Props in React Native Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-react-native/README.md Apply standard react-native-svg properties such as color, height, and width directly to an Iconoir icon component to customize its appearance. ```javascript ; ``` -------------------------------- ### Disable Conflicting Windows Macros Source: https://github.com/iconoir-icons/iconoir/blob/main/packages/iconoir-flutter/example/windows/runner/CMakeLists.txt Disables Windows-specific macros like NOMINMAX that can conflict with standard C++ library functions, preventing potential compilation errors. ```cmake # Disable Windows macros that collide with C++ standard library functions. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.