how to include .node extentions in cmake

Hello gurus,

can I kindly ask you what all do i need to put into cmakelists.txt if i have fresh project?

I have compiled node-rfc extention of node.js so now i have the build folder (c:\Qt\nodejs\node_modules\npm\node_modules\node-rfc\build\Release) with files (*.exp, *.iobj, *.ipdb, *.lib, *.node, *.pdb)

So now i need to include the *.node and *.lib in my cmakelists.txt in order to run my first javascript code from QT creator.

Can I kindly ask for a little example? honestly I do not understand what all needs to be done (include_directories(), link_directories(), find_package(), target_link_libraries(), and perhaps anything else, or only some of it?)

Thank you!

I don’t know how to include .node files, but .lib files are linkable. You can set up an IMPORTED target to represent this library:

This is a fairly simple example:

Once you have a Find module for node-rfc, you can then consume it via target_link_libraries(YourTarget PRIVATE NodeRfc::NodeRfc) (depending on what you name the imported target).