Private
Public Access
2
0

firmata: install node_modules to where cmake guessed node was

This does now mean that modules won't go to /usr/local with the default prefix
but may instead try to install in /usr/lib. However if using nvm they should go
to the right place as long as NODE_ROOT_DIR is set correctly. This commit
changes NODE_ROOT_DIR to actually refer to the root directory of node rather
than the include dir which is what FindNodejs gets

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-03-21 15:19:00 +00:00
parent fac9d99f01
commit a17079c460
4 changed files with 12 additions and 9 deletions

View File

@@ -54,11 +54,14 @@ if (${V8_VERSION_MAJOR} GREATER 3)
endif ()
endif ()
set (NODE_MODULE_INSTALL_PATH ${NODE_ROOT_DIR}/lib/node_modules/mraa/)
message (STATUS "INFO - install NODE modules to ${NODE_MODULE_INSTALL_PATH}")
macro (mraa_CREATE_INSTALL_PACKAGE_JSON generated_file install_location)
configure_file (${generated_file}.cmake ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} @ONLY)
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${generated_file} DESTINATION ${install_location})
endmacro (mraa_CREATE_INSTALL_PACKAGE_JSON)
mraa_create_install_package_json (package.json lib/node_modules/mraa)
mraa_create_install_package_json (package.json ${NODE_MODULE_INSTALL_PATH})
macro (mraa_CREATE_BINDING_GYP generated_file)
set (mraa_LIB_SRCS_GYP "")
@@ -110,4 +113,4 @@ if (BUILDDOC)
endif ()
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/mraa.node
DESTINATION lib/node_modules/mraa)
DESTINATION ${NODE_MODULE_INSTALL_PATH})

View File

@@ -1,7 +1,7 @@
{
"name" : "mraa",
"description": "IO library that helps you use I2c, SPI, gpio, uart, pwm, analog inputs (aio) and more on a number of platforms such as the Intel galileo, the Intel edison and others",
"keywords":["gpio", "edison","galileo","io", "mraajs", "spi", "i2c", "minnow", "intel"],
"keywords":["gpio", "edison","galileo","io", "mraajs", "spi", "i2c", "minnow", "intel", "firmata"],
"homepage": "http://github.com/intel-iot-devkit/mraa",
"main" : "./mraa.node",
"engines": {