Commit graph

40 commits

Author SHA1 Message Date
Ralf Habacker
56171457fb Add new cmake configure option DBUS_USE_WINE
If this variable is set, ctest uses wine to run cross compiled
test applications. Otherwise, they are assumed to run on a native
Windows operating system.

The new cmake variables Z_DRIVE_IF_WINE and TEST_WRAPPER have been
added to support this function.
2018-12-06 09:18:27 +01:00
Ralf Habacker
0c0e7361ae Adds uac manifest to all executable test files to prevent the Windows 740 error when running
The case occurred during test-pending-call-dispatch. To avoid further
applications being affected in the future, the manifest is added to
all test applications.

Windows Error 740 is defined as 'The Requested Operation Requires Elevation'
2018-12-05 15:58:48 +01:00
Simon McVittie
cdcf3c04dd FindDocBookXSL.cmake: Add
Taken from
<https://github.com/KDE/kdoctools/blob/master/cmake/FindDocBookXSL.cmake>

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/237
2018-11-20 18:29:39 +00:00
Simon McVittie
4e3bfe0c97 cmake: Fold GObject detection into GLib detection
Everywhere that we want GLib, we also want GObject and GIO. Detecting
GLib and GIO but not GObject makes very little sense anyway, because
GIO depends on GObject.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105521
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2018-03-19 12:33:45 +00:00
Simon McVittie
83b439f7b4 cmake: Match AC_DEFINE more precisely, respecting [] quoting
The regular expression previously used here to select the second
comma-delimited argument won't work when we introduce an argument
containing a comma, which I need to do now. We can address this by
recognising Autoconf's quoting mechanism (which uses square
brackets).

This is not 100% right (it doesn't understand nested square brackets),
but it's good enough in practice.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Acked-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101354
2017-11-06 14:07:21 +00:00
Ralf Habacker
b59ff3d223 Fix cmake 3.5 configure error on opening a non existant file
Previous cmake versions seemed to be more tolerant.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-10-18 19:20:02 +02:00
Ralf Habacker
191da55a72 Use cmake build in timestamp function to generate the build time stamp
The recent implementation generates a timestamp containing eol on
linux hosts, which generates unparseable versioninfo.rc.

This commit raises the minimal required cmake version to 3.0.2.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103015
Reviewed-by: Simon McVittie <smcv@collabora.com>
2017-10-18 15:22:04 +02:00
Simon McVittie
6a6521746b unix: Condition Linux-specific abstract sockets on __linux__
This is nicer for cross-compiling, because AC_RUN_IFELSE can't work
there. In practice abstract sockets are supported on Linux since
2.2 (so, all relevant versions), and on no other platform; so it
seems futile to keep this complexity.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34905
Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2017-09-29 14:04:57 +01:00
Simon McVittie
cc1ee6c39d test/dbus-daemon: Exercise the Peer interface
We have to skip the GetMachineId() part during build-time testing
if it wouldn't work - there is no guarantee that dbus has ever been
installed on the build system. However, we can insist on it during
installed-tests, if we make sure to complete the installation for the
Travis-CI build by running dbus-uuidgen.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101257
2017-06-08 17:00:38 +01:00
Simon McVittie
36fcd43005 Pass in DBUS_TEST_EXEC via environment, not hard-coded into binaries
This avoids "capturing" the build directory in the built binaries
when built with embedded tests, which is good for reproducible builds.
See <https://reproducible-builds.org/> for more information.

Signed-off-by: Simon McVittie <smcv@debian.org>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100692
2017-04-18 17:20:30 +01:00
Ralf Habacker
6a8d0ae586 Replace deprecated cmake install_ functions with related install(...) calls.
Reviewed-by: Simon McVittie <smcv@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99586
2017-01-30 17:47:35 +01:00
Simon McVittie
7486899331 Revert "Keep cmake gcc builds in sync with autotools warnings."
When reviewing this commit, I said

    Looks OK, although this is going to become impossible if we start
    using the externally-curated list of warnings from
    <https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html>,
    which I've been quite tempted to do.

That time has now come. I think it's more valuable to have comprehensive
warnings under our primary build system, Autotools, than to have
some fairly elaborate CMake scripting to pick up the same compiler
warnings in both build systems; the CMake build system is primarily
there to give us the ability to compile with MSVC, which has orthogonal
compiler warning options anyway.

This reverts commit 41427560af.

Signed-off-by: Simon McVittie <smcv@debian.org>
Acked-by: Ralf Habacker <ralf.habacker@freenet.de>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
2016-10-13 17:20:40 +01:00
Simon McVittie
c7f3df0271 Replace $DBUS_USE_TEST_BINARY with $DBUS_TEST_DBUS_LAUNCH
Instead of using $DBUS_USE_TEST_BINARY to control whether to use the
hard-coded test binary TEST_BUS_LAUNCH_BINARY, we can just use
$DBUS_TEST_DBUS_LAUNCH to control what we launch directly, as we
were already doing for $DBUS_TEST_DAEMON.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=92899
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2016-02-12 15:26:23 +00:00
Ralf Habacker
41427560af Keep cmake gcc builds in sync with autotools warnings.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-02-11 23:26:50 +01:00
Ralf Habacker
15006d7d12 Refactored cmake part dealing with compiler warnings to use warnings identifier.
It is now possible to use msvc warnings identifiers
(e.g. '4114') or gcc warnings keys (e.g. 'pointer-sign').

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93069
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-02-11 23:26:50 +01:00
Ralf Habacker
93895bc3a5 Do not require binfmt support for running cross compiled test applications.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88966
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2016-02-08 23:16:23 +01:00
Simon McVittie
9c3034f125 cmake: run all automated tests with --tap for better diagnostics
For GLib-based tests it's useful, because it means g_test_message()
gets logged. For the embedded tests it's now accepted and ignored.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2015-12-02 00:53:00 +01:00
Ralf Habacker
d46f7bac0d cmake: @VAR@ substitutions in set() are deprecated, use string(CONFIGURE) instead (policy CMP0053)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89450
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-03-06 20:35:59 +01:00
Ralf Habacker
939b3d97ee Add check to cmake build system if config.h.cmake is in sync with autotools.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85418
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-03-05 13:54:10 +01:00
Ralf Habacker
4d8a27701b Add cmake macro autoheaderchecks().
This macro prints out any include file defined as HAVE_..._H in the config
header template and not in the related cmake configure checks file.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=85418
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-03-05 13:52:57 +01:00
Ralf Habacker
dca6591fa2 Keep cmake defines GLIB_VERSION_... in sync with autotools.
This patch adds autotools related cmake macros autoinit() and autodefine().

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89284
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-03-03 16:37:32 +01:00
Ralf Habacker
ea1884e3e5 Keep cmake generated shared dbus-1 library file name in sync with autotools.
Autotools uses a versioned shared library name derived from libtool.
This patch adds a versioned shared library name to cmake builds for all
supported platforms. Binary compatibility for clients build against older
cmake generated binary packages of dbus is provided; on unix like os
with symbolic links and on Windows with a copy of the shared library.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=74117
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-30 17:09:41 +01:00
Ralf Habacker
c39722e286 Give cmake users some hints/requirements when cross compiling for Windows on Linux.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-21 21:09:55 +01:00
Simon McVittie
7457a44011 tests: don't block and wait for a debugger on abort
In general, I think developers running the tests would expect
them to terminate rather than hanging. Developers who want to debug
such an abort by attaching a debugger to a live process can still set
DBUS_BLOCK_ON_ABORT in the environment.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
2014-01-10 01:36:16 +01:00
Ralf Habacker
8e728f36d1 Use macros for test and helper executable targets on cmake build system.
The new macros add_test_executables and add helper_executables provides a
platform independent way for specifing dbus test and service applications.

On native Windows and Linux/UNIX systems the test applications are
directly runable.

When cross compiling for Windows on Linux test applications could be
executed on the Linux host system with the help of wine and activated
binfmt_misc support for wine.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-10 01:24:56 +01:00
Ralf Habacker
e09eb12683 Add glib support to cmake buildsystem.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68506
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-07 19:06:26 +01:00
Ralf Habacker
b1579df4ce Generate autotools provided PACKAGE_.. and VERSION defines by a cmake macro.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67072
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-08-28 14:50:57 +02:00
Chengwei Yang
46602768c5 XML: hard depends on expat and delete libxml
[The libxml code path has been broken for at least 2.5 years, and Expat
is tiny, so there seems no point in supporting both. -smcv]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=20253
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-06 13:02:24 +01:00
Ralf Habacker
29a27c47e6 Fixed cmake cross compile timestamp creating.
We only need to distinct "Windows" from unix like systems

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59733
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-02-12 10:58:27 +00:00
Ralf Habacker
48fb808351 Uses cmake provided expat find package.
The cmake provided expat find package is more up to date.
There is no need to maintain an additional one.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59733
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-02-12 10:58:04 +00:00
Ralf Habacker
7aed4eb923 refactored cmake version extracting from configure.ac 2011-10-29 00:25:18 +02:00
Ralf Habacker
e41d163083 cmake fix: generate build timestamp
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41029
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-09-22 19:55:13 +02:00
Ralf Habacker
a96fc838b9 Removed unused cmake packages. 2010-03-22 17:28:57 +01:00
Frank Osterfeld
2feb3e2e65 add check for abstract sockets (cherry picked from commit 5b657984f4bc5544a8df560adcd224ed243972f1) 2009-11-30 10:54:32 +01:00
Ralf Habacker
2c1102c006 * cmake/modules/FindKDEWIN.cmake: fixed comment
* cmake/modules/FindKDEWIN32.cmake: removed obsolate cmake module
2007-07-19 20:16:09 +00:00
Ralf Habacker
071b707ab8 * cmake/modules/FindKDEWIN.cmake: search in <program files dir>\win32libs for windows supplementary packages too 2007-07-04 06:41:56 +00:00
Ralf Habacker
e26ed1576a * cmake/modules/FindKDEWIN.cmake, cmake/modules/FindKDEWIN_Packager.cmake cmake/modules/Win32Macros.cmake: new files from the kdewin32 project
* cmake/CMakeLists.txt: cleaned support for kdewin installer and win32 explorer wrapper
2007-06-14 07:56:47 +00:00
Ralf Habacker
ea58ec1cf9 * cmake/modules/FindExpat.cmake: fix package detection on win32.
* README.win: update install instructions.
2007-03-16 22:34:40 +00:00
Ralf Habacker
c01a63299e * cmake: added doxygen support 2007-03-14 00:16:05 +00:00
Ralf Habacker
36ebfd411b * cmake: new directory, contains cmake build support.
See http://www.cmake.org for more informations.
Currently only unix will be buildable because some
win32 required files are still missing.
2007-03-03 14:32:17 +00:00