1d6517755SJan KneschkePROJECT(sigar C)
2d6517755SJan Kneschkecmake_minimum_required(VERSION 2.6)
3d6517755SJan Kneschke
4ceb70952STrond NorbyeIF (${CMAKE_MAJOR_VERSION} GREATER 2)
5ceb70952STrond Norbye    CMAKE_POLICY(SET CMP0042 NEW)
6ceb70952STrond NorbyeENDIF (${CMAKE_MAJOR_VERSION} GREATER 2)
7ceb70952STrond Norbye
8d6517755SJan KneschkeINCLUDE(CheckIncludeFiles)
9d6517755SJan KneschkeINCLUDE(CheckFunctionExists)
10d6517755SJan KneschkeINCLUDE(CheckTypeSize)
11d6517755SJan KneschkeINCLUDE(CTest)
12d6517755SJan KneschkeINCLUDE(InstallRequiredSystemLibraries)
13d6517755SJan Kneschke
14d6517755SJan KneschkeENABLE_TESTING()
15d6517755SJan Kneschke
16bfecbe71STrond Norbye#SET(CPACK_PACKAGE_VERSION_MAJOR "1")
17bfecbe71STrond Norbye#SET(CPACK_PACKAGE_VERSION_MINOR "6")
18bfecbe71STrond Norbye#SET(CPACK_PACKAGE_VERSION_PATCH "2")
19bfecbe71STrond Norbye#SET(CPACK_PACKAGE_VENDOR "Hyperic")
20d6517755SJan Kneschke## SET(CPACK_*) before the INCLUDE(CPack)
21bfecbe71STrond Norbye#INCLUDE(CPack)
22d6517755SJan Kneschke
23829a4c03STrond NorbyeIF(WIN32)
24829a4c03STrond Norbye	## make sure we only use the smallest set of
25829a4c03STrond Norbye	## headers on win32. Otherwise we get clashes
26d6517755SJan Kneschke	## between winsock2.h and winsock.h
27d6517755SJan Kneschke	ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
28d6517755SJan Kneschke
29d6517755SJan Kneschke	# force the correct version for the redist manifest
30d6517755SJan Kneschke	ADD_DEFINITIONS(-D_BIND_TO_CURRENT_MFC_VERSION=1 -D_BIND_TO_CURRENT_CRT_VERSION=1)
31d6517755SJan Kneschke	# turn off security warnings for system calls
32d6517755SJan Kneschke	ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
33d6517755SJan KneschkeENDIF(WIN32)
34d6517755SJan Kneschke
3553a872f9STrond NorbyeIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
3653a872f9STrond Norbye   # CLang emits a warning for all asm blocks
3753a872f9STrond Norbye   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-language-extension-token")
3853a872f9STrond NorbyeENDIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
3953a872f9STrond Norbye
4053a872f9STrond Norbye
413b99ab91STrond NorbyeADD_SUBDIRECTORY(src)
423b99ab91STrond NorbyeADD_SUBDIRECTORY(tests)
433b99ab91STrond NorbyeADD_SUBDIRECTORY(include)
443b99ab91STrond NorbyeADD_SUBDIRECTORY(programs)
45