summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2023-01-25 13:41:09 +0900
committerMichele Calgaro <[email protected]>2023-01-25 13:41:09 +0900
commitb8225d27fca0564fda7f39b37d0e84b2654d2e49 (patch)
tree08b34df00db68a4bb60373f0fdf5c4f8ecaa0d36
parente274309d9293777aaaecebccaa29a339a05bd4f9 (diff)
downloadtdebluez-b8225d27fca0564fda7f39b37d0e84b2654d2e49.tar.gz
tdebluez-b8225d27fca0564fda7f39b37d0e84b2654d2e49.zip
Updated cmake related code to TDE standard.
Signed-off-by: Michele Calgaro <[email protected]>
-rw-r--r--CMakeLists.txt53
-rw-r--r--ConfigureChecks.cmake20
-rw-r--r--config.h.cmake8
-rw-r--r--debian/control2
-rw-r--r--debian/libtdebluez.install2
-rwxr-xr-xdebian/rules2
-rw-r--r--src/libtdebluez/adapterImpl.h4
-rw-r--r--src/libtdebluez/deviceImpl.h2
-rw-r--r--src/libtdebluez/devicemimeconverter.h2
-rw-r--r--src/libtdebluez/objectmanagerImpl.h2
-rw-r--r--src/libtdeobex/obexobjectmanagerImpl.h2
11 files changed, 61 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b8ac2c..83c8f5b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,28 +9,35 @@
#
#################################################
-cmake_minimum_required( VERSION 2.8 )
+cmake_minimum_required( VERSION 3.1 )
##### general package setup #####################
project( tdebluez )
set( PACKAGE tdebluez )
-set( VERSION R14.1.0 )
##### include essential cmake modules ###########
-include( FindPkgConfig )
-include( CheckIncludeFile )
-include( CheckTypeSize )
-include( CheckCSourceCompiles )
+include( FindPkgConfig )
+include( CheckFunctionExists )
+include( CheckSymbolExists )
+include( CheckIncludeFile )
+include( CheckLibraryExists )
+include( CheckCSourceCompiles )
include( CheckCXXSourceCompiles )
-include( CheckLibraryExists )
+
##### include our cmake modules #################
include( TDEMacros )
+
+##### set version number ########################
+
+tde_set_project_version( )
+
+
##### setup install paths #######################
include( TDESetupPaths )
tde_setup_paths( )
@@ -49,24 +56,34 @@ add_custom_target(install-apidox
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
##### optional stuff ############################
-option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
+
+option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
+option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
+
##### user requested modules ####################
-option( BUILD_ALL "Build all" ON )
-option( BUILD_LIBTDEBLUEZ "Build libtdebluez" ON )
+
+option( BUILD_ALL "Build all" OFF )
+option( BUILD_LIBTDEBLUEZ "Build libtdebluez" ${BUILD_ALL} )
option( BUILD_TDEIOSLAVE "Build tdeioslave" ${BUILD_ALL} )
option( BUILD_DOC "Build doc" ${BUILD_ALL} )
+
##### configure checks ##########################
-# if configure checks need be executed
+
include( ConfigureChecks.cmake )
+
+###### global compiler settings #################
+
+add_definitions( -DHAVE_CONFIG_H )
+
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
-#-Wl,--whole-archive
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
-##### activate dependencies #####################
+
+##### source directories ########################
add_subdirectory( src/tdebluez-common )
add_subdirectory( src/libtdebluez )
add_subdirectory( src/libtdeobex )
@@ -75,5 +92,11 @@ add_subdirectory( src/tdeioslave )
add_subdirectory( src/tdebluez )
add_subdirectory( src/tdebluezauth )
-tde_conditional_add_subdirectory( BUILD_DOC doc )
-tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
+##### other data ################################
+
+tde_conditional_add_project_docs( BUILD_DOC )
+
+
+##### write configure files #####################
+
+configure_file( config.h.cmake config.h @ONLY )
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 17b7d27..bc3c9ea 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -14,24 +14,14 @@ tde_setup_architecture_flags( )
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
-##### check for gcc visibility support #########
-# FIXME
-# This should check for [T]Qt3 visibility support
+tde_setup_largefiles( )
-if( WITH_GCC_VISIBILITY )
- if( NOT UNIX )
- tde_message_fatal(FATAL_ERROR "\ngcc visibility support was requested, but your system is not *NIX" )
- endif( NOT UNIX )
- set( __KDE_HAVE_GCC_VISIBILITY 1 )
- set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
- set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
-endif( )
+##### check for gcc visibility support
-###
-# some if then blocks come here
-# to handle submodules
-###
+if( WITH_GCC_VISIBILITY )
+ tde_setup_gcc_visibility( )
+endif( WITH_GCC_VISIBILITY )
# check for dbus-1
pkg_search_module( DBUS dbus-1 )
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000..61ede3a
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,8 @@
+#define VERSION "@VERSION@"
+
+// Defined if you have fvisibility and fvisibility-inlines-hidden support.
+#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
diff --git a/debian/control b/debian/control
index ef9da49..d8364d7 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: tde
Priority: optional
Maintainer: Debian TDE Team <[email protected]>
Uploaders: ...
-Build-Depends: cdbs, debhelper (>= 9~), quilt, cmake-trinity, ninja-build, tdelibs14-trinity-dev, libdbus-1-tqt-dev, libdbus-1-3 (>= 1.10.26)
+Build-Depends: cdbs, debhelper (>= 9~), quilt, tde-cmake, ninja-build, tdelibs14-trinity-dev, libdbus-1-tqt-dev, libdbus-1-3 (>= 1.10.26)
Standards-Version: 3.8.0
#Vcs-Svn: svn://svn.debian.org/pkg-kde/kde-extras/kdebluetooth/trunk/
#Vcs-Browser: http://svn.debian.org/wsvn/pkg-kde/kde-extras/kdebluetooth/trunk/
diff --git a/debian/libtdebluez.install b/debian/libtdebluez.install
index cba8c73..ef8dc81 100644
--- a/debian/libtdebluez.install
+++ b/debian/libtdebluez.install
@@ -2,4 +2,4 @@ opt/trinity/lib/libtdebluez.so.0
opt/trinity/lib/libtdebluez.so.0.0.1
opt/trinity/lib/libtdebluez.so
opt/trinity/lib/libtdebluez.la
-etc/trinity/dbus-1/system.d/org.trinitydesktop.tdebluez.conf /etc/dbus-1/system.d/
+/etc/dbus-1/system.d/org.trinitydesktop.tdebluez.conf
diff --git a/debian/rules b/debian/rules
index a6797f1..5a0da42 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,7 @@ DEB_CMAKE_EXTRA_FLAGS := \
-DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \
-DCMAKE_INSTALL_PREFIX="/opt/trinity" \
-DCONFIG_INSTALL_DIR="/etc/trinity" \
- -DSYSCONF_INSTALL_DIR="/etc/trinity" \
+ -DSYSCONF_INSTALL_DIR="/etc" \
-DXDG_MENU_INSTALL_DIR="/etc/xdg/menus" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_VERBOSE_MAKEFILE="ON" \
diff --git a/src/libtdebluez/adapterImpl.h b/src/libtdebluez/adapterImpl.h
index e192a17..8499ab3 100644
--- a/src/libtdebluez/adapterImpl.h
+++ b/src/libtdebluez/adapterImpl.h
@@ -26,6 +26,8 @@
#if !defined(ADAPTERIMPL_H_INCLUDED)
#define ADAPTERIMPL_H_INCLUDED
+#include "kdemacros.h"
+
#include "interfaces/adapter1Proxy.h"
using namespace org::bluez;
@@ -33,7 +35,7 @@ using namespace org::bluez;
namespace TDEBluetooth
{
-class AdapterImpl: public Adapter1Proxy
+class KDE_EXPORT AdapterImpl: public Adapter1Proxy
{
Q_OBJECT
diff --git a/src/libtdebluez/deviceImpl.h b/src/libtdebluez/deviceImpl.h
index 45b355b..ffc55e1 100644
--- a/src/libtdebluez/deviceImpl.h
+++ b/src/libtdebluez/deviceImpl.h
@@ -38,7 +38,7 @@
namespace TDEBluetooth
{
-class DeviceImpl: public org::bluez::Device1Proxy
+class KDE_EXPORT DeviceImpl: public org::bluez::Device1Proxy
{
Q_OBJECT
diff --git a/src/libtdebluez/devicemimeconverter.h b/src/libtdebluez/devicemimeconverter.h
index 63a1d9f..c35878f 100644
--- a/src/libtdebluez/devicemimeconverter.h
+++ b/src/libtdebluez/devicemimeconverter.h
@@ -34,7 +34,7 @@ namespace TDEBluetooth
/**
@author Fred Schaettgen
*/
-class DeviceMimeConverter
+class KDE_EXPORT DeviceMimeConverter
{
public:
static TQString classToMimeType(int deviceClass);
diff --git a/src/libtdebluez/objectmanagerImpl.h b/src/libtdebluez/objectmanagerImpl.h
index f8f9c2f..e5cf94b 100644
--- a/src/libtdebluez/objectmanagerImpl.h
+++ b/src/libtdebluez/objectmanagerImpl.h
@@ -48,7 +48,7 @@
namespace TDEBluetooth
{
-class ObjectManagerImpl : public org::freedesktop::DBus::ObjectManagerProxy
+class KDE_EXPORT ObjectManagerImpl : public org::freedesktop::DBus::ObjectManagerProxy
{
Q_OBJECT
diff --git a/src/libtdeobex/obexobjectmanagerImpl.h b/src/libtdeobex/obexobjectmanagerImpl.h
index 65ef978..db7f03c 100644
--- a/src/libtdeobex/obexobjectmanagerImpl.h
+++ b/src/libtdeobex/obexobjectmanagerImpl.h
@@ -41,7 +41,7 @@ namespace TDEObex
#define DBUS_CONN_NAME "TDEBluezObex"
-class ObexObjectManagerImpl: public org::freedesktop::DBus::ObjectManagerProxy
+class KDE_EXPORT ObexObjectManagerImpl: public org::freedesktop::DBus::ObjectManagerProxy
{
Q_OBJECT