diff --git a/common/cmake_build.md b/common/cmake_build.md new file mode 100755 index 0000000000000000000000000000000000000000..58911df68891f605db40f896a23edcd4f6c74822 --- /dev/null +++ b/common/cmake_build.md @@ -0,0 +1,43 @@ +# 三方库加入IDE(DevEco Studio)工程 + +## 概述 + +本文介绍如何将三方库加入IDE(DevEco studio)工程 + + + +## 环境准备 + +- DevEco studio[下载地址](https://developer.harmonyos.com/cn/develop/deveco-studio/) + + + +## 开发步骤 + +这里以helloworld工程引入三方库为例 + +### 新建工程 + +新建一个native c++工程 + + ![](pic/cmake_create_project.png) + + + +### 加入工程 + +将三方库加入工程中,有如下步骤: + +- 将三方库加入到工程目录下 + + +- 在工程根目录下的CMakeLists.txt中,使用add_subdirectory命令调用子目录中的CMakeLists.txt来进行编译 + + +- 引入三方库头文件,使用include_directories命令指定工程所使用的三方库的头文件的目录 + + +- 链接三方库的动态库,注意,生成的三方库动态库名称可以在三方库构建脚本中查到 + +![cmake-build](pic/cmake_build.png) + diff --git a/common/pic/cmake_build.png b/common/pic/cmake_build.png new file mode 100755 index 0000000000000000000000000000000000000000..6d4813d7d4243a165ae7e4daffe5ff48e8a89016 Binary files /dev/null and b/common/pic/cmake_build.png differ diff --git a/common/pic/cmake_create_project.png b/common/pic/cmake_create_project.png new file mode 100755 index 0000000000000000000000000000000000000000..2b14812b0c765a471d21b836c85c3f1a6e3aad29 Binary files /dev/null and b/common/pic/cmake_create_project.png differ