Questions tagged [cmake-js]

CMake.js is a Node.js/io.js native addon build tool which works exactly like node-gyp, but instead of gyp, it is based on CMake build system.

CMake.js is a Node.js/io.js native addon build tool which works exactly like node-gyp, but instead of gyp, it is based on CMake build system.

It is often used along with [cmake], [node.js] and [npm].

Official

12 questions
3
votes
1 answer

NodeJS, difference between N-API, nan, node-gyp and cmake-js

I am trying to learn how to use C and/or C++ libraries inside NodeJS. But it is somewhat confusing the many different tools and approaches, and the relation between them. What is the difference between NodeJS N-API and "nan", and what is the role…
Paulo Coghi
  • 13,724
  • 14
  • 68
  • 90
2
votes
1 answer

Cannot generate 32 bit configuration for Visual Studio 2019 with host=x86 or -A Win32

I am trying to configure cmake to build for 32bit and 64bit separately... So far 64bit is easy as I just need to add -A x64 cmake -G "Visual Studio 16 2019" -A x64 But I am not able to set 32bit arch. Official documentation suggest -A Win32 or…
AtiqGauri
  • 1,483
  • 13
  • 26
2
votes
1 answer

NAPI native module in C++ is executing partially (Included std::thread)

My Node-js native module written with NAPI is executing partially.I have used multiple threads in it.While running module sometime it prints that thread is started but sometime it don't.And in either way module never reach the end of c++ code. I…
AtiqGauri
  • 1,483
  • 13
  • 26
1
vote
0 answers

compiling a script employing lib2geom with cmake-js for use in N-API node.js addon

I am attempting to make use of lib2geom in an Electron app. I was able to write a script that employs the library to obtain an intersection of two paths and then wrap it with node-addon-api using examples from…
J. Barca
  • 538
  • 6
  • 19
1
vote
0 answers

Pass package.json commands from a js file

I am working on a node.js native addon. While building for 32bit and 64 bit I have to set two different command for two different field. for 32bit "scripts": { "install": "cmake-js compile cmake -G \"Visual Studio 16 2019\" -A…
AtiqGauri
  • 1,483
  • 13
  • 26
1
vote
0 answers

NodeJs Addon Width C++/CLI and C# assembly I can not make it run

I am trying to build an addon in nodejs using CMAKE. The CPP file has a very basic dependency created by me in CSharp, a class that has to be called from the CPP. When I perform this operation in a CPP console application compiled with Visual Studio…
Manu Overa
  • 31
  • 4
1
vote
1 answer

Unix make file fails with cmakejs when adding a dependency

I successfully created a native node addon with napi and cmakejs. But when adding a simple library the unix make file, generated by cmake-js explodes with [ 50%] Linking CXX static library liblib_name.a [ 50%] Built target lib_name …
Superlokkus
  • 4,731
  • 1
  • 25
  • 57
0
votes
0 answers

Cmakejs Electron build error. Can't find header files for node v18.16.1

I'm trying to bind a massive cpp project that building with Cmake to my client app in Electron context. I altered CmakeList.txt to build *.node extensions and managed to run in in js side but when i try to use it with electron it gives error like…
0
votes
1 answer

Using cmake.js with google test for testing a node.js addon

I am trying to test a node-js addon (built with cmake-js) with google test. I am building on Mac OS. The addon target builds and runs ok, but I have problems with the googletest target. I am getting linking errors related to undefined V8 methods. In…
0
votes
0 answers

cmake.js and node_module_version

After building my electron node addon using cmake-js I got the following error This version of Node.js requires NODE_MODULE_VERSION 103. Please try re-compiling or re-installing What's the proper way to specify the node module version in cmake.js…
asmbaty
  • 436
  • 2
  • 11
0
votes
1 answer

Why can't N-API find some bindings when using napi_property_descriptor array?

I have the following code... // robot_node.c #include #include #include "robot_node.h" #include "robot.h" napi_value node_forward(napi_env env, napi_callback_info info){ napi_value result; napi_status status; int…
Jackie
  • 21,969
  • 32
  • 147
  • 289
0
votes
1 answer

How do I use CMakeJS when Node is compile from source?

I typically compile my NodeJS from source. I have recently started to try to integrate some C code using CMakeJS. On my Raspberry PI, everything compiles fine using... node --version v13.13.0 But when I try on my laptop with... node…
Jackie
  • 21,969
  • 32
  • 147
  • 289