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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
|
unset(_HDRS)
unset(_UIS)
unset(_SRCS)
unset(_RSCS)
unset(PLUGIN)
set( PLUGIN screenshotplugin )
project(${PLUGIN})
cmake_minimum_required(VERSION 3.1.0)
set( CMAKE_AUTOMOC TRUE )
IF( NOT WIN32 )
set( LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set( PLUGINS_PATH "lib${LIB_SUFFIX}/psi-plus/plugins" CACHE STRING "Install suffix for plugins" )
ELSE()
set( PLUGINS_PATH "psi-plus/plugins" CACHE STRING "Install suffix for plugins" )
ENDIF()
add_definitions( -DQT_PLUGIN -DHAVE_QT5 )
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
../../include
qxt/core
qxt/gui
.
)
if( UNIX AND NOT( APPLE OR CYGWIN ) )
find_package( X11 REQUIRED )
add_definitions( -DX11 )
set( qxt_X11_SRCS
qxt/gui/qxtwindowsystem_x11.cpp
)
set( qxt_X11_HDRS
qxt/gui/x11info.h
)
endif()
if( APPLE )
set( qxt_mac_SRCS
qxt/gui/qxtwindowsystem_mac.cpp
)
set( qxt_mac_HRDS
qxt/gui/qxtwindowsystem_mac.h
)
endif()
if( WIN32 )
add_definitions( -DQ_WS_WIN )
set( qxt_win_SRCS
qxt/gui/qxtwindowsystem_win.cpp
)
endif()
set ( _HDRS
screenshot.h
server.h
editserverdlg.h
screenshotoptions.h
toolbar.h
pixmapwidget.h
options.h
optionsdlg.h
optionswidget.h
screenshoticonset.h
controller.h
defines.h
proxysettingsdlg.h
qxt/core/qxtglobal.h
qxt/gui/qxtwindowsystem.h
${qxt_X11_HDRS}
${qxt_mac_HRDS}
)
set ( _SRCS
${PLUGIN}.cpp
screenshot.cpp
server.cpp
editserverdlg.cpp
screenshotoptions.cpp
toolbar.cpp
pixmapwidget.cpp
options.cpp
optionsdlg.cpp
optionswidget.cpp
screenshoticonset.cpp
controller.cpp
proxysettingsdlg.cpp
qxt/core/qxtglobal.cpp
qxt/gui/qxtwindowsystem.cpp
${qxt_X11_SRCS}
${qxt_mac_SRCS}
${qxt_win_SRCS}
)
set ( _UIS
optionswidget.ui
editserverdlg.ui
screenshot.ui
screenshotoptions.ui
optionsdlg.ui
proxysettingsdlg.ui
)
set ( _RSCS
${PLUGIN}.qrc
)
find_package( Qt5 COMPONENTS Widgets Xml Network PrintSupport REQUIRED )
set(QT_DEPLIBS
Qt5::Widgets
Qt5::Xml
Qt5::Network
Qt5::PrintSupport
)
if( UNIX AND NOT( APPLE OR CYGWIN ) )
find_package( Qt5 COMPONENTS X11Extras REQUIRED )
set(QT_DEPLIBS
${QT_DEPLIBS}
Qt5::X11Extras
)
endif()
qt5_wrap_ui(UIS ${_UIS})
qt5_add_resources(RSCS ${_RSCS})
add_library(
${PLUGIN}
MODULE
${_SRCS}
${UIS}
${RSCS}
)
if( UNIX AND NOT( APPLE OR CYGWIN ) )
target_link_libraries(
${PLUGIN}
${X11_LIBRARIES}
${QT_DEPLIBS}
)
install(
TARGETS
${PLUGIN}
LIBRARY
DESTINATION
${CMAKE_INSTALL_PREFIX}/${PLUGINS_PATH}
RUNTIME DESTINATION
${CMAKE_INSTALL_PREFIX}/${PLUGINS_PATH}
)
endif()
if( WIN32 )
target_link_libraries(
${PLUGIN}
${QT_DEPLIBS}
)
install(
TARGETS
${PLUGIN}
LIBRARY
DESTINATION
${CMAKE_INSTALL_PREFIX}/${PLUGINS_PATH}
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/${PLUGINS_PATH}
)
endif()
|