Mercurial > archived > louis > perso > liblxcstats
annotate CMakeLists.txt @ 9:6f2e13f5fcfd
Add the memory probe
author | Louis Opter <louis@dotcloud.com> |
---|---|
date | Sun, 02 Jan 2011 01:50:27 +0100 |
parents | 8339ab15527d |
children | dbf24a82f625 |
rev | line source |
---|---|
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
2 |
1 | 3 # Global definitions ########################################################### |
4 | |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
5 PROJECT(LIBLXCSTATS C) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
6 |
1 | 7 SET(CPACK_PACKAGE_VERSION_MAJOR "0") |
8 SET(CPACK_PACKAGE_VERSION_MINOR "0") | |
9 SET(CPACK_PACKAGE_VERSION_PATCH "1") | |
10 SET(LIBLXCSTATS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") | |
11 | |
12 MESSAGE(STATUS "CMake Version: ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}") | |
13 MESSAGE(STATUS "liblxcstats Version: ${LIBLXCSTATS_VERSION}") | |
14 MESSAGE(STATUS "Build Type: ${CMAKE_BUILD_TYPE}") | |
15 MESSAGE(STATUS "System: ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}") | |
16 MESSAGE(STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}") | |
17 MESSAGE(STATUS "Source Directory: ${LIBLXCSTATS_SOURCE_DIR}") | |
18 | |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
19 ENABLE_TESTING() |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
20 |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
21 IF (CMAKE_COMPILER_IS_GNUCC) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
22 ADD_DEFINITIONS("-pipe -Wextra -Wall -std=c99 -Wstrict-prototypes") |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
23 ENDIF (CMAKE_COMPILER_IS_GNUCC) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
24 |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
25 IF (CMAKE_SYSTEM_NAME MATCHES "Linux") |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
26 ADD_DEFINITIONS("-D_POSIX_C_SOURCE=200112L" "-D_XOPEN_SOURCE=500" "-D_FILE_OFFSET_BITS=64" "-D_BSD_SOURCE") |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
27 ELSE (CMAKE_SYSTEM_NAME MATCHES "Linux") |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
28 MESSAGE(SEND_ERROR "The liblxcstats is Linux specific.") |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
29 ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux") |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
30 |
1 | 31 # Build rules ################################################################## |
32 | |
4
50215911acb3
Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents:
2
diff
changeset
|
33 SET(PROBES_SRC |
50215911acb3
Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents:
2
diff
changeset
|
34 probes/cpuacct.c |
9 | 35 probes/memory.c |
4
50215911acb3
Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents:
2
diff
changeset
|
36 probes/probes.c |
50215911acb3
Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents:
2
diff
changeset
|
37 ) |
50215911acb3
Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents:
2
diff
changeset
|
38 |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
39 SET(SRC |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
40 compat/strlcpy.c |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
41 compat/strlcat.c |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
42 close.c |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
43 container.c |
7
8339ab15527d
Add running/stopped containers global statistics and refactor some things
Louis Opter <louis@dotcloud.com>
parents:
4
diff
changeset
|
44 globals.c |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
45 open.c |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
46 utils.c |
4
50215911acb3
Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents:
2
diff
changeset
|
47 ${PROBES_SRC} |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
48 ) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
49 |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
50 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
51 |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
52 ADD_LIBRARY(lxcstats SHARED ${SRC}) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
53 |
1 | 54 # Install/Uninstall rules ###################################################### |
55 | |
56 INSTALL(TARGETS lxcstats LIBRARY DESTINATION lib) | |
57 | |
2
ba9d8601d5f9
Also install the header with the install rule
Louis Opter <louis@dotcloud.com>
parents:
1
diff
changeset
|
58 INSTALL(FILES lxcstats.h DESTINATION include) |
ba9d8601d5f9
Also install the header with the install rule
Louis Opter <louis@dotcloud.com>
parents:
1
diff
changeset
|
59 |
1 | 60 CONFIGURE_FILE("${LIBLXCSTATS_SOURCE_DIR}/CMakeScripts/cmake_uninstall.cmake.in" |
61 "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake" | |
62 IMMEDIATE @ONLY | |
63 ) | |
64 | |
65 ADD_CUSTOM_TARGET(uninstall | |
66 "${CMAKE_COMMAND}" -P "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake" | |
67 ) | |
68 | |
69 # Subdirectories ############################################################### | |
70 | |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
71 ADD_SUBDIRECTORY(tests) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
72 ADD_SUBDIRECTORY(probes) |