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-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-02-27 18:06:05 +01:00
set ( QXT-SOURCES
q x t g l o b a l . c p p
q x t g l o b a l s h o r t c u t . c p p
)
set ( QXT-MOC-HEADERS
q x t g l o b a l s h o r t c u t . h
)
find_package ( X11 )
include_directories ( ${ X11_INCLUDE_DIR } )
if ( WIN32 )
set ( QXT-SOURCES ${ QXT-SOURCES } qxtglobalshortcut_win.cpp )
elseif ( APPLE )
set ( QXT-SOURCES ${ QXT-SOURCES } qxtglobalshortcut_mac.cpp )
else ( WIN32 )
set ( QXT-SOURCES ${ QXT-SOURCES } qxtglobalshortcut_x11.cpp )
endif ( WIN32 )
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 }
)
if ( WIN32 )
2018-05-12 20:30:16 +02:00
target_link_libraries ( qxt Qt5::Core Qt5::Widgets )
2018-02-27 18:06:05 +01:00
else ( WIN32 )
2018-05-12 20:30:16 +02:00
target_link_libraries ( qxt Qt5::Core Qt5::Widgets Qt5::X11Extras )
2018-02-27 18:06:05 +01:00
endif ( WIN32 )