cmake_minimum_required(VERSION 2.6)
PROJECT(rpcd-mod-lxc)
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations)

INCLUDE_DIRECTORIES(include)
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)

SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)

SET(SOURCES lxc.c)

ADD_LIBRARY(rpcd-mod-lxc SHARED ${SOURCES})

FIND_LIBRARY(lxc NAMES lxc liblxc)
TARGET_LINK_LIBRARIES(rpcd-mod-lxc ${lxc})

SET_TARGET_PROPERTIES(rpcd-mod-lxc PROPERTIES OUTPUT_NAME lxc PREFIX "")
INSTALL(TARGETS rpcd-mod-lxc LIBRARY DESTINATION lib)
