# Library Versioning best Practise

**URL:** <https://discourse.cmake.org/t/library-versioning-best-practise/10759>\
**Category:** Code\
**Created:** [April 29, 2024, 2:15pm UTC](https://discourse.cmake.org/t/library-versioning-best-practise/10759 "2024-04-29T14:15:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedahl](https://discourse.cmake.org/user_avatar/discourse.cmake.org/pedahl/32/3307_2.png) [@pedahl](https://discourse.cmake.org/u/pedahl)\
**Post date:** [April 29, 2024, 2:15pm UTC](https://discourse.cmake.org/t/library-versioning-best-practise/10759/1 "2024-04-29T14:15:10Z")

</div>

Hi,  
i have source code libraries in different Versions.  
What is the best practice for integrating the different versions in different projects?  
For example:

A-Lib Version:1.0.0  
A-Lib Version: 2.0.0

Target Program A-Program consume A-Lib 1.0.0  
Target Program B-Program consume A-Lib 2.0.0  
Bests

---

<div class="post-metadata">

**Author:** ![retif](https://discourse.cmake.org/user_avatar/discourse.cmake.org/retif/32/1776_2.png) [@retif](https://discourse.cmake.org/u/retif)\
**Post date:** [April 29, 2024, 2:25pm UTC](https://discourse.cmake.org/t/library-versioning-best-practise/10759/2 "2024-04-29T14:25:04Z")

</div>

I would recommend to start using a package manager, such as [vcpkg](https://vcpkg.io/), but that might be a bit too complex, especially if those “different projects” are actually sub-projects of one common project.

Without a package manager you can probably get away with just the following (_assuming that `A-Lib` has a proper CMake package, which includes a version config too_):

```auto
find_package(A-Lib 2.0.0 CONFIG REQUIRED)

```

plus the ability to customize the [version selection](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-version-selection).
