From c8fa7f5edd4a48bd87c9781a20a1227868372768 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 31 Oct 2015 18:34:04 +0100 Subject: fix typo --- qxt-mini/qxtglobalshortcut_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qxt-mini') diff --git a/qxt-mini/qxtglobalshortcut_x11.cpp b/qxt-mini/qxtglobalshortcut_x11.cpp index b13770a2..30b71ff1 100644 --- a/qxt-mini/qxtglobalshortcut_x11.cpp +++ b/qxt-mini/qxtglobalshortcut_x11.cpp @@ -1,4 +1,4 @@ -#ifndef __APPLE_ +#ifndef __APPLE__ #define QXT_BUILD #include "qxtglobalshortcut_p.h" /**************************************************************************** -- cgit v1.2.3 From f14becff3653fa71911303fb0898a5d5a9cdfe95 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 1 Nov 2015 08:19:00 +0100 Subject: qxt-mini: make own module --- CMakeLists.txt | 3 ++- gui/CMakeLists.txt | 12 ------------ qxt-mini/CMakeLists.txt | 12 ++++++++++++ qxt-mini/qxtglobalshortcut.cpp | 1 - qxt-mini/qxtglobalshortcut_mac.cpp | 1 - qxt-mini/qxtglobalshortcut_x11.cpp | 1 - 6 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 qxt-mini/CMakeLists.txt (limited to 'qxt-mini') diff --git a/CMakeLists.txt b/CMakeLists.txt index 26cc2518..16ee3be3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,9 @@ cmake_minimum_required(VERSION 2.8.11) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/) include(CMakeParseArguments) include(opentrack-policy) +include(opentrack-qt) include(opentrack-platform) include(opentrack-macros) -include(opentrack-qt) include(opentrack-version) include(opentrack-tarball) include(opentrack-install) @@ -23,6 +23,7 @@ file(GLOB opentrack-subprojects "pose-widget/${C}" "spline-widget/${C}" "macosx/${C}" + "qxt-mini/${C}" ) foreach(i ${opentrack-subprojects}) get_filename_component(i ${i} DIRECTORY) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 19e98571..f483f695 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -14,22 +14,10 @@ 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 NO-COMPAT) - if(NOT APPLE) - target_link_libraries(opentrack-qxt-mini X11) - endif() -endif() - if(NOT WIN32) set_target_properties(opentrack PROPERTIES SUFFIX ".bin") endif() target_link_libraries(opentrack opentrack-api opentrack-version opentrack-pose-widget opentrack-spline-widget) -if(APPLE) - SET_TARGET_PROPERTIES(opentrack-qxt-mini PROPERTIES LINK_FLAGS "-framework Carbon -framework CoreFoundation") -endif() if(UNIX OR APPLE) target_link_libraries(opentrack opentrack-qxt-mini) endif() diff --git a/qxt-mini/CMakeLists.txt b/qxt-mini/CMakeLists.txt new file mode 100644 index 00000000..2fe5993b --- /dev/null +++ b/qxt-mini/CMakeLists.txt @@ -0,0 +1,12 @@ +if(UNIX OR APPLE) + opentrack_boilerplate(opentrack-qxt-mini + NO-LINKER-SCRIPT NO-COMPAT + COMPILE "-DQXT_BUILD -DBUILD_QXT_GUI" + ) + if(NOT APPLE) + target_link_libraries(opentrack-qxt-mini X11) + else() + set_target_properties(opentrack-qxt-mini PROPERTIES LINK_FLAGS + "-framework Carbon -framework CoreFoundation") + endif() +endif() diff --git a/qxt-mini/qxtglobalshortcut.cpp b/qxt-mini/qxtglobalshortcut.cpp index 4b400a72..45576d37 100644 --- a/qxt-mini/qxtglobalshortcut.cpp +++ b/qxt-mini/qxtglobalshortcut.cpp @@ -1,4 +1,3 @@ -#define QXT_BUILD #include "qxtglobalshortcut.h" /**************************************************************************** ** Copyright (c) 2006 - 2011, the LibQxt project. diff --git a/qxt-mini/qxtglobalshortcut_mac.cpp b/qxt-mini/qxtglobalshortcut_mac.cpp index 34de694e..b19de377 100644 --- a/qxt-mini/qxtglobalshortcut_mac.cpp +++ b/qxt-mini/qxtglobalshortcut_mac.cpp @@ -1,5 +1,4 @@ #ifdef __APPLE__ -#define QXT_BUILD #include /**************************************************************************** ** Copyright (c) 2006 - 2011, the LibQxt project. diff --git a/qxt-mini/qxtglobalshortcut_x11.cpp b/qxt-mini/qxtglobalshortcut_x11.cpp index 30b71ff1..12279ac8 100644 --- a/qxt-mini/qxtglobalshortcut_x11.cpp +++ b/qxt-mini/qxtglobalshortcut_x11.cpp @@ -1,5 +1,4 @@ #ifndef __APPLE__ -#define QXT_BUILD #include "qxtglobalshortcut_p.h" /**************************************************************************** ** Copyright (c) 2006 - 2011, the LibQxt project. -- cgit v1.2.3 From cc16fd0121fe79ae1fd9539a606c19827f64bc23 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 1 Nov 2015 08:36:28 +0100 Subject: use newly-added preprocessor variable --- csv/csv.cpp | 1 - csv/csv.h | 9 ++++++++- opentrack-compat/shm.h | 9 ++++++++- pose-widget/glwidget.h | 9 ++++++++- qxt-mini/CMakeLists.txt | 5 +---- qxt-mini/qxtglobal.h | 6 ++++++ spline-widget/functionconfig.h | 9 ++++++++- spline-widget/qfunctionconfigurator.h | 4 ++-- 8 files changed, 41 insertions(+), 11 deletions(-) (limited to 'qxt-mini') diff --git a/csv/csv.cpp b/csv/csv.cpp index 2193ed80..26a36b70 100644 --- a/csv/csv.cpp +++ b/csv/csv.cpp @@ -8,7 +8,6 @@ * purpose with or without fee is hereby granted, provided that the above * * copyright notice and this permission notice appear in all copies. * */ -#define INSIDE_CSV #include "csv.h" #include #include diff --git a/csv/csv.h b/csv/csv.h index a896a076..7ae1ad5c 100644 --- a/csv/csv.h +++ b/csv/csv.h @@ -1,4 +1,5 @@ #pragma once +#include #include #include #include @@ -6,7 +7,13 @@ #include #include -class CSV +#ifdef BUILD_opentrack_csv +# define CSV_EXPORT Q_DECL_EXPORT +#else +# define CSV_EXPORT Q_DECL_IMPORT +#endif + +class CSV_EXPORT CSV { public: QString readLine(); diff --git a/opentrack-compat/shm.h b/opentrack-compat/shm.h index 17a0d843..7c8a66a9 100644 --- a/opentrack-compat/shm.h +++ b/opentrack-compat/shm.h @@ -18,8 +18,15 @@ #include #include #endif +#include -class PortableLockedShm { +#ifdef BUILD_opentrack_compat +# define COMPAT_EXPORT Q_DECL_EXPORT +#else +# define COMPAT_EXPORT Q_DECL_IMPORT +#endif + +class COMPAT_EXPORT PortableLockedShm { public: PortableLockedShm(const char *shmName, const char *mutexName, int mapSize); ~PortableLockedShm(); diff --git a/pose-widget/glwidget.h b/pose-widget/glwidget.h index 81517399..fca3502d 100644 --- a/pose-widget/glwidget.h +++ b/pose-widget/glwidget.h @@ -7,12 +7,19 @@ #pragma once +#include #include #include #include "opentrack/plugin-api.hpp" #include "opentrack/simple-mat.hpp" -class GLWidget : public QWidget +#ifdef BUILD_opentrack_pose_widget +# define POSE_WIDGET_EXPORT Q_DECL_EXPORT +#else +# define POSE_WIDGET_EXPORT Q_DECL_IMPORT +#endif + +class POSE_WIDGET_EXPORT GLWidget : public QWidget { public: using num = float; diff --git a/qxt-mini/CMakeLists.txt b/qxt-mini/CMakeLists.txt index 2fe5993b..5de29cd1 100644 --- a/qxt-mini/CMakeLists.txt +++ b/qxt-mini/CMakeLists.txt @@ -1,8 +1,5 @@ if(UNIX OR APPLE) - opentrack_boilerplate(opentrack-qxt-mini - NO-LINKER-SCRIPT NO-COMPAT - COMPILE "-DQXT_BUILD -DBUILD_QXT_GUI" - ) + opentrack_boilerplate(opentrack-qxt-mini NO-LINKER-SCRIPT NO-COMPAT) if(NOT APPLE) target_link_libraries(opentrack-qxt-mini X11) else() diff --git a/qxt-mini/qxtglobal.h b/qxt-mini/qxtglobal.h index 574482ae..64fd35dc 100644 --- a/qxt-mini/qxtglobal.h +++ b/qxt-mini/qxtglobal.h @@ -51,6 +51,12 @@ #define QXT_DLLEXPORT DO_NOT_USE_THIS_ANYMORE +#ifdef BUILD_opentrack_qxt_mini +# define QXT_BUILD +# define BUILD_QXT_GUI +# define BUILD_QXT +#endif + #ifdef QXT_BUILD # if defined(BUILD_QXT_CORE) # define QXT_CORE_EXPORT Q_DECL_EXPORT diff --git a/spline-widget/functionconfig.h b/spline-widget/functionconfig.h index 6d76d0de..3d2fc23c 100644 --- a/spline-widget/functionconfig.h +++ b/spline-widget/functionconfig.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include #include @@ -17,7 +18,13 @@ #include #include "opentrack-compat/qcopyable-mutex.hpp" -class Map { +#ifdef BUILD_opentrack_spline_widget +# define SPLINE_WIDGET_EXPORT Q_DECL_EXPORT +#else +# define SPLINE_WIDGET_EXPORT Q_DECL_IMPORT +#endif + +class SPLINE_WIDGET_EXPORT Map { private: static constexpr int value_count = 10000; diff --git a/spline-widget/qfunctionconfigurator.h b/spline-widget/qfunctionconfigurator.h index baea9e34..4a9cb5f1 100644 --- a/spline-widget/qfunctionconfigurator.h +++ b/spline-widget/qfunctionconfigurator.h @@ -12,10 +12,10 @@ #include #include #include -#include "spline-widget/functionconfig.h" +#include "functionconfig.h" #include "opentrack/plugin-api.hpp" -class QFunctionConfigurator : public QWidget +class SPLINE_WIDGET_EXPORT QFunctionConfigurator : public QWidget { Q_OBJECT Q_PROPERTY(QColor colorBezier READ colorBezier WRITE setColorBezier) -- cgit v1.2.3