1PROJECT(sigar C)
2cmake_minimum_required(VERSION 2.6)
3
4IF (${CMAKE_MAJOR_VERSION} GREATER 2)
5    CMAKE_POLICY(SET CMP0042 NEW)
6ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2)
7
8INCLUDE(CheckIncludeFiles)
9INCLUDE(CheckFunctionExists)
10INCLUDE(CheckTypeSize)
11INCLUDE(CTest)
12INCLUDE(InstallRequiredSystemLibraries)
13
14ENABLE_TESTING()
15
16#SET(CPACK_PACKAGE_VERSION_MAJOR "1")
17#SET(CPACK_PACKAGE_VERSION_MINOR "6")
18#SET(CPACK_PACKAGE_VERSION_PATCH "2")
19#SET(CPACK_PACKAGE_VENDOR "Hyperic")
20## SET(CPACK_*) before the INCLUDE(CPack)
21#INCLUDE(CPack)
22
23IF(WIN32)
24	## make sure we only use the smallest set of
25	## headers on win32. Otherwise we get clashes
26	## between winsock2.h and winsock.h
27	ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
28
29	# force the correct version for the redist manifest
30	ADD_DEFINITIONS(-D_BIND_TO_CURRENT_MFC_VERSION=1 -D_BIND_TO_CURRENT_CRT_VERSION=1)
31	# turn off security warnings for system calls
32	ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
33ENDIF(WIN32)
34
35IF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
36   # CLang emits a warning for all asm blocks
37   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-language-extension-token")
38ENDIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
39
40
41ADD_SUBDIRECTORY(src)
42ADD_SUBDIRECTORY(tests)
43ADD_SUBDIRECTORY(include)
44ADD_SUBDIRECTORY(programs)
45