diff --git a/CMake/GitExternal.cmake b/CMake/GitExternal.cmake index 0b70be2..1063610 100644 --- a/CMake/GitExternal.cmake +++ b/CMake/GitExternal.cmake @@ -8,7 +8,7 @@ # update target to bump the tag to the master revision by # recreating .gitexternals. # * Provides function -# git_external( [VERBOSE,SHALLOW] +# git_external( [VERBOSE] # [RESET ]) # which will check out directory in CMAKE_SOURCE_DIR (if relative) # or in the given absolute path using the given repository and tag @@ -18,11 +18,6 @@ # VERBOSE, when present, this option tells the function to output # information about what operations are being performed by git on # the repo. -# SHALLOW, when present, causes a shallow clone of depth 1 to be made -# of the specified repo. This may save considerable memory/bandwidth -# when only a specific branch of a repo is required and the full history -# is not required. Note that the SHALLOW option will only work for a branch -# or tag and cannot be used for an arbitrary SHA. # OPTIONAL, when present, this option makes this operation optional. # The function will output a warning and return if the repo could not be # cloned. @@ -33,7 +28,7 @@ # * rebase: Rebases all git externals, including sub projects # # Options (global) which control behaviour: -# GIT_EXTERNAL_VERBOSE +# COMMON_GIT_EXTERNAL_VERBOSE # This is a global option which has the same effect as the VERBOSE option, # with the difference that output information will be produced for all # external repos when set. @@ -56,7 +51,7 @@ if(NOT GIT_EXECUTABLE) endif() include(CMakeParseArguments) -option(GIT_EXTERNAL_VERBOSE "Print git commands as they are executed" OFF) +option(COMMON_GIT_EXTERNAL_VERBOSE "Print git commands as they are executed" OFF) if(NOT GITHUB_USER AND DEFINED ENV{GITHUB_USER}) set(GITHUB_USER $ENV{GITHUB_USER} CACHE STRING @@ -64,20 +59,13 @@ if(NOT GITHUB_USER AND DEFINED ENV{GITHUB_USER}) endif() macro(GIT_EXTERNAL_MESSAGE msg) - if(GIT_EXTERNAL_VERBOSE OR GIT_EXTERNAL_LOCAL_VERBOSE) + if(COMMON_GIT_EXTERNAL_VERBOSE) message(STATUS "${NAME}: ${msg}") endif() endmacro() -# utility function for printing a list with custom separator -function(JOIN VALUES GLUE OUTPUT) - string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}") - string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping - set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) -endfunction() - function(GIT_EXTERNAL DIR REPO tag) - cmake_parse_arguments(GIT_EXTERNAL_LOCAL "VERBOSE;SHALLOW;OPTIONAL" "" "RESET" ${ARGN}) + cmake_parse_arguments(GIT_EXTERNAL_LOCAL "VERBOSE;OPTIONAL" "" "RESET" ${ARGN}) set(TAG ${tag}) if(GIT_EXTERNAL_TAG AND "${tag}" MATCHES "^[0-9a-f]+$") set(TAG ${GIT_EXTERNAL_TAG}) @@ -105,16 +93,9 @@ function(GIT_EXTERNAL DIR REPO tag) if(NOT EXISTS "${DIR}") # clone - set(_clone_options --recursive) - if(GIT_EXTERNAL_LOCAL_SHALLOW) - list(APPEND _clone_options --depth 1 --branch ${TAG}) - else() - set(_msg_tag "[${TAG}]") - endif() - JOIN("${_clone_options}" " " _msg_text) - message(STATUS "git clone ${_msg_text} ${REPO} ${DIR} ${_msg_tag}") + message(STATUS "git clone --recursive ${REPO} ${DIR} [${TAG}]") execute_process( - COMMAND "${GIT_EXECUTABLE}" clone ${_clone_options} ${REPO} ${DIR} + COMMAND "${GIT_EXECUTABLE}" clone --recursive ${REPO} ${DIR} RESULT_VARIABLE nok ERROR_VARIABLE error WORKING_DIRECTORY "${GIT_EXTERNAL_DIR}") if(nok) @@ -127,21 +108,8 @@ function(GIT_EXTERNAL DIR REPO tag) endif() # checkout requested tag - if(NOT GIT_EXTERNAL_LOCAL_SHALLOW) - execute_process( - COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}" - RESULT_VARIABLE nok ERROR_VARIABLE error - WORKING_DIRECTORY "${DIR}") - if(nok) - message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n") - endif() - endif() - - # checkout requested tag - execute_process( - COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}" - RESULT_VARIABLE nok ERROR_VARIABLE error - WORKING_DIRECTORY "${DIR}") + execute_process(COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}" + RESULT_VARIABLE nok ERROR_VARIABLE error WORKING_DIRECTORY "${DIR}") if(nok) message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n") endif() @@ -281,13 +249,10 @@ if(EXISTS ${GIT_EXTERNALS} AND NOT GIT_EXTERNAL_SCRIPT_MODE) if(NOT TARGET update) add_custom_target(update) endif() - if(NOT TARGET update-gitexternal) - add_custom_target(update-gitexternal) - add_custom_target(flatten-gitexternal) - add_dependencies(update update-gitexternal) - endif() - if(NOT TARGET ${PROJECT_NAME}-flatten-gitexternal) + if(NOT TARGET ${PROJECT_NAME}-update-gitexternal) + add_custom_target(${PROJECT_NAME}-update-gitexternal) add_custom_target(${PROJECT_NAME}-flatten-gitexternal) + add_dependencies(update ${PROJECT_NAME}-update-gitexternal) endif() # Create a unique, flat name @@ -328,7 +293,7 @@ endif()") COMMENT "Update ${REPO} in ${GIT_EXTERNALS_BASE}" DEPENDS ${GIT_EXTERNAL_TARGET} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") - add_dependencies(update-gitexternal + add_dependencies(${PROJECT_NAME}-update-gitexternal update-gitexternal-${GIT_EXTERNAL_NAME}) # Flattens a git external repository into its parent repo: @@ -346,12 +311,10 @@ endif()") COMMENT "Flatten ${REPO} into ${DIR}" DEPENDS ${PROJECT_NAME}-make-branch WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${DIR}") - add_dependencies(flatten-gitexternal - flatten-gitexternal-${GIT_EXTERNAL_NAME}) add_dependencies(${PROJECT_NAME}-flatten-gitexternal flatten-gitexternal-${GIT_EXTERNAL_NAME}) - foreach(_target flatten-gitexternal-${GIT_EXTERNAL_NAME} ${PROJECT_NAME}-flatten-gitexternal flatten-gitexternal update-gitexternal-${GIT_EXTERNAL_NAME} ${GIT_EXTERNAL_TARGET} update-gitexternal update) + foreach(_target flatten-gitexternal-${GIT_EXTERNAL_NAME} ${PROJECT_NAME}-flatten-gitexternal update-gitexternal-${GIT_EXTERNAL_NAME} ${GIT_EXTERNAL_TARGET} ${PROJECT_NAME}-update-gitexternal update) set_target_properties(${_target} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER git) endforeach() diff --git a/README.md b/README.md index 145750a..907ec0d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [TOC] -# Introduction {#Introduction} +# Introduction Servus is a small C++ network utility library that provides a zeroconf API, URI parsing and UUIDs. @@ -10,7 +10,7 @@ Servus can be retrieved by cloning the [Bug Report](https://github.com/HBPVis/servus/issues) if you find any issues with this release. -## Features {#Features} +## Features Servus provides classes for: @@ -20,7 +20,7 @@ Servus provides classes for: * Zeroconf announcement and browsing using Avahi or DNSSD * Detailed @ref Changelog -# Building {#Building} +# Building Servus is a cross-platform library, the only mandatory dependency is a C++11 compiler. Zeroconf will be available in those platforms were either Avahi or @@ -28,7 +28,9 @@ DNSSD are available, otherwise an empty dummy backend is used. Servus uses CMake to provide a platform-independent build configuration. The following platforms and build environments have been tested: -* Linux: Ubuntu 16.04, RHEL 6 using gcc 4.8.3 +* Linux: Ubuntu 16.04, RHEL 6.8 (Makefile, Ninja) +* Windows: 7 (Visual Studio 2012) +* Mac OS X: 10.9 (Makefile, Ninja) The following external, pre-installed optional dependencies are used: @@ -42,5 +44,5 @@ Building from source is as simple as: git clone https://github.com/HBPVIS/Servus.git mkdir Servus/build cd Servus/build - cmake .. - make + cmake -GNinja .. + ninja diff --git a/doc/Changelog.md b/doc/Changelog.md index 5b49f45..7f26b93 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -3,6 +3,8 @@ # git master +# Release 1.5 (09-12-2016) + * [64](https://github.com/HBPVis/Servus/pull/64): Add Serializable::getSchema() * [64](https://github.com/HBPVis/Servus/pull/64):