summaryrefslogtreecommitdiffstats
path: root/libpyside/CMakeLists.txt
blob: 284a38487e5831de08e3582e3bfff53ef166856b (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
project(libpyside)

set(libpyside_SRC
dynamicqmetaobject.cpp
signalmanager.cpp
globalreceiver.cpp
qsignal.cpp
qslot.cpp
qproperty.cpp
pyside.cpp
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}
                    ${SHIBOKEN_INCLUDE_DIR}
                    ${PYTHON_INCLUDE_PATH}
                    ${QT_QTCORE_INCLUDE_DIR})

add_library(pyside SHARED ${libpyside_SRC})
target_link_libraries(pyside
                      ${PYSIDE_PYTHON_LIBRARIES}
                      ${SHIBOKEN_LIBRARY}
                      ${QT_QTCORE_LIBRARY})

set_target_properties(pyside PROPERTIES
                      VERSION ${BINDING_API_VERSION}
                      SOVERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}"
                      DEFINE_SYMBOL PYSIDE_EXPORTS)

#
# install stuff
#

set(libpyside_HEADERS
    dynamicqmetaobject.h
    globalreceiver.h
    pysideconversions.h
    pysidemacros.h
    signalmanager.h
    pyside.h
    qsignal.h
    qproperty.h
)

# create pkg-config file
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pyside.pc.in"
               "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" @ONLY)
# create cmake-config files
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfigVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake" @ONLY)

install(FILES ${libpyside_HEADERS}
        DESTINATION include/${BINDING_NAME})
install(TARGETS pyside EXPORT pyside
                       LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
                       ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
                       RUNTIME DESTINATION bin)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake"
        DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake"
        DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")