Skip to content

Commit 06b23c4

Browse files
[CDRIVER-4733] Replace version macros expanded in configure-generated files (#1411)
1 parent 015c449 commit 06b23c4

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ if (USE_SYSTEM_LIBBSON)
333333
# but you should use the standard CMAKE_PREFIX_PATH instead.
334334
message (STATUS "Searching for libbson CMake packages")
335335
find_package (bson-1.0
336-
"${MONGOC_MAJOR_VERSION}.${MONGOC_MINOR_VERSION}.${MONGOC_MICRO_VERSION}"
336+
"${PROJECT_VERSION}"
337337
HINTS
338338
${BSON_ROOT_DIR})
339339

src/libmongoc/src/mongoc-config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include(CMakeFindDependencyMacro)
2-
find_dependency(bson-1.0 @MONGOC_MAJOR_VERSION@.@MONGOC_MINOR_VERSION@.@MONGOC_MICRO_VERSION@)
2+
find_dependency(bson-1.0 @libmongoc_VERSION@)
33
include("${CMAKE_CURRENT_LIST_DIR}/mongoc-targets.cmake")
44

55
unset(_required)

src/libmongoc/src/mongoc/mongoc-version.h.in

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
*/
1616

1717

18-
#if !defined (MONGOC_INSIDE) && !defined (MONGOC_COMPILATION)
18+
#if !defined(MONGOC_INSIDE) && !defined(MONGOC_COMPILATION)
1919
#error "Only <mongoc/mongoc.h> can be included directly."
2020
#endif
2121

22+
// clang-format off
2223

2324
#ifndef MONGOC_VERSION_H
2425
#define MONGOC_VERSION_H
@@ -29,39 +30,39 @@
2930
*
3031
* MONGOC major version component (e.g. 1 if %MONGOC_VERSION is 1.2.3)
3132
*/
32-
#define MONGOC_MAJOR_VERSION (@MONGOC_MAJOR_VERSION@)
33+
#define MONGOC_MAJOR_VERSION (@libmongoc_VERSION_MAJOR@)
3334

3435

3536
/**
3637
* MONGOC_MINOR_VERSION:
3738
*
3839
* MONGOC minor version component (e.g. 2 if %MONGOC_VERSION is 1.2.3)
3940
*/
40-
#define MONGOC_MINOR_VERSION (@MONGOC_MINOR_VERSION@)
41+
#define MONGOC_MINOR_VERSION (@libmongoc_VERSION_MINOR@)
4142

4243

4344
/**
4445
* MONGOC_MICRO_VERSION:
4546
*
4647
* MONGOC micro version component (e.g. 3 if %MONGOC_VERSION is 1.2.3)
4748
*/
48-
#define MONGOC_MICRO_VERSION (@MONGOC_MICRO_VERSION@)
49+
#define MONGOC_MICRO_VERSION (@libmongoc_VERSION_PATCH@)
4950

5051

5152
/**
5253
* MONGOC_PRERELEASE_VERSION:
5354
*
5455
* MONGOC prerelease version component (e.g. pre if %MONGOC_VERSION is 1.2.3-pre)
5556
*/
56-
#define MONGOC_PRERELEASE_VERSION (@MONGOC_PRERELEASE_VERSION@)
57+
#define MONGOC_PRERELEASE_VERSION (@libmongoc_VERSION_PRERELEASE@)
5758

5859

5960
/**
6061
* MONGOC_VERSION:
6162
*
6263
* MONGOC version.
6364
*/
64-
#define MONGOC_VERSION (@MONGOC_VERSION@)
65+
#define MONGOC_VERSION (@libmongoc_VERSION_FULL@)
6566

6667

6768
/**
@@ -70,7 +71,7 @@
7071
* MONGOC version, encoded as a string, useful for printing and
7172
* concatenation.
7273
*/
73-
#define MONGOC_VERSION_S "@MONGOC_VERSION@"
74+
#define MONGOC_VERSION_S "@libmongoc_VERSION_FULL@"
7475

7576

7677
/**

0 commit comments

Comments
 (0)