|
| 1 | +# CMake Modules Reference |
| 2 | + |
| 3 | +This document provides detailed references for each CMake module file used in ThemisDB project. |
| 4 | + |
| 5 | +## Versions.cmake |
| 6 | +### Purpose |
| 7 | +Handles version management for the project. |
| 8 | +### Key Variables |
| 9 | +- `PROJECT_VERSION`: The current version of the project. |
| 10 | +- `MINIMUM_REQUIRED_VERSION`: The minimum required version of CMake. |
| 11 | +### Usage Example |
| 12 | +```cmake |
| 13 | +include(Versions) |
| 14 | +set(PROJECT_VERSION "1.0.0") |
| 15 | +``` |
| 16 | + |
| 17 | +## CompilerOptions.cmake |
| 18 | +### Purpose |
| 19 | +Contains compiler flags specific to C++20 standards and compiler types. |
| 20 | +### Key Variables |
| 21 | +- `CXX_STANDARD`: The C++ standard to be used. |
| 22 | +- `MSVC_FLAGS`: Flags specific to MSVC compiler. |
| 23 | +- `GCC_FLAGS`: Flags specific to GCC compiler. |
| 24 | +- `CLANG_FLAGS`: Flags specific to Clang compiler. |
| 25 | +### Usage Example |
| 26 | +```cmake |
| 27 | +include(CompilerOptions) |
| 28 | +set(CXX_STANDARD 20) |
| 29 | +``` |
| 30 | + |
| 31 | +## PlatformDetection.cmake |
| 32 | +### Purpose |
| 33 | +Detects the platform and sets relevant variables accordingly. |
| 34 | +### Key Variables |
| 35 | +- `CMAKE_SYSTEM_NAME`: The name of the system. |
| 36 | +- `CMAKE_SYSTEM_PROCESSOR`: The processor architecture. |
| 37 | +### Usage Example |
| 38 | +```cmake |
| 39 | +include(PlatformDetection) |
| 40 | +message(STATUS "Detected OS: ${CMAKE_SYSTEM_NAME}") |
| 41 | +``` |
| 42 | + |
| 43 | +## ArchitectureOptimizations.cmake |
| 44 | +### Purpose |
| 45 | +Enables architecture-specific optimizations. |
| 46 | +### Key Variables |
| 47 | +- `USE_AVX2`: Flag to enable AVX2 optimizations. |
| 48 | +- `USE_NEON`: Flag to enable NEON optimizations. |
| 49 | +### Usage Example |
| 50 | +```cmake |
| 51 | +include(ArchitectureOptimizations) |
| 52 | +set(USE_AVX2 ON) |
| 53 | +``` |
| 54 | + |
| 55 | +## EditionDefaults.cmake |
| 56 | +### Purpose |
| 57 | +Sets default configurations for different editions of the project. |
| 58 | +### Key Variables |
| 59 | +- `EDITION`: Current edition being built. |
| 60 | +### Usage Example |
| 61 | +```cmake |
| 62 | +include(EditionDefaults) |
| 63 | +set(EDITION "Standard") |
| 64 | +``` |
| 65 | + |
| 66 | +## FeatureDefaults.cmake |
| 67 | +### Purpose |
| 68 | +Defines default values for various feature flags in the project. |
| 69 | +### Key Variables |
| 70 | +- `ENABLE_FEATURE_X`: Flag to enable/disable feature X. |
| 71 | +### Usage Example |
| 72 | +```cmake |
| 73 | +include(FeatureDefaults) |
| 74 | +set(ENABLE_FEATURE_X ON) |
| 75 | +``` |
| 76 | + |
| 77 | +## EditionMatrix.cmake |
| 78 | +### Purpose |
| 79 | +Defines a compatibility matrix for different editions. |
| 80 | +### Key Variables |
| 81 | +- `COMPATIBILITY_MATRIX`: The compatibility information. |
| 82 | +### Usage Example |
| 83 | +```cmake |
| 84 | +include(EditionMatrix) |
| 85 | +message(STATUS "Compatibility matrix loaded.") |
| 86 | +``` |
| 87 | + |
| 88 | +## VcpkgConfiguration.cmake |
| 89 | +### Purpose |
| 90 | +Configures Vcpkg binary cache settings. |
| 91 | +### Key Variables |
| 92 | +- `VCPKG_BINARY_CACHE`: Path to the binary cache. |
| 93 | +### Usage Example |
| 94 | +```cmake |
| 95 | +include(VcpkgConfiguration) |
| 96 | +set(VCPKG_BINARY_CACHE "/path/to/cache") |
| 97 | +``` |
| 98 | + |
| 99 | +## Dependencies.cmake |
| 100 | +### Purpose |
| 101 | +Handles all find_package calls for project dependencies. |
| 102 | +### Key Variables |
| 103 | +- `FIND_PACKAGE_OPTIONS`: Options for find_package. |
| 104 | +### Usage Example |
| 105 | +```cmake |
| 106 | +include(Dependencies) |
| 107 | +find_package(SOME_LIBRARY REQUIRED) |
| 108 | +``` |
| 109 | + |
| 110 | +## Validation Modules |
| 111 | +### PlatformValidation.cmake |
| 112 | +#### Purpose |
| 113 | +Validates platform-specific configurations. |
| 114 | +\ |
| 115 | +### EditionValidation.cmake |
| 116 | +#### Purpose |
| 117 | +Validates edition-specific configurations. |
| 118 | +### FeatureValidation.cmake |
| 119 | +#### Purpose |
| 120 | +Validates feature-specific configurations. |
| 121 | +### Key Variables |
| 122 | +- `VALIDATION_FLAGS`: Flags for validation checks. |
| 123 | +### Usage Example |
| 124 | +```cmake |
| 125 | +include(PlatformValidation) |
| 126 | +include(EditionValidation) |
| 127 | +include(FeatureValidation) |
| 128 | +``` |
| 129 | + |
| 130 | +## Conclusion |
| 131 | +This document should help developers understand the purpose, variables, and usage of each CMake module in ThemisDB. For detailed implementations, refer to the corresponding module files. |
0 commit comments