Mercurial > archived > louis > perso > liblxcstats
annotate CMakeLists.txt @ 12:dbf24a82f625 default tip
Fix doxygen comments and add a Doxyfile
author | Louis Opter <kalessin@kalessin.fr> |
---|---|
date | Fri, 07 Jan 2011 21:49:31 +0100 |
parents | 6f2e13f5fcfd |
children |
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 |
12
dbf24a82f625
Fix doxygen comments and add a Doxyfile
Louis Opter <kalessin@kalessin.fr>
parents:
9
diff
changeset
|
31 # Generate files ############################################################### |
dbf24a82f625
Fix doxygen comments and add a Doxyfile
Louis Opter <kalessin@kalessin.fr>
parents:
9
diff
changeset
|
32 |
dbf24a82f625
Fix doxygen comments and add a Doxyfile
Louis Opter <kalessin@kalessin.fr>
parents:
9
diff
changeset
|
33 CONFIGURE_FILE(Doxyfile.in "${CMAKE_BINARY_DIR}/Doxyfile") |
dbf24a82f625
Fix doxygen comments and add a Doxyfile
Louis Opter <kalessin@kalessin.fr>
parents:
9
diff
changeset
|
34 |
1 | 35 # Build rules ################################################################## |
36 | |
4
50215911acb3
Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents:
2
diff
changeset
|
37 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
|
38 probes/cpuacct.c |
9 | 39 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
|
40 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
|
41 ) |
50215911acb3
Add a strsplit() function and stop to build probes into a separate library
Louis Opter <louis@dotcloud.com>
parents:
2
diff
changeset
|
42 |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
43 SET(SRC |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
44 compat/strlcpy.c |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
45 compat/strlcat.c |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
46 close.c |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
47 container.c |
7
8339ab15527d
Add running/stopped containers global statistics and refactor some things
Louis Opter <louis@dotcloud.com>
parents:
4
diff
changeset
|
48 globals.c |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
49 open.c |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
50 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
|
51 ${PROBES_SRC} |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
52 ) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
53 |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
54 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
|
55 |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
56 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
|
57 |
1 | 58 # Install/Uninstall rules ###################################################### |
59 | |
60 INSTALL(TARGETS lxcstats LIBRARY DESTINATION lib) | |
61 | |
2
ba9d8601d5f9
Also install the header with the install rule
Louis Opter <louis@dotcloud.com>
parents:
1
diff
changeset
|
62 INSTALL(FILES lxcstats.h DESTINATION include) |
ba9d8601d5f9
Also install the header with the install rule
Louis Opter <louis@dotcloud.com>
parents:
1
diff
changeset
|
63 |
1 | 64 CONFIGURE_FILE("${LIBLXCSTATS_SOURCE_DIR}/CMakeScripts/cmake_uninstall.cmake.in" |
65 "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake" | |
66 IMMEDIATE @ONLY | |
67 ) | |
68 | |
69 ADD_CUSTOM_TARGET(uninstall | |
70 "${CMAKE_COMMAND}" -P "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake" | |
71 ) | |
72 | |
73 # Subdirectories ############################################################### | |
74 | |
0
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
75 ADD_SUBDIRECTORY(tests) |
6ce4443e7545
Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff
changeset
|
76 ADD_SUBDIRECTORY(probes) |