2018-02-27 18:06:05 +01:00
cmake_minimum_required ( VERSION 2.8.11 )
2018-05-14 17:57:37 +02:00
set ( CMAKE_CXX_STANDARD 11 )
2018-02-27 18:06:05 +01:00
2018-11-27 19:14:35 +01:00
if ( UNIX AND NOT APPLE )
find_package ( X11 )
if ( X11_FOUND )
include_directories ( ${ X11_INCLUDE_DIR } )
endif ( X11_FOUND )
2018-11-27 19:27:09 +01:00
endif ( UNIX AND NOT APPLE )
2018-11-27 19:14:35 +01:00
2018-07-16 01:18:58 +02:00
include_directories ( ${ Qt5Gui_PRIVATE_INCLUDE_DIRS } )
if ( NOT WIN32 AND NOT APPLE )
find_path ( HAVE_QPA_QPLATFORMNATIVEINTERFACE_H qpa/qplatformnativeinterface.h PATHS ${ Qt5Gui_PRIVATE_INCLUDE_DIRS } )
if ( NOT HAVE_QPA_QPLATFORMNATIVEINTERFACE_H )
message ( FATAL_ERROR "Missing qpa/qplatformnativeinterface.h, check that you got the QT private headers installed (package libQt5Gui-private-headers-devel, qtbase5-private-dev or similar)" )
endif ( NOT HAVE_QPA_QPLATFORMNATIVEINTERFACE_H )
endif ( NOT WIN32 AND NOT APPLE )
2018-11-27 19:14:35 +01:00
set ( QXT-SOURCES qxtglobal.cpp qxtglobalshortcut.cpp )
set ( QXT-MOC-HEADERS qxtglobalshortcut.h )
2018-02-27 18:06:05 +01:00
2018-11-27 19:14:35 +01:00
if ( X11_FOUND )
set ( QXT-SOURCES ${ QXT-SOURCES } qxtglobalshortcut_x11.cpp )
2018-02-27 18:06:05 +01:00
elseif ( APPLE )
set ( QXT-SOURCES ${ QXT-SOURCES } qxtglobalshortcut_mac.cpp )
2018-11-27 19:14:35 +01:00
elseif ( WIN32 )
set ( QXT-SOURCES ${ QXT-SOURCES } qxtglobalshortcut_win.cpp )
endif ( )
2018-02-27 18:06:05 +01:00
QT5_WRAP_CPP ( QXT-SOURCES-MOC ${ QXT-MOC-HEADERS } )
ADD_LIBRARY ( qxt STATIC
$ { Q X T - S O U R C E S }
$ { Q X T - S O U R C E S - M O C }
)
2018-11-27 19:14:35 +01:00
target_link_libraries ( qxt Qt5::Core Qt5::Widgets )
if ( X11_FOUND )
target_link_libraries ( qxt Qt5::X11Extras )
endif ( X11_FOUND )