[CDRIVER-1197] CMake instructions for Windows out of date? Created: 11/Apr/16  Updated: 11/Apr/16  Resolved: 11/Apr/16

Status: Closed
Project: C Driver
Component/s: Build, libbson
Affects Version/s: 1.3.5
Fix Version/s: 1.4.0

Type: Bug Priority: Major - P3
Reporter: Steve Hickman Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Win7, VS2015, 32 bit, CMake 3.5


Issue Links:
Related
is related to CXX-891 CMake 3.5 GUI fails to find libbson w... Closed

 Description   

Using CMake GUI to build libbson and then C driver based on instructions found here: http://api.mongodb.org/c/current/installing.html. libbson builds fine. However, attempting to build C driver results in:
1) There is no BSON_ROOT_DIR variable listed in the CMAKE GUI Advanced list of variables. There are 2 other BSON related variables. I added BSON_ROOT_DIR, but I suspect there is a problem there.
2) Got link errors when running msbuild ALL_BUILD.vcxproj after configuring. First error is: LINK : fatal error LNK1104: cannot open file 'D:\Freeware\mongo\mongo-client-1.
3.5-install\libinstall.obj' [D:\Freeware\mongo\mongo-c-driver-build\test-libmon
goc.vcxproj]



 Comments   
Comment by Hannes Magnusson [ 11/Apr/16 ]

Glad you were able to figure it out!

Comment by Steve Hickman [ 11/Apr/16 ]

Andrew Morton's response to CXX-891 appears to have been sufficient to build both mongo-c-driver and mongo-cxx-driver. I consider this closed.

Comment by Hannes Magnusson [ 11/Apr/16 ]

I have never used the CMake GUI, bot having ran CMake I can successfully load the Solutions file into Visual Studio (2015) and compile it from there, or using the following script:

Oh, the BSON_ROOT_DIR is a mongoc variable, not libbson.

CMAKE="/cygdrive/c/cmake/bin/cmake"
MSBUILD="/cygdrive/c/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe"
GENERATOR="Visual Studio 14 2015 Win64"
 
cd ~/mongoc/src/libbson
"$CMAKE" -G "$GENERATOR"  "-DCMAKE_INSTALL_PREFIX=C:/mongoc"
"$MSBUILD" /m ALL_BUILD.vcxproj
"$MSBUILD" /m INSTALL.vcxproj
cd ../..
"$CMAKE" -G "$GENERATOR" "-DCMAKE_INSTALL_PREFIX=C:/mongoc" "-DBSON_ROOT_DIR=C:/mongoc"
"$MSBUILD" /m ALL_BUILD.vcxproj
"$MSBUILD" /m INSTALL.vcxproj

Generated at Wed Feb 07 21:11:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.