cmake: changes for nodejs 4.1.1 - resubmit

Signed-off-by: Eugene Bolshakov <pub@relvarsoft.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Eugene Bolshakov 2015-11-24 02:50:17 +03:00 committed by Mihai Tudor Panu
parent 011013e800
commit 1adea8ecf1
2 changed files with 15 additions and 6 deletions

View File

@ -5,7 +5,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message("WARNING: building into sources dir can be risky, prefer other directory")
endif ()
find_package (SWIG)
find_package (SWIG 3.0.5)
if (SWIG_FOUND)
include (${SWIG_USE_FILE})
endif ()
@ -28,7 +28,7 @@ include(GNUInstallDirs)
# Make a version file containing the current version from git.
include (GetGitRevisionDescription)
git_describe (VERSION "--tags")
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND")
if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_-128-NOTFOUND")
message (WARNING " - Install git to compile a production UPM!")
set (VERSION "v0.4.0-dirty")
endif ()

View File

@ -47,6 +47,15 @@ macro(upm_SWIG_NODE)
PREFIX ""
SUFFIX ".node"
)
if (${V8_VERSION_MAJOR} GREATER 3)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
message(FATAL_ERROR " **ERROR** GCC 4.7 or above is required to compile jsupm_${libname} ")
endif()
endif()
set_property (TARGET jsupm_${libname} PROPERTY CXX_STANDARD 11)
set_property (TARGET jsupm_${libname} PROPERTY CXX_STANDARD_REQUIRED ON)
endif()
createpackagejson(${libname})
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/jsupm_${libname}.node
DESTINATION lib/node_modules/jsupm_${libname} COMPONENT ${libname})