From accb9f2fe8fd8f6a1e114adac5b15304b0e0012d Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 20 Jul 2011 19:04:32 -0700 Subject: gr: squashed cmakelists.txt into one commit --- cmake/Modules/GrVersion.cmake | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 cmake/Modules/GrVersion.cmake (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake new file mode 100644 index 000000000..556495336 --- /dev/null +++ b/cmake/Modules/GrVersion.cmake @@ -0,0 +1,60 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +IF(NOT DEFINED INCLUDED_GR_VERSION_CMAKE) +SET(INCLUDED_GR_VERSION_CMAKE TRUE) + +######################################################################## +# Setup version variables. +# Parse the output of git describe +# sets VERSION and LIBVER +######################################################################## + +FIND_PACKAGE(Git) +IF(GIT_FOUND) + MESSAGE(STATUS "Extracting version information from git...") + EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe + OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + IF(NOT VERSION) + MESSAGE(WARNING "Tried to extract $VERSION from git describe but failed... using default") + ENDIF() + + INCLUDE(GrPython) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import re; print re.match('^v(\\d+\\.\\d+\\.\\d+)', '${VERSION}').groups()[0]" + OUTPUT_VARIABLE LIBVER OUTPUT_STRIP_TRAILING_WHITESPACE + ) + IF(NOT LIBVER) + MESSAGE(WARNING "Tried to extract $LIBVER from $VERSION but failed... using default") + ENDIF() +ENDIF(GIT_FOUND) + +#ensure that the version strings are set no matter what +IF(NOT VERSION) + SET(VERSION "v3.x.x-unknown") +ENDIF() + +IF(NOT LIBVER) + SET(LIBVER "3.x.x") +ENDIF() + +MESSAGE(STATUS "VERSION: ${VERSION}, LIBVER: ${LIBVER}") + +ENDIF(NOT DEFINED INCLUDED_GR_VERSION_CMAKE) -- cgit From bed68a6d8545b9b24f3933fc4c6f792de34939c2 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 24 Jul 2011 12:53:32 -0700 Subject: cmake: changed module include guards to model after builtin cmake modules --- cmake/Modules/GrVersion.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 556495336..05a4250f4 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -17,8 +17,10 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(NOT DEFINED INCLUDED_GR_VERSION_CMAKE) -SET(INCLUDED_GR_VERSION_CMAKE TRUE) +IF(DEFINED __INCLUDED_GR_VERSION_CMAKE) + RETURN() +ENDIF() +SET(__INCLUDED_GR_VERSION_CMAKE TRUE) ######################################################################## # Setup version variables. @@ -56,5 +58,3 @@ IF(NOT LIBVER) ENDIF() MESSAGE(STATUS "VERSION: ${VERSION}, LIBVER: ${LIBVER}") - -ENDIF(NOT DEFINED INCLUDED_GR_VERSION_CMAKE) -- cgit From 152db0ca6a8771ab4c95a6d4410ca749085ec157 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 28 Jul 2011 09:55:06 -0700 Subject: cmake: be a little more robust when checking source code version --- cmake/Modules/GrVersion.cmake | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 05a4250f4..ab2959c0d 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -28,6 +28,12 @@ SET(__INCLUDED_GR_VERSION_CMAKE TRUE) # sets VERSION and LIBVER ######################################################################## +UNSET(VERSION) +UNSET(LIBVER) + +######################################################################## +# Extract the version string from git describe. +######################################################################## FIND_PACKAGE(Git) IF(GIT_FOUND) MESSAGE(STATUS "Extracting version information from git...") @@ -38,7 +44,12 @@ IF(GIT_FOUND) IF(NOT VERSION) MESSAGE(WARNING "Tried to extract $VERSION from git describe but failed... using default") ENDIF() +ENDIF(GIT_FOUND) +######################################################################## +# Extract the library version from the version string. +######################################################################## +IF(VERSION) INCLUDE(GrPython) EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import re; print re.match('^v(\\d+\\.\\d+\\.\\d+)', '${VERSION}').groups()[0]" OUTPUT_VARIABLE LIBVER OUTPUT_STRIP_TRAILING_WHITESPACE @@ -46,9 +57,11 @@ IF(GIT_FOUND) IF(NOT LIBVER) MESSAGE(WARNING "Tried to extract $LIBVER from $VERSION but failed... using default") ENDIF() -ENDIF(GIT_FOUND) +ENDIF() -#ensure that the version strings are set no matter what +######################################################################## +# Ensure that the version strings are set no matter what. +######################################################################## IF(NOT VERSION) SET(VERSION "v3.x.x-unknown") ENDIF() -- cgit From 71c0f14a46f85027b95f2f5f6d3d219cc9e3783e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 8 Oct 2011 17:11:12 -0700 Subject: gr: the CMakeLists.txt took a chill pill --- cmake/Modules/GrVersion.cmake | 56 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index ab2959c0d..842537f18 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -17,10 +17,10 @@ # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -IF(DEFINED __INCLUDED_GR_VERSION_CMAKE) - RETURN() -ENDIF() -SET(__INCLUDED_GR_VERSION_CMAKE TRUE) +if(DEFINED __INCLUDED_GR_VERSION_CMAKE) + return() +endif() +set(__INCLUDED_GR_VERSION_CMAKE TRUE) ######################################################################## # Setup version variables. @@ -28,46 +28,46 @@ SET(__INCLUDED_GR_VERSION_CMAKE TRUE) # sets VERSION and LIBVER ######################################################################## -UNSET(VERSION) -UNSET(LIBVER) +unset(VERSION) +unset(LIBVER) ######################################################################## # Extract the version string from git describe. ######################################################################## -FIND_PACKAGE(Git) -IF(GIT_FOUND) - MESSAGE(STATUS "Extracting version information from git...") - EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe +find_package(Git) +if(GIT_FOUND) + message(STATUS "Extracting version information from git...") + execute_process(COMMAND ${GIT_EXECUTABLE} describe OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) - IF(NOT VERSION) - MESSAGE(WARNING "Tried to extract $VERSION from git describe but failed... using default") - ENDIF() -ENDIF(GIT_FOUND) + if(NOT VERSION) + message(WARNING "Tried to extract $VERSION from git describe but failed... using default") + endif() +endif(GIT_FOUND) ######################################################################## # Extract the library version from the version string. ######################################################################## -IF(VERSION) - INCLUDE(GrPython) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import re; print re.match('^v(\\d+\\.\\d+\\.\\d+)', '${VERSION}').groups()[0]" +if(VERSION) + include(GrPython) + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re; print re.match('^v(\\d+\\.\\d+\\.\\d+)', '${VERSION}').groups()[0]" OUTPUT_VARIABLE LIBVER OUTPUT_STRIP_TRAILING_WHITESPACE ) - IF(NOT LIBVER) - MESSAGE(WARNING "Tried to extract $LIBVER from $VERSION but failed... using default") - ENDIF() -ENDIF() + if(NOT LIBVER) + message(WARNING "Tried to extract $LIBVER from $VERSION but failed... using default") + endif() +endif() ######################################################################## # Ensure that the version strings are set no matter what. ######################################################################## -IF(NOT VERSION) - SET(VERSION "v3.x.x-unknown") -ENDIF() +if(NOT VERSION) + set(VERSION "v3.x.x-unknown") +endif() -IF(NOT LIBVER) - SET(LIBVER "3.x.x") -ENDIF() +if(NOT LIBVER) + set(LIBVER "3.x.x") +endif() -MESSAGE(STATUS "VERSION: ${VERSION}, LIBVER: ${LIBVER}") +message(STATUS "VERSION: ${VERSION}, LIBVER: ${LIBVER}") -- cgit From 1c95e89b0eafe063770ff98ee09f566843d1a68c Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 18:58:05 -0700 Subject: cmake: parse the version.sh and git describe to model the m4 files --- cmake/Modules/GrVersion.cmake | 88 +++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 29 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 842537f18..79aa3e4b0 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -23,51 +23,81 @@ endif() set(__INCLUDED_GR_VERSION_CMAKE TRUE) ######################################################################## -# Setup version variables. -# Parse the output of git describe -# sets VERSION and LIBVER +# Extract variables from version.sh ######################################################################## +message(STATUS "Extracting version information from version.sh...") +execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "print open('${CMAKE_SOURCE_DIR}/version.sh').read().replace('=', ';').replace('\\n', ';')" + OUTPUT_VARIABLE VERSION_INFO OUTPUT_STRIP_TRAILING_WHITESPACE +) +include(CMakeParseArgumentsCopy) +CMAKE_PARSE_ARGUMENTS(VERSION_INFO "" "MAJOR_VERSION;API_COMPAT;MINOR_VERSION;MAINT_VERSION" "" ${VERSION_INFO}) -unset(VERSION) -unset(LIBVER) +#eventually, replace version.sh and fill in the variables below +set(MAJOR_VERSION ${VERSION_INFO_MAJOR_VERSION}) +set(API_COMPAT ${VERSION_INFO_API_COMPAT}) +set(MINOR_VERSION ${VERSION_INFO_MINOR_VERSION}) +set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION}) ######################################################################## # Extract the version string from git describe. ######################################################################## find_package(Git) + +unset(GIT_DESCRIBE) + if(GIT_FOUND) - message(STATUS "Extracting version information from git...") - execute_process(COMMAND ${GIT_EXECUTABLE} describe - OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE + message(STATUS "Extracting version information from git describe...") + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 + OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) - if(NOT VERSION) - message(WARNING "Tried to extract $VERSION from git describe but failed... using default") - endif() endif(GIT_FOUND) ######################################################################## -# Extract the library version from the version string. +# Parse the git describe string (currently unused) ######################################################################## -if(VERSION) - include(GrPython) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re; print re.match('^v(\\d+\\.\\d+\\.\\d+)', '${VERSION}').groups()[0]" - OUTPUT_VARIABLE LIBVER OUTPUT_STRIP_TRAILING_WHITESPACE +unset(GIT_TAG) +unset(GIT_SEQNO) +unset(GIT_COMMIT) + +if(GIT_DESCRIBE) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} -c + "import re; print ';'.join(re.match('^v(.*)-(.*)-g(.*)$', '${GIT_DESCRIBE}').groups())" + OUTPUT_VARIABLE GIT_DESCRIBES OUTPUT_STRIP_TRAILING_WHITESPACE ) - if(NOT LIBVER) - message(WARNING "Tried to extract $LIBVER from $VERSION but failed... using default") - endif() -endif() + list(GET GIT_DESCRIBES 0 GIT_TAG) + list(GET GIT_DESCRIBES 1 GIT_SEQNO) + list(GET GIT_DESCRIBES 2 GIT_COMMIT) +endif(GIT_DESCRIBE) ######################################################################## -# Ensure that the version strings are set no matter what. +# Use the logic below to set the version constants ######################################################################## -if(NOT VERSION) - set(VERSION "v3.x.x-unknown") -endif() - -if(NOT LIBVER) - set(LIBVER "3.x.x") +if("${MINOR_VERSION}" STREQUAL "git") + # VERSION: 3.3git-xxx-gxxxxxxxx + # DOCVER: 3.3git + # LIBVER: 3.3git + set(VERSION "${GIT_DESCRIBE}") + set(DOCVER "${MAJOR_VERSION}.${API_COMPAT}${MINOR_VERSION}") + set(LIBVER "${MAJOR_VERSION}.${API_COMPAT}${MINOR_VERSION}") +elseif("${MAINT_VERSION}" STREQUAL "git") + # VERSION: 3.3.1git-xxx-gxxxxxxxx + # DOCVER: 3.3.1git + # LIBVER: 3.3.1git + set(VERSION "${GIT_DESCRIBE}") + set(DOCVER "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}${MAINT_VERSION}") + set(LIBVER "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}${MAINT_VERSION}") +else() + # This is a numbered release. + # VERSION: 3.3.1{.x} + # DOCVER: 3.3.1{.x} + # LIBVER: 3.3.1{.x} + set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}") + if("${MAINT_VERSION}" NOT STREQUAL "0") + set(VERSION "${VERSION}.${MAINT_VERSION}") + endif() + set(DOCVER "${VERSION}") + set(LIBVER "${VERSION}") endif() - -message(STATUS "VERSION: ${VERSION}, LIBVER: ${LIBVER}") -- cgit From e44d194f944aa0a66a543286a36fa05c34c4db3e Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 20 Oct 2011 19:49:00 -0700 Subject: cmake: more tweaks for version extraction when git not found --- cmake/Modules/GrVersion.cmake | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 79aa3e4b0..16338f143 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -25,6 +25,7 @@ set(__INCLUDED_GR_VERSION_CMAKE TRUE) ######################################################################## # Extract variables from version.sh ######################################################################## +include(GrPython) message(STATUS "Extracting version information from version.sh...") execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "print open('${CMAKE_SOURCE_DIR}/version.sh').read().replace('=', ';').replace('\\n', ';')" OUTPUT_VARIABLE VERSION_INFO OUTPUT_STRIP_TRAILING_WHITESPACE @@ -43,16 +44,16 @@ set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION}) ######################################################################## find_package(Git) -unset(GIT_DESCRIBE) - -if(GIT_FOUND) +if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) message(STATUS "Extracting version information from git describe...") execute_process( COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) -endif(GIT_FOUND) +else() + set(GIT_DESCRIBE "v${MAJOR_VERSION}.${API_COMPAT}.x-xxx-xunknown") +endif() ######################################################################## # Parse the git describe string (currently unused) @@ -64,7 +65,7 @@ unset(GIT_COMMIT) if(GIT_DESCRIBE) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c - "import re; print ';'.join(re.match('^v(.*)-(.*)-g(.*)$', '${GIT_DESCRIBE}').groups())" + "import re; print ';'.join(re.match('^v(.*)-(.*)-\\w(.*)$', '${GIT_DESCRIBE}').groups())" OUTPUT_VARIABLE GIT_DESCRIBES OUTPUT_STRIP_TRAILING_WHITESPACE ) list(GET GIT_DESCRIBES 0 GIT_TAG) @@ -94,9 +95,10 @@ else() # VERSION: 3.3.1{.x} # DOCVER: 3.3.1{.x} # LIBVER: 3.3.1{.x} - set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}") - if("${MAINT_VERSION}" NOT STREQUAL "0") - set(VERSION "${VERSION}.${MAINT_VERSION}") + if("${MAINT_VERSION}" STREQUAL "0") + set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}") + else() + set(VERSION "${MAJOR_VERSION}.${API_COMPAT}.${MINOR_VERSION}.${MAINT_VERSION}") endif() set(DOCVER "${VERSION}") set(LIBVER "${VERSION}") -- cgit From 27fb36ed7b07b5055b47ae5509235acf816094e3 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 23 Oct 2011 10:59:22 -0700 Subject: cmake: removed problematic/unused parsing of git describe It became problematic when the git describe output changed to only have the first term before the dash: no rev count or hash. The parsing was copied from gr_git.m4. The result is not used so its ok to remove. --- cmake/Modules/GrVersion.cmake | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 16338f143..7baa8eabb 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -55,24 +55,6 @@ else() set(GIT_DESCRIBE "v${MAJOR_VERSION}.${API_COMPAT}.x-xxx-xunknown") endif() -######################################################################## -# Parse the git describe string (currently unused) -######################################################################## -unset(GIT_TAG) -unset(GIT_SEQNO) -unset(GIT_COMMIT) - -if(GIT_DESCRIBE) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} -c - "import re; print ';'.join(re.match('^v(.*)-(.*)-\\w(.*)$', '${GIT_DESCRIBE}').groups())" - OUTPUT_VARIABLE GIT_DESCRIBES OUTPUT_STRIP_TRAILING_WHITESPACE - ) - list(GET GIT_DESCRIBES 0 GIT_TAG) - list(GET GIT_DESCRIBES 1 GIT_SEQNO) - list(GET GIT_DESCRIBES 2 GIT_COMMIT) -endif(GIT_DESCRIBE) - ######################################################################## # Use the logic below to set the version constants ######################################################################## -- cgit From 7112e308a6b0b84387c73460c4c8d1e8ff9f3b5a Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 23 Oct 2011 17:12:32 -0400 Subject: core: Added type conversion int->float (issue #192). Added with a gri file and also added a gri file for float->int to perform function inside gr_float_to_int. Also added QA code for the new block. --- cmake/Modules/GrVersion.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 16338f143..ed8fabddd 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -44,16 +44,16 @@ set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION}) ######################################################################## find_package(Git) -if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) - message(STATUS "Extracting version information from git describe...") - execute_process( - COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 - OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - ) -else() - set(GIT_DESCRIBE "v${MAJOR_VERSION}.${API_COMPAT}.x-xxx-xunknown") -endif() +#if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) +# message(STATUS "Extracting version information from git describe...") +# execute_process( +# COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 +# OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE +# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} +# ) +#else() +# set(GIT_DESCRIBE "v${MAJOR_VERSION}.${API_COMPAT}.x-xxx-xunknown") +#endif() ######################################################################## # Parse the git describe string (currently unused) -- cgit From 428c7f36bd1eaa88c3e61a99dd7f2a2c84409f28 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 24 Oct 2011 15:46:03 -0700 Subject: cmake: restored extraction of git describe why was this removed? --- cmake/Modules/GrVersion.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 666c6f126..7baa8eabb 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -44,16 +44,16 @@ set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION}) ######################################################################## find_package(Git) -#if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) -# message(STATUS "Extracting version information from git describe...") -# execute_process( -# COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 -# OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE -# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} -# ) -#else() -# set(GIT_DESCRIBE "v${MAJOR_VERSION}.${API_COMPAT}.x-xxx-xunknown") -#endif() +if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) + message(STATUS "Extracting version information from git describe...") + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 + OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) +else() + set(GIT_DESCRIBE "v${MAJOR_VERSION}.${API_COMPAT}.x-xxx-xunknown") +endif() ######################################################################## # Use the logic below to set the version constants -- cgit From bea71c727e74f35c97880c97d2ff7cd5ff08ead0 Mon Sep 17 00:00:00 2001 From: Timo Juhani Lindfors Date: Wed, 7 Dec 2011 15:07:51 -0800 Subject: cmake: fix git describe special case handling --- cmake/Modules/GrVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 7baa8eabb..7aa13f556 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -47,7 +47,7 @@ find_package(Git) if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) message(STATUS "Extracting version information from git describe...") execute_process( - COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 + COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 --long OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) -- cgit From f2ed379e1fe27096bdfc62ae715d870bcde9a5d1 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 1 Apr 2012 11:19:28 -0400 Subject: cmake: remove version.sh since we don't need it for autotools. Set version info in CMakeLists.txt. --- cmake/Modules/GrVersion.cmake | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index 7aa13f556..f82246525 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -22,17 +22,6 @@ if(DEFINED __INCLUDED_GR_VERSION_CMAKE) endif() set(__INCLUDED_GR_VERSION_CMAKE TRUE) -######################################################################## -# Extract variables from version.sh -######################################################################## -include(GrPython) -message(STATUS "Extracting version information from version.sh...") -execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "print open('${CMAKE_SOURCE_DIR}/version.sh').read().replace('=', ';').replace('\\n', ';')" - OUTPUT_VARIABLE VERSION_INFO OUTPUT_STRIP_TRAILING_WHITESPACE -) -include(CMakeParseArgumentsCopy) -CMAKE_PARSE_ARGUMENTS(VERSION_INFO "" "MAJOR_VERSION;API_COMPAT;MINOR_VERSION;MAINT_VERSION" "" ${VERSION_INFO}) - #eventually, replace version.sh and fill in the variables below set(MAJOR_VERSION ${VERSION_INFO_MAJOR_VERSION}) set(API_COMPAT ${VERSION_INFO_API_COMPAT}) -- cgit From f919f9dcbb54a08e6e26d6c229ce92fb784fa1b2 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 13 Apr 2012 18:36:53 -0400 Subject: Removed whitespace and added dtools/bin/remove-whitespace as a tool to do this in the future. The sed script was provided by Moritz Fischer. --- cmake/Modules/GrVersion.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmake/Modules/GrVersion.cmake') diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake index f82246525..9199a702b 100644 --- a/cmake/Modules/GrVersion.cmake +++ b/cmake/Modules/GrVersion.cmake @@ -1,17 +1,17 @@ # Copyright 2011 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, -- cgit