cmake_minimum_required(VERSION 2.8)

FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})

ADD_CUSTOM_COMMAND(SOURCE termbox.pyx
    OUTPUT termbox.c
    COMMAND ${PYREX}
    ARGS termbox.pyx)

ADD_LIBRARY(pytermbox SHARED termbox.c ${TERMBOX_LIB_SRC})
SET_TARGET_PROPERTIES(pytermbox PROPERTIES COMPILE_FLAGS -fPIC OUTPUT_NAME "termbox" PREFIX "")

cmake_minimum_required(VERSION 2.8)

FIND_PACKAGE(PythonLibs)
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})

ADD_CUSTOM_COMMAND(SOURCE termbox.pyx
    OUTPUT ${CMAKE_CURRENT_BUILD_DIR}/termbox.c
    COMMAND ${PYREX} -o ${CMAKE_CURRENT_BUILD_DIR}/termbox.c
    ARGS ${CMAKE_CURRENT_SOURCE_DIR}/termbox.pyx)

ADD_LIBRARY(pytermbox SHARED termbox.c ${TERMBOX_LIB_SRC})
SET_TARGET_PROPERTIES(pytermbox PROPERTIES COMPILE_FLAGS -fPIC OUTPUT_NAME "termbox" PREFIX "")

Fix python build when using cmake.
Fix python build when using cmake.
