@@ -8,6 +8,8 @@ if (ENABLE_TESTS AND NOT ENABLE_STATIC MATCHES "ON|AUTO")
8
8
message (FATAL_ERROR "-DENABLE_STATIC=OFF also requires -DENABLE_TESTS=OFF" )
9
9
endif ()
10
10
11
+ set (BSON_OUTPUT_BASENAME "bson" CACHE STRING "Output bson library base name" )
12
+
11
13
include (CheckFunctionExists )
12
14
include (CheckIncludeFile )
13
15
include (CheckStructHasMember )
@@ -22,7 +24,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/../../build/cm
22
24
include (LoadVersion )
23
25
LoadVersion (${PROJECT_SOURCE_DIR} /../../VERSION_CURRENT BSON )
24
26
25
- message ("libbson version (from VERSION_CURRENT file): ${BSON_VERSION} " )
27
+ message ("lib ${BSON_OUTPUT_BASENAME} version (from VERSION_CURRENT file): ${BSON_VERSION} " )
26
28
27
29
set (BSON_API_VERSION 1.0 )
28
30
@@ -218,16 +220,16 @@ set (CMAKE_CXX_VISIBILITY_PRESET hidden)
218
220
target_compile_definitions (bson_shared PRIVATE BSON_COMPILATION JSONSL_PARSE_NAN )
219
221
target_include_directories (bson_shared INTERFACE $< BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /src> $< BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} /src> )
220
222
set_target_properties (bson_shared PROPERTIES VERSION 0.0.0 SOVERSION 0 )
221
- set_target_properties (bson_shared PROPERTIES OUTPUT_NAME "bson -${BSON_API_VERSION} " PREFIX "lib" )
223
+ set_target_properties (bson_shared PROPERTIES OUTPUT_NAME "${BSON_OUTPUT_BASENAME} -${BSON_API_VERSION} " PREFIX "lib" )
222
224
223
225
if (ENABLE_APPLE_FRAMEWORK )
224
- set_target_properties (bson_shared PROPERTIES
225
- FRAMEWORK TRUE
226
- MACOSX_FRAMEWORK_BUNDLE_VERSION ${MONGOC_VERSION}
226
+ set_target_properties (bson_shared PROPERTIES
227
+ FRAMEWORK TRUE
228
+ MACOSX_FRAMEWORK_BUNDLE_VERSION ${MONGOC_VERSION}
227
229
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${MONGOC_VERSION}
228
230
MACOSX_FRAMEWORK_IDENTIFIER org.mongodb.bson
229
- OUTPUT_NAME "bson "
230
- PUBLIC_HEADER "${HEADERS} "
231
+ OUTPUT_NAME "${BSON_OUTPUT_BASENAME} "
232
+ PUBLIC_HEADER "${HEADERS} "
231
233
)
232
234
endif ()
233
235
@@ -264,7 +266,7 @@ if (ENABLE_STATIC MATCHES "ON|AUTO")
264
266
)
265
267
target_include_directories (bson_static INTERFACE $< BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /src> $< BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} /src> )
266
268
set_target_properties (bson_static PROPERTIES VERSION 0.0.0 )
267
- set_target_properties (bson_static PROPERTIES OUTPUT_NAME "bson -static-${BSON_API_VERSION} " )
269
+ set_target_properties (bson_static PROPERTIES OUTPUT_NAME "${BSON_OUTPUT_BASENAME} -static-${BSON_API_VERSION} " )
268
270
# We use CMAKE_THREAD_LIBS_INIT rather than Threads::Threads here because the
269
271
# latter fails when building on Mac OS X
270
272
target_link_libraries (bson_static ${CMAKE_THREAD_LIBS_INIT} )
0 commit comments