Vscode + Cmake + vcpkg + sqlite3
vcpkg
vcpkg - 一个用于管理 C 和 C++ 库的工具,支持在 Windows、Linux 和 macOS 上安装和集成各种库。
项目地址:https://gitcode.com/gh_mirrors/vc/vcpkg

·
使用vs community 2019 x86 编译
安装包
vcpkg install sqlite3:x86-windows
CMakeLists.txt
vcpkg
vcpkg - 一个用于管理 C 和 C++ 库的工具,支持在 Windows、Linux 和 macOS 上安装和集成各种库。
项目地址:https://gitcode.com/gh_mirrors/vc/vcpkg
# CMake 最低版本号要求
cmake_minimum_required (VERSION 3.16)
SET(DCMAKE_TOOLCHAIN_FILE "E:/usr/vcpkg-master_0107/vcpkg-master/scripts/buildsystems/vcpkg.cmake")
# 没加这行折腾半天
include("E:/usr/vcpkg-master_0107/vcpkg-master/scripts/buildsystems/vcpkg.cmake")
# 项目信息
project (cmakeclang)
find_package(sqlite3 CONFIG REQUIRED)
# 查找当前目录下的所有源文件
# 并将名称保存到 DIR_SRCS 变量
aux_source_directory(. DIR_SRCS)
# 指定生成目标
add_executable(cmakeclang ${DIR_SRCS})
target_link_libraries(cmakeclang PRIVATE sqlite3)
main.cpp
#include <iostream>
#include <sqlite3.h>
using namespace std;
int main()
{
printf("%s\n", sqlite3_libversion());
cout << "Hello, world!" << endl;
return 0;
}




vcpkg - 一个用于管理 C 和 C++ 库的工具,支持在 Windows、Linux 和 macOS 上安装和集成各种库。
最近提交(Master分支:5 个月前 )
1d0f0a39
23 天前
d5ec5288
27 天前
更多推荐
相关推荐
查看更多
vcpkg

vcpkg - 一个用于管理 C 和 C++ 库的工具,支持在 Windows、Linux 和 macOS 上安装和集成各种库。
vcpkg

vcpkg-tool

Components of microsoft/vcpkg's binary.
所有评论(0)