summaryrefslogtreecommitdiff
path: root/py/pykms/CMakeLists.txt
blob: a671b7a5fafe5625bd1ba4d12fc5e1d96d22306b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
include_directories(${LIBDRM_INCLUDE_DIRS})
link_directories(${LIBDRM_LIBRARY_DIRS})

pkg_check_modules(PYTHON python3 REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})

if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
endif()

include_directories(${PROJECT_SOURCE_DIR}/ext/pybind11/include)

set(SRCS pykms.cpp pykmsbase.cpp pykmsutil.cpp pyvid.cpp)

if(LIBDRM_OMAP_FOUND)
    set(SRCS ${SRCS} pykmsomap.cpp)
endif()

add_library(pykms SHARED ${SRCS})
target_link_libraries(pykms kms++ kms++util ${LIBDRM_LIBRARIES})

# Don't add a 'lib' prefix to the shared library
set_target_properties(pykms PROPERTIES PREFIX "")
set_target_properties(pykms PROPERTIES LIBRARY_OUTPUT_DIRECTORY "")

configure_file(__init__.py __init__.py COPYONLY)

set(PY_DESTDIR lib/python${PYTHON_VERSION}/site-packages/pykms)
install(FILES __init__.py DESTINATION ${PY_DESTDIR})
install(TARGETS pykms DESTINATION ${PY_DESTDIR})