Skip to content

Commit

Permalink
Merge pull request #50 from drdanz/version_cleanup
Browse files Browse the repository at this point in the history
 Cleanup version stuff
  • Loading branch information
paulfitz committed Jul 8, 2013
2 parents 4cfbecc + ef94dba commit 228b070
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 119 deletions.
15 changes: 11 additions & 4 deletions conf/YarpDescribe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ set(YARP_DEPENDENCY_FILENAME YARPDependencies.cmake)
set(YARP_BINDINGS ${CMAKE_SOURCE_DIR}/bindings)
configure_file(${YARP_MODULE_DIR}/template/YARPConfig.cmake.in
${CMAKE_BINARY_DIR}/YARPConfig.cmake @ONLY IMMEDIATE)
configure_file(${YARP_MODULE_DIR}/template/YARPConfigVersion.cmake.in
${CMAKE_BINARY_DIR}/YARPConfigVersion.cmake @ONLY IMMEDIATE)
if (${CMAKE_VERSION} VERSION_LESS 2.8.8) # -> version is 2.8.7 (oldest supported)
include(WriteBasicConfigVersionFile )
write_basic_config_version_file(${CMAKE_BINARY_DIR}/YARPConfigVersion.cmake
VERSION ${YARP_VERSION}
COMPATIBILITY AnyNewerVersion )
else()
include(CMakePackageConfigHelpers)
WRITE_BASIC_PACKAGE_VERSION_FILE(${CMAKE_BINARY_DIR}/YARPConfigVersion.cmake VERSION ${YARP_VERSION} COMPATIBILITY AnyNewerVersion )
endif()
export(TARGETS ${YARP_LIBRARIES} FILE ${YARP_DEPENDENCY_FILE})

set(VERSIONED_LIB lib${LIB_SUFFIX}/YARP-${YARP_GENERIC_VERSION})
set(VERSIONED_LIB lib${LIB_SUFFIX}/YARP-${YARP_VERSION})

# Set up a configuration file for installed use of YARP
set(YARP_DEPENDENCY_FILE ${CMAKE_INSTALL_PREFIX}/${VERSIONED_LIB}/YARP.cmake)
Expand All @@ -49,6 +56,6 @@ install(FILES ${CMAKE_BINARY_DIR}/YARPConfigVersion.cmake COMPONENT configuratio
install(EXPORT YARP COMPONENT configuration DESTINATION ${VERSIONED_LIB})

foreach(lib ${YARP_LIBRARIES})
set_target_properties(${lib} PROPERTIES VERSION ${YARP_GENERIC_VERSION}
set_target_properties(${lib} PROPERTIES VERSION ${YARP_VERSION}
SOVERSION ${YARP_GENERIC_SOVERSION})
endforeach(lib)
6 changes: 6 additions & 0 deletions conf/YarpPackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

set(CPACK_PACKAGE_VERSION_MAJOR "${YARP_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${YARP_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${YARP_VERSION_PATCH}")
#set(CPACK_PACKAGE_VERSION_TWEAK "${YARP_VERSION_TWEAK}")
set(CPACK_PACKAGE_VERSION "${YARP_VERSION}")


#if you are making debian packages, this is useful, but not otherwise
#configure_file(${YARP_MODULE_DIR}/template/control.in
Expand Down
35 changes: 16 additions & 19 deletions conf/YarpVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,28 @@

# This file is the official location of the current YARP version number.

## We use subversion to indentify current revision number (optional)
# the FindSubversion.cmake module is part of the standard distribution

# 29/8/12: Lorenzo Natale: Commenting out use of svn since it did not work with
# default installation of tortoise on Windows. Moving from YARP_SVN_REVISION to YARO_VERSION_TWEAK
# with similar usage.


## manually increase tweak number when required. Set to zero when
# bumping VERSION_PATCH
set(YARP_VERSION_MAJOR "2")
set(YARP_VERSION_MINOR "3")
set(YARP_VERSION_PATCH "20")
set(YARP_VERSION_MODIFIER "")
set(YARP_VERSION_TWEAK "")
set(YARP_VERSION_STRING "")

## manually increase tweak number when required. Set to zero when
# bumping VERSION_PATCH
set(YARP_VERSION_TWEAK "6")
set(YARP_VERSION_ABI "1")

set(CPACK_PACKAGE_VERSION_MAJOR "${YARP_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${YARP_VERSION_MINOR}")
if(NOT YARP_VERSION_TWEAK)
set(CPACK_PACKAGE_VERSION_PATCH "${YARP_VERSION_PATCH}${YARP_VERSION_MODIFIER}")
else(NOT YARP_VERSION_TWEAK)
set(CPACK_PACKAGE_VERSION_PATCH "${YARP_VERSION_PATCH}.${YARP_VERSION_TWEAK}${YARP_VERSION_MODIFIER}")
endif(NOT YARP_VERSION_TWEAK)
# Generate YARP_VERSION
if(YARP_VERSION_TWEAK)
set(YARP_VERSION "${YARP_VERSION_MAJOR}.${YARP_VERSION_MINOR}.${YARP_VERSION_PATCH}.${YARP_VERSION_TWEAK}")
else()
set(YARP_VERSION "${YARP_VERSION_MAJOR}.${YARP_VERSION_MINOR}.${YARP_VERSION_PATCH}")
endif()

# Generate YARP_VERSION_STRING if not set
set(YARP_VERSION_STRING "${YARP_VERSION}")
if(NOT YARP_VERSION_STRING)
set(YARP_VERSION_STRING "${YARP_VERSION}")
endif()

set(YARP_GENERIC_VERSION "${YARP_VERSION_MAJOR}.${YARP_VERSION_MINOR}.${YARP_VERSION_PATCH}")
set(YARP_GENERIC_SOVERSION "${YARP_VERSION_ABI}")
11 changes: 3 additions & 8 deletions conf/template/YARPConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,10 @@ if(NOT YARP_FOUND)
set(YARP_VERSION_MAJOR "@YARP_VERSION_MAJOR@")
set(YARP_VERSION_MINOR "@YARP_VERSION_MINOR@")
set(YARP_VERSION_PATCH "@YARP_VERSION_PATCH@")
set(YARP_VERSION_MODIFIER "@YARP_VERSION_MODIFIER@")
set(YARP_VERSION_ABI "@YARP_VERSION_ABI@")
set(YARP_VERSION_TWEAK "@YARP_VERSION_TWEAK@")

if(NOT YARP_VERSION_TWEAK)
set(YARP_VERSION "${YARP_VERSION_MAJOR}.${YARP_VERSION_MINOR}.${YARP_VERSION_PATCH}${YARP_VERSION_MODIFIER}")
else(NOT YARP_VERSION_TWEAK)
set(PACKAGE_VERSION "${YARP_VERSION_MAJOR}.${YARP_VERSION_MINOR}.${YARP_VERSION_PATCH}.${YARP_VERSION_TWEAK}${YARP_VERSION_MODIFIER}")
endif(NOT YARP_VERSION_TWEAK)
set(YARP_VERSION "@YARP_VERSION@")
set(YARP_VERSION_STRING "@YARP_VERSION_STRING@")
set(YARP_VERSION_ABI "@YARP_VERSION_ABI@")

# Pull in any dependencies that YARP libraries may have.
get_filename_component(YARP_CMAKE ${CMAKE_CURRENT_LIST_FILE} PATH)
Expand Down
62 changes: 0 additions & 62 deletions conf/template/YARPConfigVersion.cmake.in

This file was deleted.

26 changes: 3 additions & 23 deletions conf/template/yarp_config_version.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,15 @@
* CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
*/


#ifndef YARP_CONFIG_VERSION_H
#define YARP_CONFIG_VERSION_H

#ifdef YARP_VERSION_MAJOR
#undef YARP_VERSION_MAJOR
#endif
#ifdef YARP_VERSION_MINOR
#undef YARP_VERSION_MINOR
#endif
#ifdef YARP_VERSION_PATCH
#undef YARP_VERSION_PATCH
#endif
#ifdef YARP_VERSION_TWEAK
#undef YARP_VERSION_TWEAK
#endif
#ifdef YARP_VERSION
#undef YARP_VERSION
#endif

#define YARP_VERSION_MAJOR ${YARP_VERSION_MAJOR}
#define YARP_VERSION_MINOR ${YARP_VERSION_MINOR}
#define YARP_VERSION_PATCH ${YARP_VERSION_PATCH}
#define YARP_VERSION_TWEAK ${YARP_VERSION_TWEAK}
#define YARP_VERSION_MODIFIER "${YARP_VERSION_MODIFIER}"

#if ( YARP_VERSION_TWEAK > 0 )
#define YARP_VERSION "${YARP_VERSION_MAJOR}.${YARP_VERSION_MINOR}.${YARP_VERSION_PATCH}.${YARP_VERSION_TWEAK}${YARP_VERSION_MODIFIER}"
#else
#define YARP_VERSION "${YARP_VERSION_MAJOR}.${YARP_VERSION_MINOR}.${YARP_VERSION_PATCH}${YARP_VERSION_MODIFIER}"
#endif
#define YARP_VERSION "${YARP_VERSION}"
#define YARP_VERSION_STRING "${YARP_VERSION_STRING}"

#endif
2 changes: 1 addition & 1 deletion scripts/admin/make-source-package-svn
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if [ "k$1" = "k" ] ; then
PROJECT(test)
SET(CMAKE_MODULE_PATH \${PROJECT_SOURCE_DIR})
INCLUDE(YarpVersion)
MESSAGE(STATUS "Version is \${YARP_VERSION_MAJOR}.\${YARP_VERSION_MINOR}.\${YARP_VERSION_PATCH}\${YARP_VERSION_MODIFIER}")
MESSAGE(STATUS "Version is \${YARP_VERSION}")
EOF
) > CMakeLists.txt
YARP_VERSION=`cmake . | grep "Version is " | sed "s/.*Version is //"`
Expand Down
7 changes: 5 additions & 2 deletions src/doc/yarp_build_structure.dox
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,11 @@ YARP versioning is as follows:
\li YARP_VERSION_MAJOR - has only changed once or twice, ever.
\li YARP_VERSION_MINOR - changes perhaps once every year or two.
\li YARP_VERSION_PATCH - changes with every release.
\li YARP_VERSION_TWEAK - rarely used, changes with very small fixes.
\li YARP_VERSION_MODIFIER - rarely used, other than to signal unofficial release candidates.
\li YARP_VERSION_TWEAK - Used for bugfix releases, and in development branches
to pinpoint new features.
\li YARP_VERSION - The full version number (generated)
\li YARP_VERSION_STRING - A readable version (i.e. 2.4.0 beta1) (= YARP_VERSION
if not set explicitly))

@section yarp_build_structure_system_check conf/YarpSystemCheck.cmake

Expand Down

0 comments on commit 228b070

Please sign in to comment.