You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.0 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. #find_package(glog REQUIRED)
  2. #list(APPEND third_party_libraries glog::glog)
  3. #在/usr/bin目录里面 我需要clion自动关联里面的库,有好几个库的
  4. set(GLOG_ROOT_DIR ${LIB_BASE_DIR}/glog-src)
  5. set(GLOG_BUILD_DIR ${LIB_BASE_DIR}/glog-build)
  6. if(NOT EXISTS ${GLOG_BUILD_DIR})
  7. message(STATUS "${BoldGreen}Install glog to: ${GLOG_BUILD_DIR}${ColourReset}")
  8. execute_process(
  9. COMMAND mkdir glog-build
  10. WORKING_DIRECTORY ${LIB_BASE_DIR})
  11. execute_process(
  12. COMMAND cmake -S ${GLOG_ROOT_DIR} -B . -DGFLAGS_NAMESPACE=google
  13. WORKING_DIRECTORY ${GLOG_BUILD_DIR})
  14. execute_process(
  15. COMMAND cmake --build . -j4
  16. WORKING_DIRECTORY ${GLOG_BUILD_DIR})
  17. endif()
  18. find_package(glog REQUIRED CONFIG HINTS ${GLOG_ROOT_DIR})
  19. message(STATUS "${BoldGreen}Find Package glog: ${glog_FOUND}${ColourReset}")
  20. include_directories(${GLOG_BUILD_DIR})
  21. include_directories(${GLOG_ROOT_DIR}/src)
  22. link_directories(${GLOG_BUILD_DIR})
  23. # glog::glog is imported target
  24. list(APPEND third_party_libraries glog::glog)