workflow、srpc源代码编译

2023-12-19 09:46:07 浏览数 (3)

workflow

https://gitee.com/sogou/workflow.git windows代码在分支中可以看到

依赖openssl:https://gitee.com/mirrors/openssl.git,源码中没有openssl-config.cmake workflow的cmake

find_package(openssl require)

改为

set(OPENSSL_INCLUDE_DIR e:/opensource/openssl/include) find_library(OPENSSL_LIBRARY_DIR ssl PATHS e:/opensource/openssl)

srpc

https://gitee.com/sogou/srpc.git

find_package(snappy) find_package(openssl) find_package(protobuf) find_package(workflow)

改为

add_subdirectory(./third_party/snappy) 去掉snappy中的googletest和benchmark set(OPENSSL_INCLUDE_DIR e:/opensource/openssl/include) find_path(OPENSSL_LINK_DIR libssl e:/opensource/openssl) set(Protobuf_INCLUDE_DIR E:/Opensource/protobufsource/src) find_file(WORKFLOW_INCLUDE_DIR include …/workflow/src)


find_package找不到*-config.cmake或者*config.cmake可以改成find_file、find_library、find_path等函数,已经有值时,find_package不会重复搜索,可以使用下面语句清除变量

unset(name, CACHE)

find_package、find_file等不会遍历文件夹,可以使用file(GLOB_RECURSE,…)

0 人点赞