Comments (5)
在 component 里面 find吧,比如
examples/demo/main/CmakeLists.txt
, 一般不需要编辑examples/demo/CmakeLists.txt
感谢,目前通过以下方法,已成功与 vcpkg
配合使用
- 在项目目录下
.config.mk
或config_defaults.mk
内配置CONFIG_TOOLCHAIN_PATH="~/vcpkg/scripts/buildsystems/vcpkg.cmake"
- 新建组件目录
component/component_name
- 组件目录下
CMakeLists.txt
内引入包,如curl
find_package(CURL CONFIG REQUIRED) list(APPEND ADD_REQUIREMENTS CURL::libcurl) register_component()
- 项目目录下
main/CMakeLists.txt
内list(APPEND ADD_REQUIREMENTS component_name)
from c_cpp_project_framework.
目前这个项目里面比较少考虑直接引用系统的包,值得探讨下实现方式。
- 一种是像opencv这种直接提供了 cmake文件的,直接引用是最好的,可以把源码放在component下,也可以直接引用系统的,这是在 cmake 世界里面比较通用的方法,常用的开源项目应该都有人写过,搜一下应该就能找到
set (OpenCV_DIR opencv/lib/cmake/opencv4)
find_package(OpenCV REQUIRED)
- 另外比较原始的方法就是可以直接将源码拉进来在cmakelists.txt文件加源码搜索路径,或者添加搜索 .so 和 .h 文件路径
from c_cpp_project_framework.
若使用 find_package
引入包,find_package
要在 project()
命令之后,我尝试将 include(${SDK_PATH}/tools/cmake/compile.cmake)
放到 project
之后,发现 python project.py build
未报错,但未编译出任何目标
from c_cpp_project_framework.
在 component 里面 find吧,比如 examples/demo/main/CmakeLists.txt
, 一般不需要编辑examples/demo/CmakeLists.txt
from c_cpp_project_framework.
from c_cpp_project_framework.
Related Issues (6)
- 如何支持 ninja menuconfig HOT 5
- 项目管理脚本 HOT 3
- 组件分类 HOT 7
- 使用 cmake 编译时的代码版本问题 HOT 1
- 怎样给 toolchain 文件传递参数 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c_cpp_project_framework.