cmake_minimum_required(VERSION 2.8.11)
cmake_policy(VERSION 2.8.11)

project(linux-wrappers-test)

#if (NOT WIN32)
	set(lw "${CMAKE_SOURCE_DIR}/linux-wrappers/")
	include_directories(${lw})
	message ("LINUX_WRAPPER is ${lw}")
#endif (NOT WIN32)

set(linux-wrappers-test_srcs
	${lw}/linux-wrappers-test.cpp
)

if (NOT WIN32)
	set(linux-wrappers-test_hdrs
		${lw}/linux-wrappers.h
	)
	set(linux-wrappers-test_srcs
		${linux-wrappers-test_srcs}
		${lw}/linux-wrappers.c
	)
endif (NOT WIN32)

add_executable(linux-wrappers-test ${linux-wrappers-test_hdrs} ${linux-wrappers-test_srcs})
if (NOT WIN32)
	target_link_libraries(linux-wrappers-test pthread)
else (NOT WIN32)
	target_link_libraries(linux-wrappers-test)
endif (NOT WIN32)

if (UNIX)
		ADD_CUSTOM_COMMAND(TARGET linux-wrappers-test
			COMMAND sudo setcap CAP_SYS_NICE=ep ${CMAKE_BINARY_DIR}/linux-wrappers/linux-wrappers-test
		)
endif()
