Skip to content

Added CMake presets for Boost, AWS SDK C++ and main application#55

Merged
percona-ysorokin merged 1 commit intomainfrom
cmake_presets
Mar 22, 2025
Merged

Added CMake presets for Boost, AWS SDK C++ and main application#55
percona-ysorokin merged 1 commit intomainfrom
cmake_presets

Conversation

@percona-ysorokin
Copy link
Copy Markdown
Collaborator

All 3 projects now have the following CMake presets

  • 'debug_gcc13' - Debug configuration for GCC 13 toolset
  • 'release_gcc13' - RelWithDebInfo configuration for GCC 13 toolset
  • 'asan_gcc13' - Debug configuration with Address Sanitizer enabled for GCC 13 toolset
  • 'debug_clang17' - Debug configuration for Clang 17 toolset
  • 'release_clang17' - RelWithDebInfo configuration for Clang 17 toolset
  • 'asan_clang17' - Debug configuration with Address Sanitizer enabled for Clang 17 toolset

For each project ('boost', 'aws-sdk-cpp' and 'percona-binlog-server') you can now enter its source directory
cd <project_name>
and run
cmake . --preset <preset_name>
and a new directory
<project_name>-build-<preset_name> will appear alongside <project_name> After that, in order to build, you can run
cmake --build <project_name>-build-<preset_name> --parallel And finally, to install it you can run
cmake --install <project_name>-build-<preset_name>

CMakePresets.json for the main project is put into the root of the source tree, alongside CMakeLists.txt. For Boost and AWS SDK C++ the files are put into the 'extra/cmake_presets' directory under corresponding subdirectories. Before starting configuring Boost / AWS SDK C++ these files need to be copied / symlinked into the roots of those project source trees.

Significantly reworked GitHub Actions .yml file.

  • In order to keep build options in one place, GitHub Actions now also use CMake presets.
  • Fetching main project's source code is now performed before building dependency libraries. It is necessary because we need to have access to the dependency libraries CMakePresets.json files earlier.
  • Added "Info CMake" action that prints CMake version

Changed the way how we instruct main application to look for Boost libraries during the configuration stage. Instead of specifying 'Boost_ROOT', we now use 'CMAKE_PREFIX_PATH' to specify a path where CMake can find 'BoostConfig.cmake'. This helps to avoid some CMake warnings generated in newer (>=3.30.0) versions of cmake.

Updated build instructions in README.md to reflect CMake presets changes.

All 3 projects now have the following CMake presets
* 'debug_gcc13' - Debug configuration for GCC 13 toolset
* 'release_gcc13' - RelWithDebInfo configuration for GCC 13 toolset
* 'asan_gcc13' - Debug configuration with Address Sanitizer enabled for GCC 13 toolset
* 'debug_clang17' - Debug configuration for Clang 17 toolset
* 'release_clang17' - RelWithDebInfo configuration for Clang 17 toolset
* 'asan_clang17' - Debug configuration with Address Sanitizer enabled for Clang 17 toolset

For each project ('boost', 'aws-sdk-cpp' and 'percona-binlog-server')
you can now enter its source directory
cd <project_name>
and run
cmake . --preset <preset_name>
and a new directory
<project_name>-build-<preset_name> will appear alongside <project_name>
After that, in order to build, you can run
cmake --build <project_name>-build-<preset_name> --parallel
And finally, to install it you can run
cmake --install <project_name>-build-<preset_name>

CMakePresets.json for the main project is put into the root of the source tree, alongside CMakeLists.txt.
For Boost and AWS SDK C++ the files are put into the
'extra/cmake_presets' directory under corresponding subdirectories.
Before starting configuring Boost / AWS SDK C++ these files need to
be copied / symlinked into the roots of those project source trees.

Significantly reworked GitHub Actions .yml file.
* In order to keep build options in one place, GitHub Actions now also
  use CMake presets.
* Fetching main project's source code is now performed before building
  dependency libraries. It is necessary because we need to have access
  to the dependency libraries CMakePresets.json files earlier.
* Added "Info CMake" action that prints CMake version

Changed the way how we instruct main application to look for Boost
libraries during the configuration stage. Instead of specifying
'Boost_ROOT', we now use 'CMAKE_PREFIX_PATH' to specify a path
where CMake can find 'BoostConfig.cmake'. This helps to avoid some
CMake warnings generated in newer (>=3.30.0) versions of cmake.

Updated build instructions in README.md to reflect CMake presets
changes.
@percona-ysorokin percona-ysorokin merged commit 5b93840 into main Mar 22, 2025
7 checks passed
@percona-ysorokin percona-ysorokin deleted the cmake_presets branch March 22, 2025 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant