annotate CMakeLists.txt @ 1:3e30c3b2d6da

Add install/uninstall rules
author Louis Opter <louis@dotcloud.com>
date Thu, 30 Dec 2010 18:48:34 +0100
parents 6ce4443e7545
children ba9d8601d5f9
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
0
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
33 SET(SRC
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
34 compat/strlcpy.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
35 compat/strlcat.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
36 close.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
37 container.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
38 open.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
39 utils.c
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
40 )
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
41
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
42 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
43
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
44 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
45
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
46 TARGET_LINK_LIBRARIES(lxcstats probes)
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
47
1
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
48 # Install/Uninstall rules ######################################################
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
49
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
50 INSTALL(TARGETS lxcstats LIBRARY DESTINATION lib)
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
51
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
52 CONFIGURE_FILE("${LIBLXCSTATS_SOURCE_DIR}/CMakeScripts/cmake_uninstall.cmake.in"
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
53 "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake"
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
54 IMMEDIATE @ONLY
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
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
57 ADD_CUSTOM_TARGET(uninstall
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
58 "${CMAKE_COMMAND}" -P "${LIBLXCSTATS_BINARY_DIR}/cmake_uninstall.cmake"
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
59 )
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
60
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
61 # Subdirectories ###############################################################
3e30c3b2d6da Add install/uninstall rules
Louis Opter <louis@dotcloud.com>
parents: 0
diff changeset
62
0
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
63 ADD_SUBDIRECTORY(tests)
6ce4443e7545 Add the draft of an API to collect statistics on LXC
Louis Opter <kalessin@kalessin.fr>
parents:
diff changeset
64 ADD_SUBDIRECTORY(probes)