aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/plugins/CMakeLists.txt
blob: 9be985198cfb608eac441b46d0676a9ed069d681 (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
project(plugins)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOMOC ON)

find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Widgets)
find_package(Qt6 COMPONENTS UiPlugin)

set(ui_plugin_src
    customwidgets.cpp
    customwidget.cpp
)

qt_wrap_cpp(MOC_FILES ${ui_plugin_moc})

add_library(uiplugin STATIC ${ui_plugin_src} ${MOC_FILES})
if(CMAKE_HOST_UNIX AND NOT CYGWIN)
    add_definitions(-fPIC)
endif()
add_definitions(-DQT_STATICPLUGIN)

if(${QT_MAJOR_VERSION} GREATER_EQUAL 6)
    set_property(TARGET pyside2 PROPERTY CXX_STANDARD 17)
else()
    set_property(TARGET pyside2 PROPERTY CXX_STANDARD 11)
endif()

target_link_libraries(uiplugin
                      Qt::Core
                      Qt::Gui
                      Qt::UiPlugin
                      Qt::Widgets
                      Shiboken2::libshiboken)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
    set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_DEBUG_POSTFIX})
else()
    set(LIBRARY_OUTPUT_SUFFIX ${CMAKE_RELEASE_POSTFIX})
endif()