Skip to content

Commit

Permalink
[v2.2.0] Merge branch 'bleeding' (Version release)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snaipe committed Dec 8, 2015
2 parents 6a766ca + 78a6246 commit 65aa79d
Show file tree
Hide file tree
Showing 150 changed files with 13,147 additions and 1,941 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.1.0
current_version = 2.2.0
commit = False

[bumpversion:file:CMakeLists.txt]
Expand Down
12 changes: 12 additions & 0 deletions .cmake/Modules/Capabilities.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright (C) 2015 Franklin "Snaipe" Mathieu.
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the LICENSE file distributed with Criterion.

include(CheckPrototypeDefinition)

check_prototype_definition(
strtok_s
"char *strtok_s(char *strToken, const char *strDelimit, char **context)"
NULL
"string.h"
HAVE_STRTOK_S)
42 changes: 42 additions & 0 deletions .cmake/Modules/DebConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# build a Debian package for Launchpad
set(CPACK_DEBIAN_PACKAGE_NAME "criterion")
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
set(CPACK_DEBIAN_PACKAGE_SECTION "libs")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/Snaipe/Criterion")
set(CPACK_DEBIAN_BUILD_DEPENDS
debhelper
cmake
gettext
libpcre3-dev
)

set(CPACK_DEBIAN_PACKAGE_DEPENDS
libpcre3
)

set(CPACK_DEBIAN_CMAKE_OPTIONS)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/description.txt")

set(CPACK_DEBIAN_PACKAGE_SOURCE_COPY "${CMAKE_SOURCE_DIR}/.cmake/copy-source.sh")

set(CPACK_DEBIAN_DISTRIBUTION_NAME ubuntu)
set(CPACK_DEBIAN_DISTRIBUTION_RELEASES precise trusty vivid wily xenial)

set(DPUT_HOST "snaipewastaken-ppa")
set(DPUT_SNAPSHOT_HOST "snaipewastaken-ppa")
set(CPACK_DEBIAN_PACKAGE_DOCS "")
set(CPACK_DEBIAN_PACKAGE_INSTALL
"/usr/lib/*.so"
"/usr/lib/*.so.*"
"/usr/share/locale/*"
)

set(CPACK_COMPONENTS_ALL "dev")
set(CPACK_COMPONENT_DEV_DISPLAY_NAME "Criterion library development files")
set(CPACK_COMPONENT_DEV_DESCRIPTION "These are the development files.")
set(CPACK_COMPONENT_DEV_SECTION "devel")

set(CPACK_COMPONENT_DEV_DOCS "")
set(CPACK_COMPONENT_DEV_INSTALL "/usr/include")

include (DebSourcePPA)
347 changes: 347 additions & 0 deletions .cmake/Modules/DebSourcePPA.cmake

Large diffs are not rendered by default.

30 changes: 23 additions & 7 deletions .cmake/Modules/GettextTranslate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,29 @@ macro(GettextTranslate)

else()

add_custom_target(${PO_TARGET}
COMMAND ${GettextTranslate_MSGMERGE_EXECUTABLE} --lang=${lang}
${PO_FILE_NAME} ${TEMPLATE_FILE_ABS}
-o ${PO_FILE_NAME}.new
COMMAND mv ${PO_FILE_NAME}.new ${PO_FILE_NAME}
DEPENDS ${TEMPLATE_FILE_ABS}
execute_process(
COMMAND ${GettextTranslate_MSGMERGE_EXECUTABLE} --version
OUTPUT_VARIABLE MSGMERGE_VERSION_MSG
)
string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" MSGMERGE_VERSION "${MSGMERGE_VERSION_MSG}")

if ("${MSGMERGE_VERSION}" VERSION_GREATER "0.17")
add_custom_target(${PO_TARGET}
COMMAND ${GettextTranslate_MSGMERGE_EXECUTABLE} --lang=${lang}
${PO_FILE_NAME} ${TEMPLATE_FILE_ABS}
-o ${PO_FILE_NAME}.new
COMMAND mv ${PO_FILE_NAME}.new ${PO_FILE_NAME}
DEPENDS ${TEMPLATE_FILE_ABS}
)
else ()
add_custom_target(${PO_TARGET}
COMMAND ${GettextTranslate_MSGMERGE_EXECUTABLE}
${PO_FILE_NAME} ${TEMPLATE_FILE_ABS}
-o ${PO_FILE_NAME}.new
COMMAND mv ${PO_FILE_NAME}.new ${PO_FILE_NAME}
DEPENDS ${TEMPLATE_FILE_ABS}
)
endif ()

endif()

Expand All @@ -271,7 +287,7 @@ macro(GettextTranslate)
add_dependencies(${PO_TARGET} ${MAKEVAR_DOMAIN}.pot-update)

install(FILES ${GMO_FILE_NAME} DESTINATION
${LOCALEDIR}/${lang}/LC_MESSAGES
${LOCALEDIR_REL}/${lang}/LC_MESSAGES
RENAME ${MAKEVAR_DOMAIN}.mo
)

Expand Down
79 changes: 79 additions & 0 deletions .cmake/Modules/PackageConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@

function(extract_version version major minor patch extra)
string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)?" version_valid ${version})
if(version_valid)
string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)(.*)?" "\\1;\\2;\\3;\\4" VERSION_MATCHES ${version})
list(GET VERSION_MATCHES 0 version_major)
set(${major} ${version_major} PARENT_SCOPE)
list(GET VERSION_MATCHES 1 version_minor)
set(${minor} ${version_minor} PARENT_SCOPE)
list(GET VERSION_MATCHES 2 version_patch)
set(${patch} ${version_patch} PARENT_SCOPE)
list(GET VERSION_MATCHES 3 version_extra)
set(${extra} ${version_extra} PARENT_SCOPE)
else(version_valid)
message(AUTHOR_WARNING "Bad version ${version}; falling back to 0 (have you made an initial release?)")
set(${major} "0" PARENT_SCOPE)
set(${minor} "" PARENT_SCOPE)
set(${patch} "" PARENT_SCOPE)
set(${extra} "" PARENT_SCOPE)
endif(version_valid)
endfunction(extract_version)

if (WIN32)
set(CPACK_GENERATOR "ZIP")
set(CPACK_SOURCE_GENERATOR "ZIP")
else ()
set(CPACK_GENERATOR "TGZ")
set(CPACK_SOURCE_GENERATOR "TGZ")
endif ()

set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A KISS, modern unit testing framework for C and C++.")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-binary-${PROJECT_VERSION}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}-${PROJECT_VERSION}")
set(CPACK_PACKAGE_VENDOR "Franklin \"Snaipe\" Mathieu")
set(CPACK_PACKAGE_CONTACT "Franklin \"Snaipe\" Mathieu <franklinmathieu@gmail.com>")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")

if (WIN32)
# add snapshot specific versioning information
if (CPACK_DEBIAN_PACKAGE_TYPE STREQUAL "snapshot")
execute_process(COMMAND date +%Y%m%d%0k%0M%0S%z OUTPUT_VARIABLE SNAPSHOT_DATE_TIME)
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}-snapshot-${SNAPSHOT_DATE_TIME}")
STRING(REPLACE "\n" "" CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
endif ()
endif ()

set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/debian.copyright")
extract_version(${PROJECT_VERSION}
CPACK_PACKAGE_VERSION_MAJOR
CPACK_PACKAGE_VERSION_MINOR
CPACK_PACKAGE_VERSION_PATCH
VERSION_EXTRA
)

set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})

file(GLOB TRASH_FILES "${CMAKE_SOURCE_DIR}/*")
set(KEEP_FILES
"${CMAKE_SOURCE_DIR}/.cmake"
"${CMAKE_SOURCE_DIR}/src"
"${CMAKE_SOURCE_DIR}/include"
"${CMAKE_SOURCE_DIR}/doc"
"${CMAKE_SOURCE_DIR}/dev"
"${CMAKE_SOURCE_DIR}/po"
"${CMAKE_SOURCE_DIR}/dependencies"
"${CMAKE_SOURCE_DIR}/CMakeLists.txt"
"${CMAKE_SOURCE_DIR}/README.md"
"${CMAKE_SOURCE_DIR}/CONTRIBUTING.md"
"${CMAKE_SOURCE_DIR}/LICENSE"
"${CMAKE_SOURCE_DIR}/ChangeLog"
"${CMAKE_SOURCE_DIR}/description.txt"
)
list(REMOVE_ITEM TRASH_FILES ${KEEP_FILES})
# Escape any '.' characters
string(REPLACE "." "\\\\." TRASH_FILES "${TRASH_FILES}")
set(CPACK_SOURCE_IGNORE_FILES "${TRASH_FILES}")

include(CPack)
11 changes: 11 additions & 0 deletions .cmake/copy-source.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

CURDIR=$(dirname $0)
SOURCE_DIR=$1; shift
DEST_DIR=$1; shift

(
cd "$SOURCE_DIR"
mkdir -p "$DEST_DIR"
"$CURDIR/git-archive-all.sh" --format tar -- - | tar -x -C "$DEST_DIR"
)
Loading

0 comments on commit 65aa79d

Please sign in to comment.