2 Star 11 Fork 0

richardchien/coolq-http-api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 2.01 KB
一键复制 编辑 原始数据 按行查看 历史
richardchien 提交于 2019-10-16 23:07 . Try git submodule
cmake_minimum_required(VERSION 3.9)
project(coolq-http-api)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "/utf-8 ${CMAKE_CXX_FLAGS}") # use UTF-8 source files
set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}") # build with object level parallelism
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
include(cotire)
include(FindVcpkgIncludeDir)
include(FixDebugLibraryLookup)
include_directories(${VCPKG_INCLUDE_DIR})
include_directories(src)
add_subdirectory(extern/librcnb)
include_directories(extern/librcnb/include)
add_definitions(-DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE
-D_WIN32_WINNT=0x0501
-DWIN32_LEAN_AND_MEAN
-DNOMINMAX
-DCURL_STATICLIB)
# read app id from app_id.txt
file(READ "app_id.txt" APP_ID)
string(STRIP "${APP_ID}" APP_ID)
set(APP_ID "\"${APP_ID}\"")
add_compile_definitions(APP_ID=${APP_ID})
find_package(Boost REQUIRED COMPONENTS filesystem) # boost-property-tree stil depends on boost-filesystem
find_package(unofficial-iconv CONFIG REQUIRED)
find_package(CURL REQUIRED)
find_package(Spdlog REQUIRED)
find_package(sqlite3 CONFIG REQUIRED)
include(FixLinkConflict)
file(GLOB_RECURSE SOURCE_FILES src/*.cpp)
set(LIB_NAME "app")
add_library(${LIB_NAME} SHARED ${SOURCE_FILES})
target_link_libraries(${LIB_NAME} PRIVATE ${Boost_LIBRARIES})
target_link_libraries(${LIB_NAME} PRIVATE unofficial::iconv::libiconv unofficial::iconv::libcharset)
target_link_libraries(${LIB_NAME} PRIVATE ${CURL_AND_DEPS_LIBRARIES})
target_link_libraries(${LIB_NAME} PRIVATE ${SPDLOG_AND_DEPS_LIBRARIES})
target_link_libraries(${LIB_NAME} PRIVATE sqlite3)
target_link_libraries(${LIB_NAME} PRIVATE crypt32 bcrypt)
target_link_libraries(${LIB_NAME} PRIVATE rcnb-static)
cotire(${LIB_NAME})
add_custom_command(TARGET ${LIB_NAME}
POST_BUILD
COMMAND
powershell -ExecutionPolicy Bypass -NoProfile -File "${PROJECT_SOURCE_DIR}/scripts/post_build.ps1" ${APP_ID} ${LIB_NAME} "$<TARGET_FILE_DIR:${LIB_NAME}>")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/richardchien/coolq-http-api.git
git@gitee.com:richardchien/coolq-http-api.git
richardchien
coolq-http-api
coolq-http-api
master

搜索帮助