split py files
[android/external-libkmsxx.git] / py / CMakeLists.txt
1 include_directories(${LIBDRM_INCLUDE_DIRS})
2 link_directories(${LIBDRM_LIBRARY_DIRS})
4 pkg_check_modules(PYTHON python3 REQUIRED)
5 include_directories(${PYTHON_INCLUDE_DIRS})
7 if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
8     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
9 endif()
11 include_directories(${PROJECT_SOURCE_DIR}/ext/pybind11/include)
13 add_library(pykms SHARED pykms.cpp pykmsbase.cpp pykmstest.cpp)
14 target_link_libraries(pykms kms++ kmstest ${LIBDRM_LIBRARIES})
16 # Don't add a 'lib' prefix to the shared library
17 set_target_properties(pykms PROPERTIES PREFIX "")
19 file(GLOB PY_SRCS "*.py")
20 add_custom_target(pyextras SOURCES ${PY_SRCS})
22 add_test(NAME pytest COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/functest.py")
23 set_property(TEST pytest PROPERTY
24         ENVIRONMENT "PYTHONPATH=." "LD_LIBRARY_PATH=."
25 )