-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMakeLists in node.native + seperate project? #33
Comments
Hi Alec, You'll need to link to libuv.so - you'll have to cook that into your CMakeLists.txt file. You'll also need to link http-parser.o into your executable. Here's how I do this for a project I've been developing where I've used autotools, so this is a Makefile.am (which gets turned into Makefile.in, then finally into a Makefile). The program is called "dt": =================================== AUTOMAKE_OPTIONS = check-news dist-bzip2 SUBDIRS = src bin_PROGRAMS = dt dt_SOURCES = dt.cpp dt_LDADD = src/ipp/libdtipp.la /usr/local/lib/libuv.a /usr/local/lib/http_parser.o INCLUDES = -I./usr/local/include CLEANFILES = *~ MAINTAINERCLEANFILES = aclocal.m4 dt-*.tar.gz dt-*.tar.bz2 dt-*.diff ==================================== Note that my includes are in /usr/local/include and my libs (libuv.so and http-parser.o) are in /usr/local/lib/ I added a few lines to the node.native Makefile so that it would install the relevant files into /usr/local/include and /usr/local/lib/ on my Debian development system. This is really just a quick hack: ========================================================= # Note: Copy in libuv and http-parser, as required with this? Will eventually make myself # a libnative shared object? install: # http-parser (headers and object code) cp http-parser/http_parser.h /usr/local/include/ # libuv (headers and static lib) cp libuv/libuv.a /usr/local/lib/ mkdir -p /usr/local/include/uv cp libuv/include/uv.h /usr/local/include/ cp -Ra libuv/include/uv-private /usr/local/include/ # node.native (headers only) cp -Ra native /usr/local/include/ ================================================ With this, I can do "make install" in node.native then go over to my "dt" directory and compile there. Hope that helps, Seb |
Thanks Seb, will try that tonight. In the meantime, can you help me understand why people are writing vanilla Makefiles rather than using CMake? Isn't one of the big advantages of libuv that it abstracts cross-platform differences? |
How do I setup a separate project that works with node.native (from git, not from install library locations)?
Here is what I have tried:
Then I created main.cpp and CMakeLists.txt:
But unfortunately I get these errors: Qt Creator screenshot
How do I fix this? - Also, are you planning on moving from vanilla Makefiles to CMake?
The text was updated successfully, but these errors were encountered: