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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
3 # Global definitions ###########################################################
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
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
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
7 SET(CPACK_PACKAGE_VERSION_MAJOR "0")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
8 SET(CPACK_PACKAGE_VERSION_MINOR "0")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
9 SET(CPACK_PACKAGE_VERSION_PATCH "1")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
10 SET(LIBLXCSTATS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
11
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
12 MESSAGE(STATUS "CMake Version: ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
13 MESSAGE(STATUS "liblxcstats Version: ${LIBLXCSTATS_VERSION}")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
14 MESSAGE(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
15 MESSAGE(STATUS "System: ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
16 MESSAGE(STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
17 MESSAGE(STATUS "Source Directory: ${LIBLXCSTATS_SOURCE_DIR}")
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
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
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
31 # Build rules ##################################################################
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
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
6f2e13f5fcfd Add the memory probe
Louis Opter <louis@dotcloud.com>
parents: 7
diff changeset
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
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
54 # Install/Uninstall rules ######################################################
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
55
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
56 INSTALL(TARGETS lxcstats LIBRARY DESTINATION lib)
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
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
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
60 CONFIGURE_FILE("${LIBLXCSTATS_SOURCE_DIR}/CMakeScripts/cmake_uninstall.cmake.in"
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
61 "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake"
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
62 IMMEDIATE @ONLY
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
63 )
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
64
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
65 ADD_CUSTOM_TARGET(uninstall
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
66 "${CMAKE_COMMAND}" -P "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake"
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
67 )
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
68
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
69 # Subdirectories ###############################################################
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
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)