Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 98 lines (72 sloc) 2.462 kB
446beeb @thughes Add cmake build support.
thughes authored
1 cmake_minimum_required(VERSION 2.6)
2 project(node)
3
b46f10a @thughes cmake: Add coverage support.
thughes authored
4 if(USE_GCOV)
5 set(CMAKE_BUILD_TYPE "Debug")
6
7 # Set global c and c++ flags
8 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
9 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
10
11 # Link flags used for creating executables
12 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov -fprofile-arcs")
13
14 # Link flags used for creating shared libraries
15 set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lgcov -profile-arcs")
16 endif()
17
446beeb @thughes Add cmake build support.
thughes authored
18 #
19 # options
20 #
21
1b6b090 @nikhilm Use CMake's standard way to find Python.
nikhilm authored
22 find_package(PythonInterp 2 REQUIRED)
23
446beeb @thughes Add cmake build support.
thughes authored
24 option(SHARED_V8 "use system shared V8 library")
25 option(SHARED_LIBEV "use system shared libev library")
26 option(SHARED_CARES "use system shared c-ares library")
27 option(V8_SNAPSHOT "turn on snapshot when building stock v8")
9d49c93 @thughes cmake: Add gdbjit and oprofile options.
thughes authored
28 option(V8_OPROFILE "Add oprofile support")
29 option(V8_GDBJIT "add gdbjit support")
3313ff1 @thughes cmake: dtrace support.
thughes authored
30 option(DTRACE "build with DTrace (experimental)")
446beeb @thughes Add cmake build support.
thughes authored
31
32 # cmake policies to get rid of some warnings
ea29cb4 @DanielG cmake cleanup
DanielG authored
33 cmake_policy(SET CMP0009 NEW) # GLOB_RECURSE should no follow symlinks
446beeb @thughes Add cmake build support.
thughes authored
34
35 # generic cmake configuration
36 include("cmake/configure.cmake")
37
38 # find and configure libs
39 include("cmake/libs.cmake")
40
41 # setup node build targets
42 include("cmake/node_build.cmake")
43
44 # setup v8 build targets
45 include("cmake/v8_build.cmake")
46
47 # docs
ea29cb4 @DanielG cmake cleanup
DanielG authored
48 ## might want to move this to doc/CMakeLists.txt
446beeb @thughes Add cmake build support.
thughes authored
49 include("cmake/docs.cmake")
50
51 # tests
ea29cb4 @DanielG cmake cleanup
DanielG authored
52 enable_testing()
14e6b07 @thughes cmake: Add cdash support.
thughes authored
53 include(CTest)
ea29cb4 @DanielG cmake cleanup
DanielG authored
54 add_subdirectory("test/")
446beeb @thughes Add cmake build support.
thughes authored
55
56 # package
57 include("cmake/package.cmake")
58
59
60 #
61 # Final build configuration output
62 #
63
64 message("** Build Summary **")
65 message(" Version: ${node_version_string}")
66 message(" Prefix: ${PREFIX}")
67 message(" Build Type: ${CMAKE_BUILD_TYPE}")
68 message(" Architecture: ${CMAKE_SYSTEM_PROCESSOR}")
71a8a3b @DanielG cmake fixes
DanielG authored
69 message(" Platform: ${node_platform}")
446beeb @thughes Add cmake build support.
thughes authored
70
71 if(SHARED_V8)
72 message(" V8: ${V8_LIBRARY_PATH}")
73 #else()
74 #message(" V8 jobs: ${parallel_jobs}")
75 endif()
76
77 if(SHARED_libev)
78 message(" libev: ${LIBEV_LIBRARY}")
79 endif()
80
81 if(SHARED_CARES)
82 message(" libc-ares: ${LIBCARES_LIBRARY}")
83 endif()
84
85 message(" RT library: ${RT}")
86 message(" DL library: ${DL}")
87
88 if(${OPENSSL_FOUND} MATCHES TRUE)
ea29cb4 @DanielG cmake cleanup
DanielG authored
89 message(" OpenSSL: ${OPENSSL_LIBRARIES}")
446beeb @thughes Add cmake build support.
thughes authored
90 endif()
91
b46f10a @thughes cmake: Add coverage support.
thughes authored
92 if(USE_GCOV)
93 message(" gcov: enabled")
94 endif()
95
96 message(" CCFLAGS: ${CCFLAGS}")
97 message(" CPPFLAGS: ${CPPFLAGS}")
Something went wrong with that request. Please try again.