Browse Source

Use CMake's standard way to find Python.

Rather than have the python literal string, use CMake's find_package
to find actual python executable. This is more useful if you have
both Python 2 and 3 installed. CMake currently only supports python 2
and so will automatically find that version
v0.7.4-release
Nikhil Marathe 14 years ago
committed by Tom Hughes
parent
commit
1b6b090cdc
  1. 2
      CMakeLists.txt
  2. 2
      cmake/node_build.cmake
  3. 4
      cmake/v8_build.cmake

2
CMakeLists.txt

@ -5,6 +5,8 @@ project(node)
# options # options
# #
find_package(PythonInterp 2 REQUIRED)
option(SHARED_V8 "use system shared V8 library") option(SHARED_V8 "use system shared V8 library")
option(SHARED_LIBEV "use system shared libev library") option(SHARED_LIBEV "use system shared libev library")
option(SHARED_CARES "use system shared c-ares library") option(SHARED_CARES "use system shared c-ares library")

2
cmake/node_build.cmake

@ -4,7 +4,7 @@
add_custom_command( add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/src/node_natives.h OUTPUT ${PROJECT_BINARY_DIR}/src/node_natives.h
COMMAND tools/js2c.py ${PROJECT_BINARY_DIR}/src/node_natives.h ${js2c_files} COMMAND ${PYTHON_EXECUTABLE} tools/js2c.py ${PROJECT_BINARY_DIR}/src/node_natives.h ${js2c_files}
DEPENDS ${js2c_files}) DEPENDS ${js2c_files})
set(node_extra_src "src/platform_${node_platform}.cc") set(node_extra_src "src/platform_${node_platform}.cc")

4
cmake/v8_build.cmake

@ -43,7 +43,7 @@ if(NOT SHARED_V8)
URL ${PROJECT_SOURCE_DIR}/deps/v8 URL ${PROJECT_SOURCE_DIR}/deps/v8
BUILD_IN_SOURCE True BUILD_IN_SOURCE True
BUILD_COMMAND sh -c "${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs}" BUILD_COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs}
SOURCE_DIR ${PROJECT_BINARY_DIR}/deps/v8 SOURCE_DIR ${PROJECT_BINARY_DIR}/deps/v8
# ignore this stuff, it's not needed for building v8 but ExternalProject # ignore this stuff, it's not needed for building v8 but ExternalProject
@ -74,7 +74,7 @@ if(NOT SHARED_V8)
add_custom_command( add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn} OUTPUT ${PROJECT_BINARY_DIR}/deps/v8/${v8_fn}
COMMAND ${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs} COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/tools/scons/scons.py library=static visibility=default ${v8snapshot} mode=${v8mode} verbose=on arch=${v8arch} -j ${parallel_jobs}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/deps/v8/ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/deps/v8/
DEPENDS ${v8_sources_dest} DEPENDS ${v8_sources_dest}
) )

Loading…
Cancel
Save