aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-04-21 22:12:42 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-04-21 22:12:42 +0200
commitfcf633bdbc0b7d64fe1ea6005ab007f0db151c4e (patch)
tree359d2cc514826fb177cec39f6303d66649af56d4
parent34e808d3b9a322db3908454944c69c1373572f66 (diff)
parent3adf9ec33ba1e5b6516dfb31f943da67926e86c7 (diff)
downloadayatana-ido-fcf633bdbc0b7d64fe1ea6005ab007f0db151c4e.tar.gz
ayatana-ido-fcf633bdbc0b7d64fe1ea6005ab007f0db151c4e.tar.bz2
ayatana-ido-fcf633bdbc0b7d64fe1ea6005ab007f0db151c4e.zip
Merge branch 'tari01-pr/switch-to-cmake'
Attributes GH PR #26: https://github.com/AyatanaIndicators/ayatana-ido/pull/26
-rw-r--r--CMakeLists.txt59
-rw-r--r--INSTALL236
-rw-r--r--Makefile.am52
-rw-r--r--Makefile.am.coverage48
-rwxr-xr-xautogen.sh10
-rw-r--r--cmake/COPYING-CMAKE-SCRIPTS22
-rw-r--r--cmake/FindGObjectIntrospection.cmake61
-rw-r--r--cmake/FindVala.cmake57
-rw-r--r--configure.ac164
-rw-r--r--data/CMakeLists.txt4
-rw-r--r--data/libayatana-ido3-0.4.pc.in (renamed from libayatana-ido3.pc.in)10
-rw-r--r--debian/control7
-rwxr-xr-xdebian/rules16
-rw-r--r--example/CMakeLists.txt8
-rw-r--r--example/Makefile.am19
-rw-r--r--example/menus.c1
-rw-r--r--m4/gcov.m486
-rw-r--r--src/CMakeLists.txt176
-rw-r--r--src/Makefile.am196
-rw-r--r--src/ido.list1
-rw-r--r--src/idoalarmmenuitem.c4
-rw-r--r--src/idoappointmentmenuitem.c4
-rw-r--r--src/idobasicmenuitem.c4
-rw-r--r--src/idocalendarmenuitem.c1
-rw-r--r--src/idoentrymenuitem.c1
-rw-r--r--src/idolocationmenuitem.c4
-rw-r--r--src/idomediaplayermenuitem.c2
-rw-r--r--src/idoplaybackmenuitem.c2
-rw-r--r--src/idorange.c1
-rw-r--r--src/idoremovablemenuitem.c4
-rw-r--r--src/idoscalemenuitem.c3
-rw-r--r--src/idoswitchmenuitem.c2
-rw-r--r--src/idotimestampmenuitem.c16
-rw-r--r--src/idousermenuitem.c4
-rw-r--r--tests/CMakeLists.txt32
-rw-r--r--tests/Makefile.am50
36 files changed, 449 insertions, 918 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..b039352
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,59 @@
+cmake_minimum_required(VERSION 3.13)
+project(ayatana-ido C CXX)
+
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
+
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ SET(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE)
+endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+
+option(ENABLE_TESTS "Enable all tests and checks" OFF)
+option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF)
+
+if(ENABLE_COVERAGE)
+ set(ENABLE_TESTS ON)
+ set(CMAKE_BUILD_TYPE "Coverage")
+else()
+ set(CMAKE_BUILD_TYPE "Release")
+endif()
+
+# Check for prerequisites
+
+set(DEPS glib-2.0>=2.58 gtk+-3.0>=3.24)
+
+find_package (PkgConfig REQUIRED)
+pkg_check_modules(PROJECT_DEPS REQUIRED ${DEPS})
+
+# Set global variables
+
+include(GNUInstallDirs)
+set(PROJECT_VERSION "0.8.2")
+
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+
+ set(COMPILE_FLAGS "${COMPILE_FLAGS} -Weverything")
+ set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-c++98-compat -Wno-padded")
+ set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-documentation")
+
+else()
+
+ set(COMPILE_FLAGS "${COMPILE_FLAGS} -Wall")
+
+endif()
+
+# Make everything
+
+add_subdirectory(src)
+add_subdirectory(data)
+
+if (ENABLE_TESTS)
+ include(CTest)
+ enable_testing()
+ add_subdirectory(example)
+ add_subdirectory(tests)
+endif()
+
+# Display config info
+
+message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
+message(STATUS "Unit tests: ${ENABLE_TESTS}")
diff --git a/INSTALL b/INSTALL
deleted file mode 100644
index 23e5f25..0000000
--- a/INSTALL
+++ /dev/null
@@ -1,236 +0,0 @@
-Installation Instructions
-*************************
-
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
-Software Foundation, Inc.
-
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-
-These are generic installation instructions.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
- It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. (Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.)
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
- The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
-Compilers and Options
-=====================
-
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about. Run `./configure --help' for
-details on some of the pertinent environment variables.
-
- You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment. Here
-is an example:
-
- ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
-
- *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
-You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory. After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
-
-Installation Names
-==================
-
-By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc. You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
-PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
-`--build=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
- CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
- OS KERNEL-OS
-
- See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
- If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
-produce code for.
-
- If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
-Variables not defined in a site shell script can be set in the
-environment passed to `configure'. However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost. In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'. For example:
-
- ./configure CC=/usr/local2/bin/gcc
-
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script). Here is a another example:
-
- /bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
-
-`configure' Invocation
-======================
-
-`configure' recognizes the following options to control how it operates.
-
-`--help'
-`-h'
- Print a summary of the options to `configure', and exit.
-
-`--version'
-`-V'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`--cache-file=FILE'
- Enable the cache: use and save the results of the tests in FILE,
- traditionally `config.cache'. FILE defaults to `/dev/null' to
- disable caching.
-
-`--config-cache'
-`-C'
- Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`configure' also accepts some other, not widely useful, options. Run
-`configure --help' for more details.
-
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 427354e..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,52 +0,0 @@
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-NULL=
-
-V = @
-Q = $(V:1=)
-QUIET_GEN = $(Q:@=@echo ' GEN '$@;)
-
-SUBDIRS = src example tests
-
-%-0.4.pc: %.pc
- $(QUIET_GEN) cp -f $< $@
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libayatana-ido3-0.4.pc
-
-CLEANFILES = \
- libayatana-ido3-0.4.pc \
- $(NULL)
-
-DISTCLEANFILES = \
- libayatana-ido.pc \
- libayatana-ido3.pc \
- Makefile.in \
- aclocal.m4 \
- autom4te.cache/ \
- compile \
- config.guess \
- config.h.in \
- config.h.in~ \
- config.sub \
- configure \
- depcomp \
- gtk-doc.make \
- install-sh \
- ltmain.sh \
- m4/gtk-doc.m4 \
- m4/libtool.m4 \
- m4/ltoptions.m4 \
- m4/ltsugar.m4 \
- m4/ltversion.m4 \
- m4/lt~obsolete.m4 \
- missing \
- omf.make \
- test-driver \
- xmldocs.make \
- $(NULL)
-
-EXTRA_DIST = libayatana-ido3.pc.in
-
-DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc --disable-silent-rules
-
-include $(top_srcdir)/Makefile.am.coverage
diff --git a/Makefile.am.coverage b/Makefile.am.coverage
deleted file mode 100644
index fb97747..0000000
--- a/Makefile.am.coverage
+++ /dev/null
@@ -1,48 +0,0 @@
-
-# Coverage targets
-
-.PHONY: clean-gcno clean-gcda \
- coverage-html generate-coverage-html clean-coverage-html \
- coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
-
-clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
-
-if HAVE_GCOV
-
-clean-gcno:
- @echo Removing old coverage instrumentation
- -find -name '*.gcno' -print | xargs -r rm
-
-clean-gcda:
- @echo Removing old coverage results
- -find -name '*.gcda' -print | xargs -r rm
-
-coverage-html: clean-gcda
- -$(MAKE) $(AM_MAKEFLAGS) -k check
- $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
-
-generate-coverage-html:
- @echo Collecting coverage data
- $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
- LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
-
-clean-coverage-html: clean-gcda
- -$(LCOV) --directory $(top_builddir) -z
- -rm -rf coverage.info coveragereport
-
-if HAVE_GCOVR
-
-coverage-gcovr: clean-gcda
- -$(MAKE) $(AM_MAKEFLAGS) -k check
- $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr
-
-generate-coverage-gcovr:
- @echo Generating coverage GCOVR report
- $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
-
-clean-coverage-gcovr: clean-gcda
- -rm -rf $(top_builddir)/coverage.xml
-
-endif # HAVE_GCOVR
-
-endif # HAVE_GCOV
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 69a79c2..0000000
--- a/autogen.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-PKG_NAME="ayatana-ido"
-
-which mate-autogen || {
- echo "You need mate-common from https://git.mate-desktop.org/mate-common"
- exit 1
-}
-
-mate-autogen --enable-gtk-doc $@
diff --git a/cmake/COPYING-CMAKE-SCRIPTS b/cmake/COPYING-CMAKE-SCRIPTS
new file mode 100644
index 0000000..4b41776
--- /dev/null
+++ b/cmake/COPYING-CMAKE-SCRIPTS
@@ -0,0 +1,22 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/cmake/FindGObjectIntrospection.cmake b/cmake/FindGObjectIntrospection.cmake
new file mode 100644
index 0000000..2073c3c
--- /dev/null
+++ b/cmake/FindGObjectIntrospection.cmake
@@ -0,0 +1,61 @@
+# - try to find gobject-introspection
+#
+# Once done this will define
+#
+# INTROSPECTION_FOUND - system has gobject-introspection
+# INTROSPECTION_SCANNER - the gobject-introspection scanner, g-ir-scanner
+# INTROSPECTION_COMPILER - the gobject-introspection compiler, g-ir-compiler
+# INTROSPECTION_GENERATE - the gobject-introspection generate, g-ir-generate
+# INTROSPECTION_GIRDIR
+# INTROSPECTION_TYPELIBDIR
+# INTROSPECTION_CFLAGS
+# INTROSPECTION_LIBS
+#
+# Copyright (C) 2010, Pino Toscano, <pino@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname)
+ execute_process(
+ COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0
+ OUTPUT_VARIABLE _result
+ RESULT_VARIABLE _null
+ )
+
+ if (_null)
+ else()
+ string(REGEX REPLACE "[\r\n]" " " _result "${_result}")
+ string(REGEX REPLACE " +$" "" _result "${_result}")
+ separate_arguments(_result)
+ set(${_outvar} ${_result} CACHE INTERNAL "")
+ endif()
+endmacro(_GIR_GET_PKGCONFIG_VAR)
+
+find_package(PkgConfig)
+if(PKG_CONFIG_FOUND)
+ if(PACKAGE_FIND_VERSION_COUNT GREATER 0)
+ set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}")
+ endif()
+ pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp})
+ if(_pc_gir_FOUND)
+ set(INTROSPECTION_FOUND TRUE)
+ _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner")
+ _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler")
+ _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate")
+ _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir")
+ _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir")
+ set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}")
+ set(INTROSPECTION_LIBS "${_pc_gir_LIBS}")
+ endif()
+endif()
+
+mark_as_advanced(
+ INTROSPECTION_SCANNER
+ INTROSPECTION_COMPILER
+ INTROSPECTION_GENERATE
+ INTROSPECTION_GIRDIR
+ INTROSPECTION_TYPELIBDIR
+ INTROSPECTION_CFLAGS
+ INTROSPECTION_LIBS
+)
diff --git a/cmake/FindVala.cmake b/cmake/FindVala.cmake
new file mode 100644
index 0000000..a638735
--- /dev/null
+++ b/cmake/FindVala.cmake
@@ -0,0 +1,57 @@
+# - Find Vala
+# This module looks for valac.
+# This module defines the following values:
+# VALA_FOUND
+# VALA_COMPILER
+# VALA_VERSION
+# VAPI_GEN
+# VAPI_GEN_VERSION
+
+#=============================================================================
+# Copyright Přemysl Janouch 2011
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+# OF SUCH DAMAGE.
+#=============================================================================
+
+find_program (VALA_COMPILER "valac")
+
+if (VALA_COMPILER)
+ execute_process (COMMAND ${VALA_COMPILER} --version
+ OUTPUT_VARIABLE VALA_VERSION)
+ string (REGEX MATCH "[.0-9]+" VALA_VERSION "${VALA_VERSION}")
+endif (VALA_COMPILER)
+
+find_program (VAPI_GEN "vapigen")
+
+if (VAPI_GEN)
+ execute_process (COMMAND ${VAPI_GEN} --version
+ OUTPUT_VARIABLE VAPI_GEN_VERSION)
+ string (REGEX MATCH "[.0-9]+" VAPI_GEN_VERSION "${VAPI_GEN_VERSION}")
+endif (VAPI_GEN)
+
+include (FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (Vala
+ REQUIRED_VARS VALA_COMPILER
+ VERSION_VAR VALA_VERSION)
+
+mark_as_advanced (VALA_COMPILER VALA_VERSION VAPI_GEN)
+
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index c98062b..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,164 +0,0 @@
-#
-# shamelessly stolen from clutter-gtk
-#
-m4_define([ido_major_version], [0])
-m4_define([ido_minor_version], [8])
-m4_define([ido_micro_version], [2])
-
-m4_define([ido_api_version],
- [ido_major_version.ido_minor_version])
-m4_define([ido_version],
- [ido_major_version.ido_minor_version.ido_micro_version])
-
-m4_define([ido_interface_age], [0])
-m4_define([ido_binary_age],
- [m4_eval(100 * ido_minor_version + ido_micro_version)])
-
-AC_PREREQ([2.64])
-
-AC_INIT([ayatana-ido],
- [ido_version],
- [https://github.com/ArcticaProject/ayatana-ido/issues],
- [ayatana-ido],
- [https://github.com/ArcticaProject/ayatana-ido])
-
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_SRCDIR([src/libayatana-ido.h])
-AC_CONFIG_MACRO_DIR([m4])
-
-AM_INIT_AUTOMAKE([check-news 1.11 foreign])
-
-AM_SILENT_RULES([yes])
-
-IDO_MAJOR_VERSION=ido_major_version
-IDO_MINOR_VERSION=ido_minor_version
-IDO_MICRO_VERSION=ido_micro_version
-IDO_VERSION=ido_version
-AC_SUBST(IDO_MAJOR_VERSION)
-AC_SUBST(IDO_MINOR_VERSION)
-AC_SUBST(IDO_MICRO_VERSION)
-AC_SUBST(IDO_VERSION)
-
-m4_define([lt_current],
- [m4_eval(100 * ido_minor_version + ido_micro_version - ido_interface_age)])
-m4_define([lt_revision], [ido_interface_age])
-m4_define([lt_age], [m4_eval(ido_binary_age - ido_interface_age)])
-IDO_LT_CURRENT=lt_current
-IDO_LT_REV=lt_revision
-IDO_LT_AGE=lt_age
-IDO_LT_VERSION="$IDO_LT_CURRENT:$IDO_LT_REV:$IDO_LT_AGE"
-IDO_LT_LDFLAGS="-version-info $IDO_LT_VERSION"
-
-AC_SUBST(IDO_LT_VERSION)
-AC_SUBST(IDO_LT_LDFLAGS)
-
-dnl ===========================================================================
-
-# Checks for programs
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_PROG_CXX
-
-# Initialize libtool
-LT_PREREQ([2.2])
-LT_INIT([disable-static])
-
-AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
-PKG_PROG_PKG_CONFIG
-
-# Checks for header files
-AC_HEADER_STDC
-AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
-
-# Checks for typedefs, structures and compiler charecteristics
-AC_C_CONST
-
-# Checks for library functions
-AC_FUNC_MALLOC
-AC_FUNC_MMAP
-AC_CHECK_FUNCS([memset munmap strcasecmp strdup])
-AC_CHECK_LIBM
-
-GIO_REQUIRED_VERSION=2.37.0
-GTK_REQUIRED_VERSION=3.8.2
-
-PKG_CHECK_MODULES(GTK,[gtk+-3.0 >= $GTK_REQUIRED_VERSION
- gio-2.0 >= $GIO_REQUIRED_VERSION])
-
-AC_SUBST(GTK_CFLAGS)
-AC_SUBST(GTK_LIBS)
-
-dnl ===========================================================================
-
-if test "x$GCC" = "xyes"; then
- GCC_FLAGS="-g -Wall"
-fi
-AC_SUBST(GCC_FLAGS)
-
-# use strict compiler flags only on development releases
-m4_define([maintainer_flags_default], [m4_if(m4_eval(ido_minor_version % 2), [1], [yes], [no])])
-AC_ARG_ENABLE([maintainer-flags],
- [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes@:>@],
- [Use strict compiler flags @<:@default=no@:>@])],
- [],
- [enable_maintainer_flags=maintainer_flags_default])
-
-MAINTAINER_CFLAGS=""
-AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
- [
- MAINTAINER_CFLAGS="-Werror -Wall -Wshadow -Wcast-align -Wno-uninitialized -Wempty-body -Wformat-security -Winit-self"
- ]
-)
-
-AC_SUBST(MAINTAINER_CFLAGS)
-
-dnl = gcov Coverage Reporting =================================================
-
-m4_include([m4/gcov.m4])
-AC_TDD_GCOV
-AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
-AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
-AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
-AC_SUBST(COVERAGE_CFLAGS)
-AC_SUBST(COVERAGE_CXXFLAGS)
-AC_SUBST(COVERAGE_LDFLAGS)
-
-dnl = GObject Introspection ===================================================
-
-GOBJECT_INTROSPECTION_CHECK([0.6.7])
-
-dnl = Vala API Generation =====================================================
-
-AC_PATH_PROG([VALA_API_GEN], [vapigen])
-
-dnl = Google Test Framework ===================================================
-
-dnl xorg-gtest also provides gtest.
-# CHECK_XORG_GTEST
-
-dnl = GTK Doc Check ===========================================================
-
-GTK_DOC_CHECK([1.8])
-
-dnl ===========================================================================
-
-AC_CONFIG_FILES([
- Makefile
- src/Makefile
- example/Makefile
- tests/Makefile
- libayatana-ido3.pc
-])
-
-AC_OUTPUT
-
-echo ""
-echo " ido $VERSION"
-echo " ==============================="
-echo ""
-echo " Prefix : ${prefix}"
-echo " gcov : ${use_gcov}"
-echo " introspection: ${enable_introspection}"
-echo ""
-echo " Documentation: ${enable_gtk_doc}"
-echo ""
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
new file mode 100644
index 0000000..2f15bf6
--- /dev/null
+++ b/data/CMakeLists.txt
@@ -0,0 +1,4 @@
+# libayatana-ido3-0.4.pc
+
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libayatana-ido3-0.4.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.pc" @ONLY)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
diff --git a/libayatana-ido3.pc.in b/data/libayatana-ido3-0.4.pc.in
index 84af090..b1da305 100644
--- a/libayatana-ido3.pc.in
+++ b/data/libayatana-ido3-0.4.pc.in
@@ -1,11 +1,11 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: libayatana-ido3
Description: Ayatana Indicator Display Objects
-Version: @VERSION@
+Version: @PROJECT_VERSION@
Libs: -L${libdir} -layatana-ido3-0.4
Cflags: -I${includedir}/libayatana-ido3-0.4
Requires: gtk+-3.0
diff --git a/debian/control b/debian/control
index a10685f..78c5769 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,10 @@ Section: libs
Priority: optional
Maintainer: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Build-Depends: debhelper (>= 9),
- dh-autoreconf,
+ cmake (>= 3.16),
+ cmake-extras,
+ lcov,
+ gcovr,
dpkg-dev (>= 1.16.1.1),
gobject-introspection,
gtk-doc-tools,
@@ -15,6 +18,8 @@ Build-Depends: debhelper (>= 9),
libxi-dev,
mate-common,
valac (>= 0.16),
+ xauth,
+ xvfb,
Standards-Version: 4.5.1
Rules-Requires-Root: no
Homepage: https://github.com/AyatanaIndicator/ayatana-ido
diff --git a/debian/rules b/debian/rules
index b4a0a75..e2bd5ed 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,11 +6,18 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
+NULL :=
+
+DEB_CMAKE_EXTRA_FLAGS = \
+ -DENABLE_TESTS=ON \
+ -DENABLE_COVERAGE=OFF \
+ $(NULL)
+
%:
- dh $@ --with autoreconf
+ dh $@
-override_dh_autoreconf:
- NOCONFIGURE=1 dh_autoreconf ./autogen.sh
+override_dh_auto_configure:
+ dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS)
override_dh_install:
find debian/tmp/usr/lib -name *.la -delete
@@ -19,5 +26,8 @@ override_dh_install:
override_dh_missing:
dh_missing --fail-missing
+override_dh_auto_test:
+ xvfb-run -a dh_auto_test --no-parallel
+
get-orig-source:
uscan --noconf --force-download --rename --download-current-version --destdir=..
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
new file mode 100644
index 0000000..52f7bde
--- /dev/null
+++ b/example/CMakeLists.txt
@@ -0,0 +1,8 @@
+# menus
+
+set_source_files_properties(menus.c PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
+add_executable("menus" menus.c)
+target_include_directories("menus" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
+target_link_libraries("menus" ${PROJECT_DEPS_LIBRARIES} "-L${CMAKE_BINARY_DIR}/src" -layatana-ido3-0.4)
+target_include_directories("menus" PUBLIC "${CMAKE_SOURCE_DIR}/src")
+add_dependencies("menus" ayatana-ido3-0.4)
diff --git a/example/Makefile.am b/example/Makefile.am
deleted file mode 100644
index d52ac1c..0000000
--- a/example/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-VER=3
-
-noinst_PROGRAMS = \
- menus
-
-menus_SOURCES = \
- menus.c
-
-menus_CPPFLAGS = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/src \
- -I$(top_builddir)/src \
- $(GCC_FLAGS) \
- $(GTK_CFLAGS) \
- $(MAINTAINER_CFLAGS)
-
-menus_LDADD = $(top_builddir)/src/libayatana-ido$(VER)-0.4.la $(GTK_LIBS)
-
-DISTCLEANFILES = Makefile.in
diff --git a/example/menus.c b/example/menus.c
index ccfab69..1786697 100644
--- a/example/menus.c
+++ b/example/menus.c
@@ -7,7 +7,6 @@
#include "idoswitchmenuitem.h"
#include "idousermenuitem.h"
#include "idoremovablemenuitem.h"
-#include "config.h"
static void
slider_grabbed (GtkWidget *widget, gpointer user_data)
diff --git a/m4/gcov.m4 b/m4/gcov.m4
deleted file mode 100644
index bd96386..0000000
--- a/m4/gcov.m4
+++ /dev/null
@@ -1,86 +0,0 @@
-# Checks for existence of coverage tools:
-# * gcov
-# * lcov
-# * genhtml
-# * gcovr
-#
-# Sets ac_cv_check_gcov to yes if tooling is present
-# and reports the executables to the variables LCOV, GCOVR and GENHTML.
-AC_DEFUN([AC_TDD_GCOV],
-[
- AC_ARG_ENABLE(gcov,
- AS_HELP_STRING([--enable-gcov],
- [enable coverage testing with gcov]),
- [use_gcov=$enableval], [use_gcov=no])
-
- if test "x$use_gcov" = "xyes"; then
- # we need gcc:
- if test "$GCC" != "yes"; then
- AC_MSG_ERROR([GCC is required for --enable-gcov])
- fi
-
- # Check if ccache is being used
- AC_CHECK_PROG(SHTOOL, shtool, shtool)
- case `$SHTOOL path $CC` in
- *ccache*[)] gcc_ccache=yes;;
- *[)] gcc_ccache=no;;
- esac
-
- if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
- AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
- fi
-
- lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11"
- AC_CHECK_PROG(LCOV, lcov, lcov)
- AC_CHECK_PROG(GENHTML, genhtml, genhtml)
-
- if test "$LCOV"; then
- AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [
- glib_cv_lcov_version=invalid
- lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
- for lcov_check_version in $lcov_version_list; do
- if test "$lcov_version" = "$lcov_check_version"; then
- glib_cv_lcov_version="$lcov_check_version (ok)"
- fi
- done
- ])
- else
- lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
- AC_MSG_ERROR([$lcov_msg])
- fi
-
- case $glib_cv_lcov_version in
- ""|invalid[)]
- lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
- AC_MSG_ERROR([$lcov_msg])
- LCOV="exit 0;"
- ;;
- esac
-
- if test -z "$GENHTML"; then
- AC_MSG_ERROR([Could not find genhtml from the lcov package])
- fi
-
- ac_cv_check_gcov=yes
- ac_cv_check_lcov=yes
-
- # Remove all optimization flags from CFLAGS
- changequote({,})
- CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
- changequote([,])
-
- # Add the special gcc flags
- COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage"
- COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage"
- COVERAGE_LDFLAGS="-lgcov"
-
- # Check availability of gcovr
- AC_CHECK_PROG(GCOVR, gcovr, gcovr)
- if test -z "$GCOVR"; then
- ac_cv_check_gcovr=no
- else
- ac_cv_check_gcovr=yes
- fi
-
-fi
-]) # AC_TDD_GCOV
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..36132fe
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,176 @@
+# ayatanamenuitemfactory.h
+# idocalendarmenuitem.h
+# idoentrymenuitem.h
+# idorange.h
+# idoscalemenuitem.h
+# idoswitchmenuitem.h
+# idotimeline.h
+# libayatana-ido.h
+
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/ayatanamenuitemfactory.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idocalendarmenuitem.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idoentrymenuitem.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idorange.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idoscalemenuitem.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idoswitchmenuitem.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/idotimeline.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/libayatana-ido.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/libayatana-ido3-0.4/libayatana-ido")
+
+set(HEADERS
+ idorange.h
+ idoappointmentmenuitem.h
+ idousermenuitem.h
+ idoalarmmenuitem.h
+ idotimestampmenuitem.h
+ idoplaybackmenuitem.h
+ idoremovablemenuitem.h
+ ayatanamenuitemfactory.h
+ idobasicmenuitem.h
+ idoapplicationmenuitem.h
+ idotimeline.h
+ idosourcemenuitem.h
+ idoactionhelper.h
+ idocalendarmenuitem.h
+ idolocationmenuitem.h
+ idoprogressmenuitem.h
+ libayatana-ido.h
+ idomediaplayermenuitem.h
+ idoswitchmenuitem.h
+ idoscalemenuitem.h
+ idodetaillabel.h
+ idoentrymenuitem.h
+)
+
+set(SOURCES
+ idotimestampmenuitem.c
+ idodetaillabel.c
+ libayatana-ido.c
+ idomenuitemfactory.c
+ idoactionhelper.c
+ idoapplicationmenuitem.c
+ idoplaybackmenuitem.c
+ idomediaplayermenuitem.c
+ idocalendarmenuitem.c
+ ayatanamenuitemfactory.c
+ idoprogressmenuitem.c
+ idolocationmenuitem.c
+ idoscalemenuitem.c
+ idoentrymenuitem.c
+ idoalarmmenuitem.c
+ idorange.c
+ idoappointmentmenuitem.c
+ idoswitchmenuitem.c
+ idoremovablemenuitem.c
+ idobasicmenuitem.c
+ idousermenuitem.c
+ idosourcemenuitem.c
+ idotimeline.c
+ ${CMAKE_CURRENT_BINARY_DIR}/idotypebuiltins.c
+)
+
+# idotypebuiltins.h
+
+find_program(GLIB_MKENUMS glib-mkenums)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/idotypebuiltins.h"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${GLIB_MKENUMS}
+ --template idotypebuiltins.h.template ${HEADERS}
+ --output="${CMAKE_CURRENT_BINARY_DIR}/idotypebuiltins.h"
+)
+
+# idotypebuiltins.c
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/idotypebuiltins.c"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/idotypebuiltins.h"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${GLIB_MKENUMS}
+ --template idotypebuiltins.c.template ${HEADERS}
+ --output="${CMAKE_CURRENT_BINARY_DIR}/idotypebuiltins.c"
+)
+
+# ayatana-ido3-0.4.so
+
+set_source_files_properties(${SOURCES} PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
+add_library("ayatana-ido3-0.4" SHARED ${SOURCES})
+set_target_properties("ayatana-ido3-0.4" PROPERTIES VERSION 0.0.0 SOVERSION 0)
+target_include_directories("ayatana-ido3-0.4" PUBLIC ${PROJECT_DEPS_INCLUDE_DIRS})
+target_include_directories("ayatana-ido3-0.4" PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
+target_include_directories("ayatana-ido3-0.4" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+target_compile_definitions("ayatana-ido3-0.4" PUBLIC G_LOG_DOMAIN="IDO")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.so" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.so.0" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libayatana-ido3-0.4.so.0.0.0" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+
+# ayatana-ido3-0.4.gir
+
+set(HEADERS
+ idocalendarmenuitem.h
+ idoentrymenuitem.h
+ idorange.h
+ idoscalemenuitem.h
+ idoswitchmenuitem.h
+ idotimeline.h
+)
+
+find_package(GObjectIntrospection REQUIRED QUIET)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir"
+ DEPENDS "ayatana-ido3-0.4"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND
+ ${INTROSPECTION_SCANNER}
+ ${SOURCES} ${HEADERS}
+ --symbol-prefix=ido
+ --identifier-prefix=Ido
+ --namespace=AyatanaIdo3
+ --nsversion=0.4
+ --quiet
+ --pkg=gtk+-3.0
+ --warn-all
+ --include=Gtk-3.0
+ --library="ayatana-ido3-0.4"
+ --library-path=${CMAKE_CURRENT_BINARY_DIR}
+ --output "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir"
+)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/gir-1.0")
+
+# ayatana-ido3-0.4.typelib
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND
+ ${INTROSPECTION_COMPILER}
+ --includedir=${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.gir
+ -o "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib"
+)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/girepository-1.0")
+
+# ayatana-ido3-0.4.vapi
+
+find_package(Vala REQUIRED QUIET)
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.vapi"
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.typelib"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMAND
+ ${VAPI_GEN}
+ --library=AyatanaIdo3-0.4
+ --pkg gtk+-3.0
+ AyatanaIdo3-0.4.gir
+)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.vapi" DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/vala/vapi")
+
+add_custom_target("src" ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AyatanaIdo3-0.4.vapi")
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 268e2fd..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,196 +0,0 @@
-NULL =
-
-CLEANFILES =
-
-lib_LTLIBRARIES = libayatana-ido3-0.4.la
-
-ido_built_public_sources = \
- idotypebuiltins.h
-
-stamp_files = \
- idotypebuiltins.h \
- idotypebuiltins.c \
- $(NULL)
-
-sources_h = \
- ayatanamenuitemfactory.h \
- idoalarmmenuitem.h \
- idocalendarmenuitem.h \
- idoentrymenuitem.h \
- idorange.h \
- idoscalemenuitem.h \
- idoswitchmenuitem.h \
- idousermenuitem.h \
- idoappointmentmenuitem.h \
- idobasicmenuitem.h \
- idoremovablemenuitem.h \
- idoprogressmenuitem.h \
- idotimestampmenuitem.h \
- idolocationmenuitem.h \
- idotimeline.h \
- libayatana-ido.h \
- idoactionhelper.h \
- idomediaplayermenuitem.h \
- idoplaybackmenuitem.h \
- idoapplicationmenuitem.h \
- idodetaillabel.h \
- idosourcemenuitem.h \
- $(NULL)
-
-sources_c = \
- ayatanamenuitemfactory.c \
- libayatana-ido.c \
- idotypebuiltins.c \
- idocalendarmenuitem.c \
- idoalarmmenuitem.c \
- idoentrymenuitem.c \
- idorange.c \
- idoscalemenuitem.c \
- idoswitchmenuitem.c \
- idotimeline.c \
- idomenuitemfactory.c \
- idoactionhelper.c \
- idousermenuitem.c \
- idomediaplayermenuitem.c \
- idoplaybackmenuitem.c \
- idoappointmentmenuitem.c \
- idobasicmenuitem.c \
- idoremovablemenuitem.c \
- idoprogressmenuitem.c \
- idotimestampmenuitem.c \
- idolocationmenuitem.c \
- idoapplicationmenuitem.c \
- idodetaillabel.c \
- idosourcemenuitem.c \
- $(NULL)
-
-EXTRA_DIST = \
- ido.list \
- idotypebuiltins.h.template \
- idotypebuiltins.c.template \
- $(NULL)
-
-idotypebuiltins.h: stamp-idotypebuiltins.h
-
-stamp-idotypebuiltins.h: $(sources_h)
- ( cd $(srcdir) && $(GLIB_MKENUMS) --template idotypebuiltins.h.template \
- $(sources_h) ) >> xgen-gtbh \
- && (cmp -s xgen-gtbh idotypebuiltins.h || cp xgen-gtbh idotypebuiltins.h ) \
- && rm -f xgen-gtbh && echo timestamp > $(@F) \
- $(NULL)
-
-idotypebuiltins.c: stamp-idotypebuiltins.h
- ( cd $(srcdir) && $(GLIB_MKENUMS) --template idotypebuiltins.c.template \
- $(sources_h) ) > xgen-gtbc \
- && cp xgen-gtbc idotypebuiltins.c && rm -f xgen-gtbc
-
-AM_CPPFLAGS = \
- -I$(srcdir) \
- -I$(top_srcdir) \
- -DG_LOG_DOMAIN=\"IDO\" \
- -DPREFIX=\"$(prefix)"\" \
- -DLIBDIR=\"$(libdir)"\" \
- -DG_DISABLE_DEPRECATED \
- -DGDK_PIXBUF_DISABLE_DEPRECATED \
- -DGDK_DISABLE_DEPRECATED \
- $(GCC_FLAGS) \
- $(GTK_CFLAGS) \
- $(MAINTAINER_CFLAGS) \
- -Wall -Wextra -Wno-unused-parameter -Wno-error=deprecated-declarations \
- $(NULL)
-
-AM_CFLAGS = \
- $(COVERAGE_CFLAGS) \
- $(NULL)
-
-libayatana_ido_0_4_la_SOURCES = \
- $(sources_h) \
- $(sources_c) \
- $(NULL)
-
-libayatana_ido3_0_4_la_SOURCES = $(libayatana_ido_0_4_la_SOURCES)
-
-libayatana_idoincludedir=$(includedir)/libayatana-ido3-0.4/libayatana-ido
-
-libayatana_idoinclude_HEADERS = \
- ayatanamenuitemfactory.h \
- idocalendarmenuitem.h \
- idoentrymenuitem.h \
- idorange.h \
- idoscalemenuitem.h \
- idoswitchmenuitem.h \
- idotimeline.h \
- libayatana-ido.h \
- $(NULL)
-
-libayatana_ido_0_4_la_LIBADD = $(GTK_LIBS) $(LIBM)
-libayatana_ido_0_4_la_LDFLAGS = \
- $(GTK_LT_LDFLAGS) \
- $(COVERAGE_LDFLAGS) \
- -no-undefined \
- -export-symbols-regex "^[^_].*" \
- $(NULL)
-
-libayatana_ido3_0_4_la_LIBADD = $(libayatana_ido_0_4_la_LIBADD)
-libayatana_ido3_0_4_la_LDFLAGS = $(libayatana_ido_0_4_la_LDFLAGS)
-
-DISTCLEANFILES = \
- Makefile.in \
- stamp-idotypebuiltins.h \
- idotypebuiltins.h \
- idotypebuiltins.c \
- $(NULL)
-
--include $(INTROSPECTION_MAKEFILE)
-INTROSPECTION_GIRS =
-INTROSPECTION_SCANNER_ARGS = \
- --symbol-prefix=ido \
- --warn-all \
- --identifier-prefix=Ido \
- $(NULL)
-
-if HAVE_INTROSPECTION
-
-AyatanaIdo3-0.4.gir: libayatana-ido3-0.4.la
-AyatanaIdo3_0_4_gir_INCLUDES = Gtk-3.0
-AyatanaIdo3_0_4_gir_CFLAGS =
-AyatanaIdo3_0_4_gir_LIBS = libayatana-ido3-0.4.la
-AyatanaIdo3_0_4_gir_FILES = \
- idocalendarmenuitem.h \
- idoentrymenuitem.h \
- idorange.h \
- idoscalemenuitem.h \
- idoswitchmenuitem.h \
- idotimeline.h \
- $(sources_c) \
- $(NULL)
-
-AyatanaIdo3_0_4_gir_NAMESPACE = AyatanaIdo3
-AyatanaIdo3_0_4_gir_VERSION = 0.4
-AyatanaIdo3_0_4_gir_SCANNER_FLAGS = $(INTROSPECTION_SCANNER_ARGS)
-
-INTROSPECTION_GIRS += AyatanaIdo3-0.4.gir
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = $(INTROSPECTION_GIRS)
-
-typelibdir = $(libdir)/girepository-1.0
-typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
-
-CLEANFILES += $(gir_DATA) $(typelib_DATA)
-
-endif
-
-if HAVE_INTROSPECTION
-
-vapidir = $(datadir)/vala/vapi
-vapi_DATA = AyatanaIdo3-0.4.vapi
-
-AyatanaIdo3-0.4.vapi: AyatanaIdo3-0.4.gir
- $(VALA_API_GEN) --library=AyatanaIdo3-0.4 \
- --pkg gtk+-3.0 \
- $<
-
-CLEANFILES += $(vapi_DATA)
-
-endif
diff --git a/src/ido.list b/src/ido.list
deleted file mode 100644
index cd4f64d..0000000
--- a/src/ido.list
+++ /dev/null
@@ -1 +0,0 @@
-VOID:POINTER,UINT
diff --git a/src/idoalarmmenuitem.c b/src/idoalarmmenuitem.c
index 25c3f33..7b70e6d 100644
--- a/src/idoalarmmenuitem.c
+++ b/src/idoalarmmenuitem.c
@@ -18,10 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <gtk/gtk.h>
#include "idoactionhelper.h"
diff --git a/src/idoappointmentmenuitem.c b/src/idoappointmentmenuitem.c
index 9dc26a1..5659644 100644
--- a/src/idoappointmentmenuitem.c
+++ b/src/idoappointmentmenuitem.c
@@ -18,10 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <gtk/gtk.h>
#include "idoactionhelper.h"
diff --git a/src/idobasicmenuitem.c b/src/idobasicmenuitem.c
index 8e8c41e..080151c 100644
--- a/src/idobasicmenuitem.c
+++ b/src/idobasicmenuitem.c
@@ -17,10 +17,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <gtk/gtk.h>
#include "idoactionhelper.h"
diff --git a/src/idocalendarmenuitem.c b/src/idocalendarmenuitem.c
index 938dc14..1797648 100644
--- a/src/idocalendarmenuitem.c
+++ b/src/idocalendarmenuitem.c
@@ -26,7 +26,6 @@
#include <gdk/gdkkeysyms.h>
#include "idoactionhelper.h"
#include "idocalendarmenuitem.h"
-#include "config.h"
static void ido_calendar_menu_item_finalize (GObject *item);
static void ido_calendar_menu_item_select (GtkMenuItem *item);
diff --git a/src/idoentrymenuitem.c b/src/idoentrymenuitem.c
index d2948df..3fb2186 100644
--- a/src/idoentrymenuitem.c
+++ b/src/idoentrymenuitem.c
@@ -25,7 +25,6 @@
#include <gdk/gdkkeysyms.h>
#include "idoentrymenuitem.h"
-#include "config.h"
static void ido_entry_menu_item_finalize (GObject *item);
static void ido_entry_menu_item_select (GtkMenuItem *item);
diff --git a/src/idolocationmenuitem.c b/src/idolocationmenuitem.c
index 983126b..8b16807 100644
--- a/src/idolocationmenuitem.c
+++ b/src/idolocationmenuitem.c
@@ -17,10 +17,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <string.h> /* strstr() */
#include <gtk/gtk.h>
diff --git a/src/idomediaplayermenuitem.c b/src/idomediaplayermenuitem.c
index ef1b2aa..801d57b 100644
--- a/src/idomediaplayermenuitem.c
+++ b/src/idomediaplayermenuitem.c
@@ -19,8 +19,6 @@
* Lars Uebernickel <lars.uebernickel@canonical.com>
*/
-#include "config.h"
-
#include "idomediaplayermenuitem.h"
#include "idoactionhelper.h"
diff --git a/src/idoplaybackmenuitem.c b/src/idoplaybackmenuitem.c
index 4c90442..7f19718 100644
--- a/src/idoplaybackmenuitem.c
+++ b/src/idoplaybackmenuitem.c
@@ -20,8 +20,6 @@
* Lars Uebernickel <lars.uebernickel@canonical.com>
*/
-#include "config.h"
-
#include "idoplaybackmenuitem.h"
#include <gdk/gdkkeysyms.h>
diff --git a/src/idorange.c b/src/idorange.c
index 634b223..0e0d472 100644
--- a/src/idorange.c
+++ b/src/idorange.c
@@ -25,7 +25,6 @@
#include "idorange.h"
#include "idotypebuiltins.h"
-#include "config.h"
typedef struct {
IdoRangeStyle style;
diff --git a/src/idoremovablemenuitem.c b/src/idoremovablemenuitem.c
index 685e136..88d20ad 100644
--- a/src/idoremovablemenuitem.c
+++ b/src/idoremovablemenuitem.c
@@ -17,10 +17,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <gtk/gtk.h>
#include "idoactionhelper.h"
diff --git a/src/idoscalemenuitem.c b/src/idoscalemenuitem.c
index 17bf44b..7baac17 100644
--- a/src/idoscalemenuitem.c
+++ b/src/idoscalemenuitem.c
@@ -23,9 +23,6 @@
* Cody Russell <crussell@canonical.com>
*/
-#include "config.h"
-
-
#include <gtk/gtk.h>
#include "idorange.h"
#include "idoscalemenuitem.h"
diff --git a/src/idoswitchmenuitem.c b/src/idoswitchmenuitem.c
index 5a77b88..9bc9ef9 100644
--- a/src/idoswitchmenuitem.c
+++ b/src/idoswitchmenuitem.c
@@ -18,8 +18,6 @@
* Author: Charles Kerr <charles.kerr@canonical.com>
*/
-#include "config.h"
-
#include "idoswitchmenuitem.h"
#include "idoactionhelper.h"
diff --git a/src/idotimestampmenuitem.c b/src/idotimestampmenuitem.c
index 0c9c086..3cafbfc 100644
--- a/src/idotimestampmenuitem.c
+++ b/src/idotimestampmenuitem.c
@@ -5,23 +5,19 @@
* Charles Kerr <charles.kerr@canonical.com>
* Ted Gould <ted@canonical.com>
*
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3, as published
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranties of
- * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranties of
+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
+ * You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <string.h> /* strstr() */
#include <gtk/gtk.h>
diff --git a/src/idousermenuitem.c b/src/idousermenuitem.c
index c8ddc5e..96bbeb4 100644
--- a/src/idousermenuitem.c
+++ b/src/idousermenuitem.c
@@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAVE_CONFIG_H
- #include "config.h"
-#endif
-
#include <gtk/gtk.h>
#include "idousermenuitem.h"
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..39cde1f
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,32 @@
+find_package(GMock)
+
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-pie")
+
+# gtest-menuitems
+
+include_directories(
+ ${CMAKE_SOURCE_DIR}/src
+ ${PROJECT_DEPS_INCLUDE_DIRS}
+)
+
+set_source_files_properties(gtest-menuitems.cpp PROPERTIES COMPILE_FLAGS ${COMPILE_FLAGS})
+
+add_executable("gtest-menuitems" gtest-menuitems.cpp)
+target_link_libraries("gtest-menuitems"
+ ayatana-ido3-0.4
+
+ ${PROJECT_DEPS_LIBRARIES}
+
+ ${GTEST_LIBRARIES}
+ ${GTEST_BOTH_LIBRARIES}
+ ${GMOCK_LIBRARIES}
+)
+add_test("gtest-menuitems" "gtest-menuitems")
+add_dependencies("gtest-menuitems" ayatana-ido3-0.4)
+
+
+# coverage
+if (ENABLE_COVERAGE)
+ find_package(CoverageReport)
+ ENABLE_COVERAGE_REPORT(TARGETS "gtest-menuitems" TESTS "gtest-menuitems")
+endif()
diff --git a/tests/Makefile.am b/tests/Makefile.am
deleted file mode 100644
index a4bc763..0000000
--- a/tests/Makefile.am
+++ /dev/null
@@ -1,50 +0,0 @@
-IDOLIB = $(top_builddir)/src/libayatana-ido3-0.1.la
-
-# xorg-gtest isn't buildable https://bugs.launchpad.net/ubuntu/+source/xorg-gtest/+bug/1388892
-# check_LIBRARIES = libgtest.a
-check_PROGRAMS =
-TESTS =
-
-AM_CPPFLAGS = \
- $(GTEST_CPPFLAGS) \
- -I${top_srcdir}/src
-
-#############################
-# Google Test base library
-#############################
-
-nodist_libgtest_a_SOURCES = \
- $(XORG_GTEST_SOURCE)/src/xorg-gtest-all.cpp \
- $(GTEST_SOURCE)/gtest-all.cc \
- $(XORG_GTEST_SOURCE)/src/xorg-gtest_main.cpp
-libgtest_a_CPPFLAGS = \
- $(XORG_GTEST_CPPFLAGS) \
- $(AM_CPPFLAGS) \
- $(GTEST_CPPFLAGS) -w
-libgtest_a_CXXFLAGS = \
- $(AM_CXXFLAGS)
-
-#############################
-# Menuitem tests
-#############################
-
-# xorg-gtest isn't buildable https://bugs.launchpad.net/ubuntu/+source/xorg-gtest/+bug/1388892
-# TESTS += gtest-menuitems
-# check_PROGRAMS += gtest-menuitems
-
-gtest_menuitems_SOURCES = \
- gtest-menuitems.cpp
-gtest_menuitems_CPPFLAGS = \
- $(GCC_CFLAGS) \
- $(GTK_CFLAGS) \
- $(MAINTAINER_CFLAGS) \
- $(AM_CPPFLAGS)
-gtest_menuitems_LDFLAGS = \
- -pthread
-gtest_menuitems_LDADD = \
- $(GTK_LIBS) \
- $(IDOLIB) \
- libgtest.a \
- -lX11 -lXi
-
-DISTCLEANFILES = Makefile.in