[CDRIVER-2781] Windows install doesn't work as documented? Created: 01/Aug/18  Updated: 27/Oct/23  Resolved: 01/Aug/18

Status: Closed
Project: C Driver
Component/s: Build
Affects Version/s: 1.12.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Bernie Volz Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10


Attachments: Text File CMakeOutput.log    

 Description   

When trying to following Windows Visual Studio build instructions (on http://mongoc.org/libmongoc/current/installing.html) after download the 1.12.0 kit, I get:

f:\Downloads\temp\mongo-c-driver-1.12.0\cmake-build>cmake -G "Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=f:\mongo-c-driver" "-DCMAKE_BUILD_TYPE=Release"
CMake Error: The source directory "F:/Downloads/temp/mongo-c-driver-1.12.0/cmake-build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

And also the following fails:

f:\Downloads\temp\mongo-c-driver-1.12.0\cmake-build>cmake -LH
CMake Error: The source directory "F:/Downloads/temp/mongo-c-driver-1.12.0/cmake-build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
– Cache values

If I copy the ..\CMakeLists.txt into this directory, I get a bit further:

f:\Downloads\temp\mongo-c-driver-1.12.0\cmake-build>cmake -G "Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=f:\mongo-c-driver" "-DCMAKE_BUILD_TYPE=Release"
– Selecting Windows SDK version to target Windows 10.0.16299.
– The C compiler identification is ;MSVC 19.0.24215.1
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
– Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
CMake Error at CMakeLists.txt:65 (include):
include could not find load file:

LoadVersion

CMake Error at CMakeLists.txt:66 (LoadVersion):
Unknown CMake command "LoadVersion".

– Configuring incomplete, errors occurred!
See also "F:/Downloads/temp/mongo-c-driver-1.12.0/cmake-build/CMakeFiles/CMakeOutput.log".

 

I am successful if I don't "cd cmake-build".

 

I am using cmake-3.12.0-win64-x64.msi.

 

Thus, I think the steps:

cd mongo-c-driver-1.12.0
mkdir cmake-build
cd cmake-build
cmake -G "Visual Studio 14 2015 Win64" \
"-DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver" \
"-DCMAKE_PREFIX_PATH=C:\mongo-c-driver" \
..

Are incorrect or are missing something.

Instead it should be:

cd mongo-c-driver-1.12.0
cmake -G "Visual Studio 14 2015 Win64" \
"-DCMAKE_INSTALL_PREFIX=C:\mongo-c-driver" \
"-DCMAKE_PREFIX_PATH=C:\mongo-c-driver" \
..

 



 Comments   
Comment by Kevin Albertson [ 01/Aug/18 ]

No worries, glad it worked out!

Comment by Bernie Volz [ 01/Aug/18 ]

Ah .. thanks .. sorry ... I had thought that was "..." to indicate other options!

Sorry I missed that. I assume you'd junk the bug. (I did what I needed by just doing it at the top level).

  • Bernie
Comment by Kevin Albertson [ 01/Aug/18 ]

Hi Bernie,

The first command you pasted

cmake -G "Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=f:\mongo-c-driver" "-DCMAKE_BUILD_TYPE=Release"

Is missing the trailing "..". It should be:

cmake -G "Visual Studio 14 2015 Win64" "-DCMAKE_INSTALL_PREFIX=f:\mongo-c-driver" "-DCMAKE_BUILD_TYPE=Release" ..

The cmake command has the syntax: cmake [options] <path-to-source>, so the trailing ".." is for the directory containing the root CMakeLists.txt.

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