Skip to content

Develop

ShrBox edited this page Jun 20, 2024 · 6 revisions

English | Chinese

依赖本插件开发新维度

依赖本插件开发新维度,我建议使用xmake来构建项目

xmake

在你的项目里添加以下内容来导入本插件

add_requires("more-dimension")

以上默认导入的是最新版本,如果你需要导入某一版本:

add_requires("more-dimension x.x.x")

其中x.x.x为版本号,然后在你需要使用的文件导入

#include "more_dimensions/api/dimension/CustomDimensionManager.h"

即可

其他(比如cmake)

请在Code页面,绿色按钮下拉菜单Download ZIP下载本项目,然后放在你的cmake项目某个位置中,导入

#include "src/more_dimensions/api/dimension/CustomDimensionManager.h" // 根据你放的位置与cmake配置更改

头文件即可

使用

根据src/test内的示例文件查看调用即可

Developing New Dimensions with Dependency on This Plugin

When developing new dimensions that depend on this plugin, I recommend using xmake for project construction.

xmake

In your project, add the following content to import this plugin:

add_requires("more-dimension")

By default, this imports the latest version. If you need to import a specific version:

add_requires("more-dimension x.x.x")

Replace x.x.x with the desired version. Then, in the files where you need to use it, include:

#include "more_dimensions/api/dimension/CustomDimensionManager.h"

Other (e.g., CMake)

On the Code page, click the green button dropdown menu "Download ZIP" to download this project. Place it in a suitable location within your CMake project, and then include:

#include "src/more_dimensions/api/dimension/CustomDimensionManager.h" // Adjust based on your location and CMake configuration

This includes the necessary header file.

Usage

Refer to the example files in src/test to see how to call the plugin.