PROJECT(sigar C)
cmake_minimum_required(VERSION 2.6)

IF (${CMAKE_MAJOR_VERSION} GREATER 2)
    CMAKE_POLICY(SET CMP0042 NEW)
ENDIF (${CMAKE_MAJOR_VERSION} GREATER 2)

INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize)
INCLUDE(CTest)
INCLUDE(InstallRequiredSystemLibraries)

ENABLE_TESTING()

#SET(CPACK_PACKAGE_VERSION_MAJOR "1")
#SET(CPACK_PACKAGE_VERSION_MINOR "6")
#SET(CPACK_PACKAGE_VERSION_PATCH "2")
#SET(CPACK_PACKAGE_VENDOR "Hyperic")
## SET(CPACK_*) before the INCLUDE(CPack)
#INCLUDE(CPack)

IF(WIN32)
	## make sure we only use the smallest set of
	## headers on win32. Otherwise we get clashes
	## between winsock2.h and winsock.h
	ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)

	# force the correct version for the redist manifest
	ADD_DEFINITIONS(-D_BIND_TO_CURRENT_MFC_VERSION=1 -D_BIND_TO_CURRENT_CRT_VERSION=1)
	# turn off security warnings for system calls
	ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ENDIF(WIN32)

IF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
   # CLang emits a warning for all asm blocks
   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-language-extension-token")
ENDIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")


ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(programs)

PROJECT(sigar C)

INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize)
INCLUDE(CTest)
INCLUDE(InstallRequiredSystemLibraries)

ENABLE_TESTING()

IF(WIN32)
	## make sure we only use the smallest set of
	## headers on win32. Otherwise we get clashes
	## between winsock2.h and winsock.h
	ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)

	# force the correct version for the redist manifest
	ADD_DEFINITIONS(-D_BIND_TO_CURRENT_MFC_VERSION=1 -D_BIND_TO_CURRENT_CRT_VERSION=1)
	# turn off security warnings for system calls
	ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ENDIF(WIN32)

IF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
   # CLang emits a warning for all asm blocks
   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-language-extension-token")
ENDIF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")


ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(programs)

Upgrade cmake minimum version to TLMs
Upgrade cmake minimum version to TLMs

Let TLM dictate the CMake minimum version to use

Change-Id: I43c31e4231c7b38d1bca638f0faa810a857509d7
Reviewed-on: http://review.couchbase.org/c/sigar/+/155708
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Dave Rigby <a09264da4832c7ff1d3bf1608a19f4b870f93750@couchbase.com>
