Home | History | Annotate | Download | only in pykms
      1 include_directories(${LIBDRM_INCLUDE_DIRS})
      2 link_directories(${LIBDRM_LIBRARY_DIRS})
      3 
      4 pkg_search_module(PYTHON REQUIRED ${KMSXX_PYTHON_VERSION})
      5 include_directories(${PYTHON_INCLUDE_DIRS})
      6 
      7 if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
      8     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
      9 endif()
     10 
     11 include_directories(${PROJECT_SOURCE_DIR}/ext/pybind11/include)
     12 
     13 set(SRCS pykms.cpp pykmsbase.cpp pykmsutil.cpp pyvid.cpp)
     14 
     15 if(LIBDRM_OMAP_FOUND)
     16     set(SRCS ${SRCS} pykmsomap.cpp)
     17 endif()
     18 
     19 add_library(pykms SHARED ${SRCS})
     20 target_link_libraries(pykms kms++ kms++util ${LIBDRM_LIBRARIES})
     21 
     22 # Don't add a 'lib' prefix to the shared library
     23 set_target_properties(pykms PROPERTIES PREFIX "")
     24 set_target_properties(pykms PROPERTIES LIBRARY_OUTPUT_DIRECTORY "")
     25 
     26 configure_file(__init__.py __init__.py COPYONLY)
     27 
     28 set(PY_DESTDIR lib/python${PYTHON_VERSION}/site-packages/pykms)
     29 install(FILES __init__.py DESTINATION ${PY_DESTDIR})
     30 install(TARGETS pykms DESTINATION ${PY_DESTDIR})
     31