This project demonstrates how to use Conan and CMake to build a simple C++ application with Boost dependencies.
src/main.cpp: Minimal example using Boost.Asio.CMakeLists.txt: CMake build configuration.conanfile.txt: Conan package requirements and generator settings.
- CMake >= 3.21
- Conan >= 2.x
- A C++17 compatible compiler (e.g., MSVC, GCC, Clang)
- Boost 1.83.0 (via Conan)
conan install . -of build --build=missingOr, for a specific profile (e.g., MSVC):
conan install . -of build-msvc --build=missing -pr:h msvc_release -pr:b msvc_releasecmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmakeOr for MSVC profile:
cmake -S . -B build-msvc -DCMAKE_TOOLCHAIN_FILE=build-msvc/conan_toolchain.cmakecmake --build build --config ReleaseOr for MSVC profile:
cmake --build build-msvc --config ReleaseWhen you run the resulting executable, you should see:
Boost.Asio OK
- To use Boost as header-only (to reduce build time/size), uncomment and use the following option in
conanfile.txt:# boost/*:header_only=True - The CMake configuration automatically links the correct Boost target depending on your environment.
This project is licensed under the MIT License. See the LICENSE file for details.