diff options
-rw-r--r-- | CMakeLists.txt | 20 | ||||
-rw-r--r-- | Changelog | 6 | ||||
-rw-r--r-- | cmake/Modules/DebChangelog.cmake | 54 | ||||
-rw-r--r-- | cmake/Modules/UploadPPA.cmake | 6 | ||||
-rw-r--r-- | ejdb.project | 1 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 |
6 files changed, 77 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6907112..e806cf5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,22 +1,26 @@ cmake_minimum_required(VERSION 2.6) #cmake_policy(VERSION 2.6) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/") +set(DEB_CHANGELOG_REQUIRED ON) +include(DebChangelog) + set(PROJECT_NAME "ejdb") set(PROJECT_VENDOR "Softmotions") set(PROJECT_WEBSITE "http://ejdb.org") set(PROJECT_MAINTAINER "Anton Adamansky <adamansky@gmail.com>") set(PROJECT_DESCRIPTION_SUMMARY "Embedded JSON database library (EJDB)") -set(PROJECT_DESCRIPTION -"EJDB aims to be a fast MongoDB-like library which can be embedded into C/C++ applications under terms of LGPL license.") +set(PROJECT_DESCRIPTION "EJDB aims to be a fast MongoDB-like library which can be embedded into C/C++ applications under terms of LGPL license.") +set(CHANGELOG_MESSAGE ${CHANGELOG_LAST_MESSAGE}) set(PROJECT_PPA "ppa:adamansky/ejdb") set(PROJECT_PPA_USER "adamansky") set(PROJECT_PPA_DISTRIB_TARGET vivid utopic trusty precise) project(${PROJECT_NAME} C) -set(PROJECT_VERSION_MAJOR 1) -set(PROJECT_VERSION_MINOR 2) -set(PROJECT_VERSION_PATCH 6) +set(PROJECT_VERSION_MAJOR ${CHANGELOG_LAST_VERSION_MAJOR}) +set(PROJECT_VERSION_MINOR ${CHANGELOG_LAST_VERSION_MINOR}) +set(PROJECT_VERSION_PATCH ${CHANGELOG_LAST_VERSION_PATCH}) set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) set(${PROJECT_NAME}_VERSION ${PROJECT_VERSION}) set(${PROJECT_NAME}_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) @@ -41,8 +45,6 @@ else(CMAKE_SIZEOF_VOID_P MATCHES 8) set(PROJECT_ARCH "x86") endif(CMAKE_SIZEOF_VOID_P MATCHES 8) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/") - include(GNUInstallDirs) include(EjdbUtils) @@ -99,3 +101,7 @@ endif() if (PROJECT_ARCH) message("PROJECT_ARCH: ${PROJECT_ARCH}") endif() +message("PROJECT: ${CHANGELOG_LAST_LINE}") +if (CHANGELOG_MESSAGE) + message("CHANGELOG_MESSAGE:\n ${CHANGELOG_MESSAGE}") +endif() @@ -1,3 +1,9 @@ +ejdb (1.2.7) UNRELEASED; urgency=low + + * Project build improvements #131 + + -- Anton Adamansky <adamansky@gmail.com> Thu, 16 Apr 2015 12:20:34 +0600 + ejdb (1.2.6) testing; urgency=low * Fix: $addToSet works improperly for non existent nested keys #123 diff --git a/cmake/Modules/DebChangelog.cmake b/cmake/Modules/DebChangelog.cmake new file mode 100644 index 0000000..6fddf6a --- /dev/null +++ b/cmake/Modules/DebChangelog.cmake @@ -0,0 +1,54 @@ +## -*- mode:cmake; coding:utf-8; -*- +# Set output: +# CHANGELOG_LAST_LINE +# CHANGELOG_LAST_VERSION - Last changelog version +# CHANGELOG_LAST_VERSION_MAJOR - Last changelog major version +# CHANGELOG_LAST_VERSION_MINOR - Last changelog minor version +# CHANGELOG_LAST_VERSION_PATCH - Last changelog patch version +# CHANGELOG_LAST_MESSAGE - Last changelog description + +if (NOT DEB_CHANGELOG) + set(DEB_CHANGELOG "${CMAKE_SOURCE_DIR}/Changelog") +endif() + +if (NOT EXISTS ${DEB_CHANGELOG}) + if (DEB_CHANGELOG_REQUIRED) + message(FATAL_ERROR "Missing required project changelog file: ${DEB_CHANGELOG}") + else() + message("Missing project changelog file: ${DEB_CHANGELOG}") + return() + endif() +endif() +message(STATUS "Using project changelog file: ${DEB_CHANGELOG}") + +file(STRINGS "${DEB_CHANGELOG}" _DEBCHANGELOGN) + +foreach(CLINE IN LISTS _DEBCHANGELOGN) + if (NOT CHANGELOG_LAST_VERSION) + #ejdb (1.2.6) testing; urgency=low + string(REGEX MATCH "^[A-Za-z0-9_].*[ \t]+\\((([0-9]+)\\.([0-9]+)\\.([0-9]+))\\)[ \t]+[A-Za-z]+;[ \t].*" _MATCHED "${CLINE}") + if (_MATCHED) + set(CHANGELOG_LAST_LINE "${_MATCHED}") + set(CHANGELOG_LAST_VERSION "${CMAKE_MATCH_1}") + set(CHANGELOG_LAST_VERSION_MAJOR "${CMAKE_MATCH_2}") + set(CHANGELOG_LAST_VERSION_MINOR "${CMAKE_MATCH_3}") + set(CHANGELOG_LAST_VERSION_PATCH "${CMAKE_MATCH_4}") + endif() + elseif(NOT CHANGELOG_LAST_MESSAGE) + string(REGEX MATCH "^[A-Za-z0-9_].*[ \t]+\\((([0-9]+)\\.([0-9]+)\\.([0-9]+))\\)[ \t]+[A-Za-z]+;[ \t].*" _MATCHED "${CLINE}") + if (_MATCHED) + string(STRIP "${_CDESC}" CHANGELOG_LAST_MESSAGE) + return() + endif() + if (CLINE) + string(REGEX MATCH "^[ \t]*\\-\\-[ \t]+" _MATCHED "${CLINE}") + if (_MATCHED) + string(STRIP "${_CDESC}" CHANGELOG_LAST_MESSAGE) + return() + endif() + set(_CDESC "${_CDESC}\n${CLINE}") + endif() + endif() +endforeach(CLINE) + +message(FATAL_ERROR "Invalid changelog file: ${DEB_CHANGELOG}") diff --git a/cmake/Modules/UploadPPA.cmake b/cmake/Modules/UploadPPA.cmake index c813344..0cef056 100644 --- a/cmake/Modules/UploadPPA.cmake +++ b/cmake/Modules/UploadPPA.cmake @@ -225,7 +225,7 @@ endif() if(CHANGELOG_MESSAGE) set(output_changelog_msg ${CHANGELOG_MESSAGE}) else() - set(output_changelog_msg "Package created with CMake") + set(output_changelog_msg "* Package created with CMake") endif(CHANGELOG_MESSAGE) message(STATUS "Changelog message : \"${output_changelog_msg}\"") if(EXISTS ${CPACK_DEBIAN_RESOURCE_FILE_CHANGELOG}) @@ -239,7 +239,7 @@ if(EXISTS ${CPACK_DEBIAN_RESOURCE_FILE_CHANGELOG}) OUTPUT_STRIP_TRAILING_WHITESPACE) file(WRITE ${debian_changelog} "${CPACK_DEBIAN_PACKAGE_NAME} (${DEBIAN_PACKAGE_VERSION}) ${DISTRI}; urgency=low\n\n" - " * ${output_changelog_msg}\n\n" + " ${output_changelog_msg}\n\n" " -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${DATE_TIME}\n\n" ) file(APPEND ${debian_changelog} ${debian_changelog_content}) @@ -252,7 +252,7 @@ else() OUTPUT_STRIP_TRAILING_WHITESPACE) file(WRITE ${debian_changelog} "${CPACK_DEBIAN_PACKAGE_NAME} (${DEBIAN_PACKAGE_VERSION}) ${DISTRI}; urgency=low\n\n" - " * ${output_changelog_msg}\n\n" + " ${output_changelog_msg}\n\n" " -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${DATE_TIME}\n" ) #configure_file(${debian_changelog} ${CPACK_DEBIAN_RESOURCE_FILE_CHANGELOG} COPYONLY) diff --git a/ejdb.project b/ejdb.project index 4ae501c..94b8a87 100644 --- a/ejdb.project +++ b/ejdb.project @@ -179,6 +179,7 @@ <File Name="win64-tc.cmake"/> <File Name="cmake/Modules/UploadPPA.cmake"/> <File Name="cmake/Modules/Win32LIBTools.cmake"/> + <File Name="cmake/Modules/DebChangelog.cmake"/> </VirtualDirectory> <VirtualDirectory Name="docs"> <File Name="Changelog"/> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bdcc1a4..cc843b6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -273,4 +273,3 @@ message("\nCMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") message("BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}") message("BUILD_TESTS: ${BUILD_TESTS}") message("BUILD_SAMPLES: ${BUILD_SAMPLES}") -message("") |