summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-30 10:07:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-10-30 10:07:42 +0100
commit48c30a3d75d18e87e39c18cb52961bb37ab6055e (patch)
tree1d6f2faa511eed9f6dac6630673efa6564ea7027
parent8318ee4d821a4826b8e80369f499b3758abe8f4c (diff)
qxt: fix unix build
-rw-r--r--cmake/opentrack-macros.cmake4
-rw-r--r--gui/CMakeLists.txt33
-rw-r--r--qxt-mini/qxtglobal.h4
-rw-r--r--qxt-mini/qxtglobalshortcut.cpp1
-rw-r--r--qxt-mini/qxtglobalshortcut_mac.cpp (renamed from qxt-mini/plat/qxtglobalshortcut_mac.cpp)3
-rw-r--r--qxt-mini/qxtglobalshortcut_x11.cpp (renamed from qxt-mini/plat/qxtglobalshortcut_x11.cpp)5
6 files changed, 21 insertions, 29 deletions
diff --git a/cmake/opentrack-macros.cmake b/cmake/opentrack-macros.cmake
index a9fa5bc7..df19ddf0 100644
--- a/cmake/opentrack-macros.cmake
+++ b/cmake/opentrack-macros.cmake
@@ -32,7 +32,7 @@ endfunction()
macro(opentrack_library n dir)
cmake_parse_arguments(opentrack-foolib
- "NO-LIBRARY;STATIC;NO-COMPAT"
+ "NO-LIBRARY;STATIC;NO-COMPAT;NO-LINKER-SCRIPT"
"LINK;COMPILE;GNU-LINK;GNU-COMPILE"
""
${ARGN}
@@ -52,7 +52,7 @@ macro(opentrack_library n dir)
if(NOT opentrack-foolib_NO-COMPAT)
target_link_libraries(${n} opentrack-api ${MY_QT_LIBS} opentrack-compat)
endif()
- if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
+ if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE AND NOT NO-LINKER-SCRIPT)
SET_TARGET_PROPERTIES(${n} PROPERTIES
LINK_FLAGS "${opentrack-foolib_LINK} ${opentrack-foolib_GNU-LINK} -Wl,--as-needed -Wl,--version-script=\"${CMAKE_SOURCE_DIR}/opentrack-compat/${version-script}-version-script.txt\""
COMPILE_FLAGS "${opentrack-foolib_COMPILE} ${opentrack-foolib_GNU-COMPILE} -fvisibility=hidden -fvisibility-inlines-hidden"
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
index 51d0cea3..b2540a68 100644
--- a/gui/CMakeLists.txt
+++ b/gui/CMakeLists.txt
@@ -1,25 +1,5 @@
opentrack_boilerplate(opentrack NO-LIBRARY)
-if(UNIX OR APPLE)
- target_include_directories(opentrack "${CMAKE_SOURCE_DIR}/qxt-mini")
- if(APPLE)
- set(qxt-plat mac)
- else()
- set(qxt-plat x11)
- endif()
- file(GLOB qxt-mini-c
- ${CMAKE_SOURCE_DIR}/qxt-mini/*.h
- ${CMAKE_SOURCE_DIR}/qxt-mini/qxtglobalshortcut.cpp
- ${CMAKE_SOURCE_DIR}/qxt-mini/plat/qxtglobalshortcut_${qxt-plat}.cpp
- )
- opentrack_qt(qxt-mini)
- add_library(opentrack-qxt-mini STATIC ${qxt-mini-all})
- target_link_libraries(opentrack-qxt-mini ${MY_QT_LIBS})
- if(NOT APPLE)
- target_link_libraries(opentrack-qxt-mini X11)
- endif()
-endif()
-
if(WIN32)
SET(SDK_CONSOLE_DEBUG FALSE CACHE BOOL "Console window visible at runtime")
endif()
@@ -30,12 +10,19 @@ else()
set(opentrack-win32-executable "")
endif()
-if(UNIX OR APPLE)
- list(APPEND opentrack-c ${CMAKE_SOURCE_DIR}/qxt-mini/qxtglobalshortcut.h)
-endif()
opentrack_qt(opentrack)
add_executable(opentrack ${opentrack-win32-executable} ${opentrack-all})
opentrack_compat(opentrack)
+
+
+if(UNIX OR APPLE)
+ target_include_directories(opentrack PRIVATE "${CMAKE_SOURCE_DIR}/qxt-mini")
+ opentrack_library(opentrack-qxt-mini ${CMAKE_SOURCE_DIR}/qxt-mini NO-LINKER-SCRIPT STATIC)
+ if(NOT APPLE)
+ target_link_libraries(opentrack-qxt-mini X11)
+ endif()
+endif()
+
if(NOT WIN32)
set_target_properties(opentrack PROPERTIES SUFFIX ".bin")
endif()
diff --git a/qxt-mini/qxtglobal.h b/qxt-mini/qxtglobal.h
index fa592181..574482ae 100644
--- a/qxt-mini/qxtglobal.h
+++ b/qxt-mini/qxtglobal.h
@@ -51,9 +51,7 @@
#define QXT_DLLEXPORT DO_NOT_USE_THIS_ANYMORE
-#define QXT_STATIC
-
-#if !defined(QXT_STATIC) && !defined(QXT_DOXYGEN_RUN)
+#ifdef QXT_BUILD
# if defined(BUILD_QXT_CORE)
# define QXT_CORE_EXPORT Q_DECL_EXPORT
# else
diff --git a/qxt-mini/qxtglobalshortcut.cpp b/qxt-mini/qxtglobalshortcut.cpp
index 45576d37..4b400a72 100644
--- a/qxt-mini/qxtglobalshortcut.cpp
+++ b/qxt-mini/qxtglobalshortcut.cpp
@@ -1,3 +1,4 @@
+#define QXT_BUILD
#include "qxtglobalshortcut.h"
/****************************************************************************
** Copyright (c) 2006 - 2011, the LibQxt project.
diff --git a/qxt-mini/plat/qxtglobalshortcut_mac.cpp b/qxt-mini/qxtglobalshortcut_mac.cpp
index 1181b293..34de694e 100644
--- a/qxt-mini/plat/qxtglobalshortcut_mac.cpp
+++ b/qxt-mini/qxtglobalshortcut_mac.cpp
@@ -1,3 +1,5 @@
+#ifdef __APPLE__
+#define QXT_BUILD
#include <Carbon/Carbon.h>
/****************************************************************************
** Copyright (c) 2006 - 2011, the LibQxt project.
@@ -266,3 +268,4 @@ bool QxtGlobalShortcutPrivate::nativeEventFilter(const QByteArray & eventType,
{
return false;
}
+#endif
diff --git a/qxt-mini/plat/qxtglobalshortcut_x11.cpp b/qxt-mini/qxtglobalshortcut_x11.cpp
index f18f86db..b13770a2 100644
--- a/qxt-mini/plat/qxtglobalshortcut_x11.cpp
+++ b/qxt-mini/qxtglobalshortcut_x11.cpp
@@ -1,4 +1,6 @@
-#include "../qxtglobalshortcut_p.h"
+#ifndef __APPLE_
+#define QXT_BUILD
+#include "qxtglobalshortcut_p.h"
/****************************************************************************
** Copyright (c) 2006 - 2011, the LibQxt project.
** See the Qxt AUTHORS file for a list of authors and copyright holders.
@@ -233,3 +235,4 @@ bool QxtGlobalShortcutPrivate::unregisterShortcut(quint32 nativeKey, quint32 nat
QxtX11Data x11;
return x11.isValid() && x11.ungrabKey(nativeKey, nativeMods, x11.rootWindow());
}
+#endif