annotate CMakeLists.txt @ 4:50215911acb3

Add a strsplit() function and stop to build probes into a separate library
author Louis Opter <louis@dotcloud.com>
date Sat, 01 Jan 2011 16:01:19 +0100
parents ba9d8601d5f9
children 8339ab15527d
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
50215911acb3 Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents: 2
diff changeset
35 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
36 )
50215911acb3 Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents: 2
diff changeset
37
0
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
38 SET(SRC
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
39 compat/strlcpy.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
40 compat/strlcat.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
41 close.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
42 container.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
43 open.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
44 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
45 ${PROBES_SRC}
0
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
46 )
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
47
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
48 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
49
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
50 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
51
1
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
52 # Install/Uninstall rules ######################################################
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
53
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
54 INSTALL(TARGETS lxcstats LIBRARY DESTINATION lib)
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
55
2
ba9d8601d5f9 Also install the header with the install rule
Louis Opter <louis@dotcloud.com>
parents: 1
diff changeset
56 INSTALL(FILES lxcstats.h DESTINATION include)
ba9d8601d5f9 Also install the header with the install rule
Louis Opter <louis@dotcloud.com>
parents: 1
diff changeset
57
1
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
58 CONFIGURE_FILE("${LIBLXCSTATS_SOURCE_DIR}/CMakeScripts/cmake_uninstall.cmake.in"
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
59 "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake"
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
60 IMMEDIATE @ONLY
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
61 )
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
62
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
63 ADD_CUSTOM_TARGET(uninstall
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
64 "${CMAKE_COMMAND}" -P "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake"
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
65 )
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
66
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
67 # Subdirectories ###############################################################
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
68
0
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
69 ADD_SUBDIRECTORY(tests)
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
70 ADD_SUBDIRECTORY(probes)