Glog has a .sln
file and VS project files, but they are obsolete and out of maintenance. So the right way is to build using cmake.
Here's the way to build and install it. And it's not limited to glog, but applicable to most cmake-based projects.
- Install the right version of cmake. Usually the newest is the safest.
- Open cmake-gui.exe, and use it to generate VS solution.
- At the top of it, fill in the source code folder (like
D:/glog-0.3.5
) and where to build (like D:/glog-0.3.5/build
). The latter is where the whole VS solution files will be generated to.
- Click "Configure" button, and it will let you select your platform. Be sure to use the right one.
- After configuring, a list of options will be listed and probably marked as red. Don't be upset about the red. Just go through them, and modify those you want to.
- (For glog only) You may need to specify gflags path in
Ungrouped Entries/gflags_DIR
or disable gflags by unchecking WITH/WITH_GFLAGS
. Also, modify CMAKE/CMAKE_INSTALL_PREFIX
to a non-system folder, otherwise you will need administrative privileges to run INSTALL
project.
- If you modified any items, press "Configure" again to make it work.
- When everything is configured right, press "Generate" to generate VS solution. Then you can open it by clicking "Open Project".
- In the VS project, select the configuration you want to build (I mean x64/win32, Release/Debug, etc), then build
ALL_BUILD
to build the project. Then you can build INSTALL
, this will copy the headers and libraries to CMAKE/CMAKE_INSTALL_PREFIX
folder for a new project to use.