File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
2+
3+ SET (CMAKE_BUILD_TYPE Debug CACHE STRING "Default Build Type" )
4+
5+ PROJECT (phpspy)
6+
7+ ADD_CUSTOM_TARGET (submodules
8+ COMMAND git submodule update --init --remote --recursive)
9+
10+ ADD_CUSTOM_TARGET (libtermbox
11+ COMMAND ${PROJECT_SOURCE_DIR} /vendor/termbox/waf configure --prefix =${PROJECT_BUILD_DIR}
12+ COMMAND ${PROJECT_SOURCE_DIR} /vendor/termbox/waf --targets=termbox_static
13+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} /vendor/termbox
14+ DEPENDS submodules)
15+
16+ INCLUDE_DIRECTORIES (.)
17+ INCLUDE_DIRECTORIES (vendor)
18+ INCLUDE_DIRECTORIES (vendor/termbox/src)
19+
20+ ADD_EXECUTABLE (phpspy phpspy.c pgrep.c top.c addr_objdump.c event_fout.c)
21+ ADD_DEPENDENCIES (phpspy libtermbox)
22+
23+ TARGET_LINK_LIBRARIES (phpspy pthread ${PROJECT_SOURCE_DIR} /vendor/termbox/build /src/libtermbox.a)
24+
25+ INSTALL (TARGETS phpspy
26+ RUNTIME DESTINATION bin)
27+
28+ INSTALL (FILES ${PROJECT_SOURCE_DIR} /phpspy.h
29+ DESTINATION include /phpspy)
30+
31+ SET_TARGET_PROPERTIES (phpspy PROPERTIES
32+ COMPILE_FLAGS "-std=c99 -Wall -Werror"
33+ )
34+
Original file line number Diff line number Diff line change @@ -38,6 +38,20 @@ All with no changes to your application and minimal overhead.
3838 $ make phpspy_dynamic # Dynamically link dependencies
3939 $ # or
4040 $ USE_ZEND=1 make ... # Use Zend structs instead of built-in structs (requires php-dev or php-devel)
41+
42+ ### CMake Build
43+
44+ The CMake will update submodules and create a build of phpspy statically linked to libtermbox:
45+
46+ $ mkdir build
47+ $ cd build
48+ $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
49+ $ make -j4 install
50+
51+ CMake Options:
52+
53+ * ` CMAKE_BUILD_TYPE ` may be ` Release ` or ` Debug `
54+ * ` CMAKE_INSTALL_PREFIX ` will set install prefix
4155
4256### Usage
4357 $ ./phpspy -h
You can’t perform that action at this time.
0 commit comments