1.0.0-beta.4 • Published 8 months ago

@cpp.js/sample-lib-cmake v1.0.0-beta.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@cpp.js/sample-lib-cmake

Cpp.js sample library: simple cmake library

Integration

Start by installing these package with the following command:

npm install @cpp.js/sample-lib-cmake

To enable the library, modify the cppjs.config.js file as shown below.

import getDirName from 'cpp.js/src/utils/getDirName.js';
+import cmakeSample from '@cpp.js/sample-lib-cmake/cppjs.config.js';

export default {
    dependencies: [
+        cmakeSample
    ]
    paths: {
        project: getDirName(import.meta.url),
    },
};

Usage

Below are the steps to use the library in your C++ or JavaScript code.

Usage in C++ Code

+#include <cppjs-lib-samplebasic-cmake/samplebasiccmake.h>

std::string Native::sample() {
+    return SampleBasicCmake::sample();
}

Usage in JavaScript Code (web, with plugin)

import { initCppJs } '@cpp.js/sample-lib-cmake/cppjs-lib-samplebasic-cmake/samplebasiccmake.h';

const { SampleBasicCmake } = await initCppJs();
console.log(SampleBasicCmake.sample());
1.0.0-beta.4

8 months ago

1.0.0-beta.3

8 months ago