diff options
author | Tom Hughes <tom.hughes@palm.com> | 2010-12-08 04:06:52 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-12-23 03:12:39 +0300 |
commit | e03fae1447b6c1f2bd34da9a6218d124704abdc6 (patch) | |
tree | 7fc58803f3ac5dd5273f9177a4b3fcca5a1c7fbf /cmake | |
parent | 1f7026e2a0b6033595ff4c8e6e8098f6267935a0 (diff) |
cmake: Fix OpenSSL detection and node crypto compilation.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/configure.cmake | 10 | ||||
-rw-r--r-- | cmake/libs.cmake | 2 | ||||
-rw-r--r-- | cmake/node_build.cmake | 20 |
3 files changed, 18 insertions, 14 deletions
diff --git a/cmake/configure.cmake b/cmake/configure.cmake index eef89c5fdcf..79b6369d590 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -80,13 +80,3 @@ file(GLOB js2c_files ${PROJECT_SOURCE_DIR}/lib/*.js) set(js2c_files ${PROJECT_SOURCE_DIR}/src/node.js ${js2c_files}) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/src) -set(PREFIX ${CMAKE_INSTALL_PREFIX}) -if(${CMAKE_BUILD_TYPE} MATCHES Debug) - set(CCFLAGS "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") -else() - set(CCFLAGS "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS}") -endif() -get_directory_property(compile_defs COMPILE_DEFINITIONS) -foreach(def ${compile_defs}) - set(CPPFLAGS "${CPPFLAGS} -D${def}") -endforeach() diff --git a/cmake/libs.cmake b/cmake/libs.cmake index 23175455296..aeeb01d8115 100644 --- a/cmake/libs.cmake +++ b/cmake/libs.cmake @@ -40,7 +40,7 @@ if(HAVE_UTIL_LIB) set(extra_libs ${extra_libs} util) endif() -if(${OPENSSL_FOUND} MATCHES True) +if(OPENSSL_FOUND) add_definitions(-DHAVE_OPENSSL=1) set(HAVE_OPENSSL True) set(node_extra_src ${node_extra_src} src/node_crypto.cc) diff --git a/cmake/node_build.cmake b/cmake/node_build.cmake index ec9010dd3f9..240bdc6f9cc 100644 --- a/cmake/node_build.cmake +++ b/cmake/node_build.cmake @@ -7,10 +7,12 @@ add_custom_command( COMMAND ${PYTHON_EXECUTABLE} tools/js2c.py ${PROJECT_BINARY_DIR}/src/node_natives.h ${js2c_files} DEPENDS ${js2c_files}) -set(node_extra_src "src/platform_${node_platform}.cc") +set(node_platform_src "src/platform_${node_platform}.cc") -if(NOT EXISTS ${CMAKE_SOURCE_DIR}/${node_extra_src}) - set(node_extra_src "src/platform_none.cc") +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/${node_platform_src}) + set(node_extra_src ${node_extra_src} "src/platform_none.cc") +else() + set(node_extra_src ${node_extra_src} ${node_platform_src}) endif() set(node_sources @@ -36,6 +38,18 @@ set(node_sources src/node_natives.h ${node_extra_src}) +# Set up PREFIX, CCFLAGS, and CPPFLAGS for node_config.h +set(PREFIX ${CMAKE_INSTALL_PREFIX}) +if(${CMAKE_BUILD_TYPE} MATCHES Debug) + set(CCFLAGS "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") +else() + set(CCFLAGS "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS}") +endif() +get_directory_property(compile_defs COMPILE_DEFINITIONS) +foreach(def ${compile_defs}) + set(CPPFLAGS "${CPPFLAGS} -D${def}") +endforeach() + configure_file(src/node_config.h.in ${PROJECT_BINARY_DIR}/src/node_config.h) configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/config.h) |