Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 2.8...4.0)
project(zproject)
enable_language(C)
enable_testing()

set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
include(GNUInstallDirs)

set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# Select flags
if(MSVC)
Expand Down Expand Up @@ -51,7 +52,7 @@ if (NOT HAVE_NET_IF_H)
CHECK_INCLUDE_FILE("net/if.h" HAVE_NET_IF_H)
endif()

file(REMOVE "${SOURCE_DIR}/src/platform.h")
file(REMOVE "${PROJECT_SOURCE_DIR}/src/platform.h")

file(WRITE "${PROJECT_BINARY_DIR}/platform.h.in" "
#cmakedefine HAVE_LINUX_WIRELESS_H
Expand All @@ -68,7 +69,7 @@ if (WIN32)
#so the sources have to be compiled as c++
if (MSVC AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
enable_language(CXX)
file(GLOB sources "${SOURCE_DIR}/src/*.c")
file(GLOB sources "${PROJECT_SOURCE_DIR}/src/*.c")
set_source_files_properties(
${sources}
PROPERTIES LANGUAGE CXX
Expand All @@ -94,7 +95,7 @@ if (CYGWIN)
set(MORE_LIBRARIES)
endif()

list(APPEND CMAKE_MODULE_PATH "${SOURCE_DIR}")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}")
set(OPTIONAL_LIBRARIES)
set(OPTIONAL_LIBRARIES_STATIC)

Expand Down Expand Up @@ -126,7 +127,7 @@ set (zproject_headers
)

source_group ("Header Files" FILES ${zproject_headers})
install(FILES ${zproject_headers} DESTINATION include)
install(FILES ${zproject_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

########################################################################
# executables
Expand Down Expand Up @@ -197,31 +198,30 @@ include(CTest)
# cleanup
########################################################################
if (NOT TARGET distclean)
add_custom_target (distclean @echo Cleaning for source distribution)
if (CMAKE_VERSION VERSION_LESS 3.17)
set(rm_command rm -rf)
else()
set(rm_command ${CMAKE_COMMAND} -E rm -rf --)
endif()
set(cmake_generated ${PROJECT_BINARY_DIR}/CMakeCache.txt
${PROJECT_BINARY_DIR}/cmake_install.cmake
${PROJECT_BINARY_DIR}/Makefile
${PROJECT_BINARY_DIR}/CMakeFiles
${PROJECT_BINARY_DIR}/CTestTestfile.cmake
${PROJECT_BINARY_DIR}/DartConfiguration.tcl
${PROJECT_BINARY_DIR}/Testing
${PROJECT_BINARY_DIR}/compile_commands.json
${PROJECT_BINARY_DIR}/platform.h
${PROJECT_BINARY_DIR}/src/libzproject.pc
${PROJECT_BINARY_DIR}/src/libzproject.so
${PROJECT_BINARY_DIR}/src/zproject_selftest
)
add_custom_target(distclean
COMMAND ${rm_command} CMakeTmp ${cmake_generated}
COMMENT Cleaning for source distribution
)
endif()

set(cmake_generated ${PROJECT_BINARY_DIR}/CMakeCache.txt
${PROJECT_BINARY_DIR}/cmake_install.cmake
${PROJECT_BINARY_DIR}/Makefile
${PROJECT_BINARY_DIR}/CMakeFiles
${PROJECT_BINARY_DIR}/CTestTestfile.cmake
${PROJECT_BINARY_DIR}/DartConfiguration.tcl
${PROJECT_BINARY_DIR}/Testing
${PROJECT_BINARY_DIR}/compile_commands.json
${PROJECT_BINARY_DIR}/platform.h
${PROJECT_BINARY_DIR}/src/libzproject.pc
${PROJECT_BINARY_DIR}/src/libzproject.so
${PROJECT_BINARY_DIR}/src/zproject_selftest
)

add_custom_command(
DEPENDS clean
COMMENT "distribution clean"
COMMAND rm
ARGS -rf CMakeTmp ${cmake_generated}
TARGET distclean
)

include(ClangFormat OPTIONAL)

########################################################################
Expand Down
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
[With GCC Code Coverage reporting])],
[ZPROJECT_GCOV="$withval"])

if test "x${ZPROJECT_GCOV}" = "xyes"; then
if test "x${ZPROJECT_GCOV}" == "xyes"; then
CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage"

if test "x${ZPROJECT_ORIG_CFLAGS}" != "xnone"; then
Expand All @@ -94,7 +94,7 @@ AC_ARG_ENABLE(address-sanitizer, [AS_HELP_STRING([--enable-address-sanitizer=yes
[Build with GCC Address Sanitizer instrumentation])],
[ZPROJECT_ASAN="$enableval"])

if test "x${ZPROJECT_ASAN}" = "xyes"; then
if test "x${ZPROJECT_ASAN}" == "xyes"; then
CFLAGS="${CFLAGS} -fsanitize=address"
CXXFLAGS="${CXXFLAGS} -fsanitize=address"

Expand All @@ -114,7 +114,7 @@ AC_ARG_ENABLE([bindings-python],
[ZPROJECT_BINDINGS_PYTHON=$enableval],
[ZPROJECT_BINDINGS_PYTHON=no])

if test "x$ZPROJECT_BINDINGS_PYTHON" = "xyes"; then
if test "x$ZPROJECT_BINDINGS_PYTHON" == "xyes"; then
AM_CONDITIONAL(ENABLE_BINDINGS_PYTHON, true)
AC_MSG_RESULT([yes])
else
Expand Down
1 change: 0 additions & 1 deletion packaging/debian/compat

This file was deleted.

7 changes: 3 additions & 4 deletions packaging/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ Section: net
Priority: optional
Maintainer: zproject Developers <zeromq-dev@lists.zeromq.org>
Standards-Version: 4.0.1.0
Build-Depends: debhelper (>= 9),
pkg-config,
Build-Depends: debhelper-compat (= 12),
pkgconf | pkg-config,
generator-scripting-language,
asciidoc-base | asciidoc, xmlto,
dh-autoreconf
asciidoc-base <!nodoc>, xmlto <!nodoc>,

Package: zproject
Architecture: any
Expand Down
7 changes: 3 additions & 4 deletions packaging/debian/zproject.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ Source: zproject
Version: 1.1.0-0.1
Maintainer: zproject Developers <zeromq-dev@lists.zeromq.org>
Architecture: any
Build-Depends: debhelper (>= 9),
pkg-config,
Build-Depends: debhelper-compat (= 12),
pkgconf | pkg-config,
generator-scripting-language,
asciidoc-base | asciidoc, xmlto,
dh-autoreconf
asciidoc-base <!nodoc>, xmlto <!nodoc>,

Files:
7697688bf65a35bc33ae2db51ebb0e3b 818110 zproject.tar.gz
5 changes: 0 additions & 5 deletions packaging/obs/_service
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
<param name="files">*/packaging/debian/changelog</param>
<param name="outfilename">debian.changelog</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/compat</param>
<param name="outfilename">debian.compat</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/control</param>
Expand Down
1 change: 1 addition & 0 deletions zproject_autotools.gsl
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,7 @@ AC_ARG_ENABLE([$(name)],
AM_CONDITIONAL([ENABLE_$(NAME:c)], [test x$enable_$(name:c) != xno])
AM_COND_IF([ENABLE_$(NAME:c)], [AC_MSG_NOTICE([ENABLE_$(NAME:c) defined])])

.else
AM_CONDITIONAL([ENABLE_$(PROJECT.PREFIX:c)_SELFTEST], [test x$enable_$(project.prefix:c)_selftest != xno])
AM_COND_IF([ENABLE_$(PROJECT.PREFIX:c)_SELFTEST], [AC_MSG_NOTICE([ENABLE_$(PROJECT.PREFIX:c)_SELFTEST defined])])

Expand Down
25 changes: 9 additions & 16 deletions zproject_debian.gsl
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ $(project.name:lower) ($(->version.major).$(->version.minor).$(->version.patch)-
* Initial packaging.

-- $(project.name) Developers <$(project.email)> Wed, 31 Dec 2014 00:00:00 +0000
.output "packaging/debian/compat"
10
.output "packaging/debian/control"
#
# $(project.name) - $(project.description?'':)
Expand All @@ -41,8 +39,8 @@ Section: net
Priority: optional
Maintainer: $(project.name) Developers <$(project.email)>
Standards-Version: 4.0.1.0
Build-Depends: debhelper (>= 9),
pkg-config,
Build-Depends: debhelper-compat (= 12),
pkgconf | pkg-config,
.for project.use
.if defined(use.debian_name)
. if !(use.debian_name = '')
Expand All @@ -65,15 +63,13 @@ Build-Depends: debhelper (>= 9),
.endif
.if systemd ?= 1
.# necessary for systemd.pc to get unit install path
systemd,
systemd-dev | systemd,
.endif
.if python_cffi ?= 1
dh-python <!nopython>,
python3-all-dev <!nopython>, python3-cffi <!nopython>, python3-setuptools <!nopython>,
.endif
.- NOTE: after support for Debian 7 and Ubuntu 12.04 is dropped, <!nodoc> can be added to each of the following
asciidoc-base | asciidoc, xmlto,
dh-autoreconf
asciidoc-base <!nodoc>, xmlto <!nodoc>,
.if project.exports_classes | ( project.has_classes & project.has_main )
.# NOTE: Now for at least some compilers the symbol visibility seems to
.# be managed in the shared library files, not the "exportedness" - so
Expand Down Expand Up @@ -305,6 +301,7 @@ override_dh_auto_configure:
dh_auto_configure -- \\
.if systemd ?= 1
--with-systemd-units \\
--with-systemdsystemunitdir=/lib/systemd/system \\
.endif
.for project.use where use.optional
--with-$(use.libname)=yes \\
Expand All @@ -314,9 +311,6 @@ override_dh_auto_configure:

%:
dh $@ \\
.if systemd ?= 1
--with systemd \\
.endif
.if python_cffi ?= 1
\$(WITH_PYTHON) \\
.endif
Expand Down Expand Up @@ -407,8 +401,8 @@ Source: $(project.name)
Version: $(->version.major).$(->version.minor).$(->version.patch)-0.1
Maintainer: $(project.name) Developers <$(project.email)>
Architecture: any
Build-Depends: debhelper (>= 9),
pkg-config,
Build-Depends: debhelper-compat (= 12),
pkgconf | pkg-config,
.for project.use
.if defined(use.debian_name)
. if !(use.debian_name = '')
Expand All @@ -427,14 +421,13 @@ Build-Depends: debhelper (>= 9),
,
.endfor
.if systemd ?= 1
systemd,
systemd-dev | systemd,
.endif
.if python_cffi ?= 1
dh-python <!nopython>,
python3-all-dev <!nopython>, python3-cffi <!nopython>, python3-setuptools <!nopython>,
.endif
asciidoc-base | asciidoc, xmlto,
dh-autoreconf
asciidoc-base <!nodoc>, xmlto <!nodoc>,

Files:
7697688bf65a35bc33ae2db51ebb0e3b 818110 $(string.replace (project.name, "_|-"):lower).tar.gz
Expand Down
5 changes: 0 additions & 5 deletions zproject_obs.gsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ register_target ("obs", "service for Open Build Service")
<param name="files">*/packaging/debian/changelog</param>
<param name="outfilename">debian.changelog</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/compat</param>
<param name="outfilename">debian.compat</param>
</service>
<service name="extract_file" mode="buildtime">
<param name="archive">*.tar</param>
<param name="files">*/packaging/debian/control</param>
Expand Down