Skip to content
This repository
Newer
Older
100644 94 lines (68 sloc) 2.281 kb
446beebd » thughes
2010-11-22 Add cmake build support.
1 cmake_minimum_required(VERSION 2.6)
2 project(node)
3
b46f10a1 » thughes
2010-11-24 cmake: Add coverage support.
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
446beebd » thughes
2010-11-22 Add cmake build support.
18 #
19 # options
20 #
21
1b6b090c » nikhilm
2010-11-23 Use CMake's standard way to find Python.
22 find_package(PythonInterp 2 REQUIRED)
23
446beebd » thughes
2010-11-22 Add cmake build support.
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")
28
29
30 # cmake policies to get rid of some warnings
ea29cb4e » DanielG
2010-11-18 cmake cleanup
31 cmake_policy(SET CMP0009 NEW) # GLOB_RECURSE should no follow symlinks
446beebd » thughes
2010-11-22 Add cmake build support.
32
33 # generic cmake configuration
34 include("cmake/configure.cmake")
35
36 # find and configure libs
37 include("cmake/libs.cmake")
38
39 # setup node build targets
40 include("cmake/node_build.cmake")
41
42 # setup v8 build targets
43 include("cmake/v8_build.cmake")
44
45 # docs
ea29cb4e » DanielG
2010-11-18 cmake cleanup
46 ## might want to move this to doc/CMakeLists.txt
446beebd » thughes
2010-11-22 Add cmake build support.
47 include("cmake/docs.cmake")
48
49 # tests
ea29cb4e » DanielG
2010-11-18 cmake cleanup
50 enable_testing()
14e6b07f » thughes
2010-11-23 cmake: Add cdash support.
51 include(CTest)
ea29cb4e » DanielG
2010-11-18 cmake cleanup
52 add_subdirectory("test/")
446beebd » thughes
2010-11-22 Add cmake build support.
53
54 # package
55 include("cmake/package.cmake")
56
57
58 #
59 # Final build configuration output
60 #
61
62 message("** Build Summary **")
63 message(" Version: ${node_version_string}")
64 message(" Prefix: ${PREFIX}")
65 message(" Build Type: ${CMAKE_BUILD_TYPE}")
66 message(" Architecture: ${CMAKE_SYSTEM_PROCESSOR}")
67
68 if(SHARED_V8)
69 message(" V8: ${V8_LIBRARY_PATH}")
70 #else()
71 #message(" V8 jobs: ${parallel_jobs}")
72 endif()
73
74 if(SHARED_libev)
75 message(" libev: ${LIBEV_LIBRARY}")
76 endif()
77
78 if(SHARED_CARES)
79 message(" libc-ares: ${LIBCARES_LIBRARY}")
80 endif()
81
82 message(" RT library: ${RT}")
83 message(" DL library: ${DL}")
84
85 if(${OPENSSL_FOUND} MATCHES TRUE)
ea29cb4e » DanielG
2010-11-18 cmake cleanup
86 message(" OpenSSL: ${OPENSSL_LIBRARIES}")
446beebd » thughes
2010-11-22 Add cmake build support.
87 endif()
88
b46f10a1 » thughes
2010-11-24 cmake: Add coverage support.
89 if(USE_GCOV)
90 message(" gcov: enabled")
91 endif()
92
93 message(" CCFLAGS: ${CCFLAGS}")
94 message(" CPPFLAGS: ${CPPFLAGS}")
Something went wrong with that request. Please try again.