Windows 10上源码编译glog和gflags 编写glog-config.cmake和gflags-config.cmake

本文首发于个人博客https://kezunlin.me/post/bb64e398/,欢迎阅读!

compile glog v0.3.5 and glags on windows from source.

Series

Guide

version

  • glog: v0.3.5 https://github.com/google/glog/archive/v0.3.5.zip
  • gflag: v2.2.1 https://github.com/schuhschuh/gflags/archive/v2.2.1.zip

gflags

do not use offical version,instead use https://github.com/schuhschuh/gflags.git

    git clone https://github.com/schuhschuh/gflags.git 
    cd gflags
    mkdir windows-build
    cd windows-build
    cmake-gui ..

with options

    BUILD_SHARED_LIBS ON 
    INSTALL_SHARED_LIBS ON
    INSTALL_STATIC_LIBS OFF
    CMAKE_CONFIGURATION_TYPES Release # Release
    REGISTER_INSTALL_PREFIX OFF
    CMAKE_INSTALL_PREFIX D:/gflags
    #NAMESPACE google;gflags
    NAMESPACE google

or command

        cmake -DGFLAGS_NAMESPACE=google -DCMAKE_CXX_FLAGS=-fPIC ..

we get include and lib/gflags.lib, and bin/gflags.dll

modify CMAKE/CMAKE_INSTALL_PREFIX to a non-system folder, otherwise you will need adminis

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值