diff options
Diffstat (limited to 'host/Modules')
-rw-r--r-- | host/Modules/FindDocutils.cmake | 2 | ||||
-rw-r--r-- | host/Modules/FindGit.cmake | 46 | ||||
-rw-r--r-- | host/Modules/UHDComponent.cmake | 27 | ||||
-rw-r--r-- | host/Modules/UHDVersion.cmake | 6 |
4 files changed, 59 insertions, 22 deletions
diff --git a/host/Modules/FindDocutils.cmake b/host/Modules/FindDocutils.cmake index b9996f3f1..3a97d8643 100644 --- a/host/Modules/FindDocutils.cmake +++ b/host/Modules/FindDocutils.cmake @@ -1,5 +1,5 @@ # -# Copyright 2010 Ettus Research LLC +# Copyright 2011-2011 Ettus Research LLC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/host/Modules/FindGit.cmake b/host/Modules/FindGit.cmake new file mode 100644 index 000000000..2d8214287 --- /dev/null +++ b/host/Modules/FindGit.cmake @@ -0,0 +1,46 @@ +# The module defines the following variables: +# GIT_EXECUTABLE - path to git command line client +# GIT_FOUND - true if the command line client was found +# Example usage: +# find_package(Git) +# if(GIT_FOUND) +# message("git found: ${GIT_EXECUTABLE}") +# endif() + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distributed this file outside of CMake, substitute the full +# License text for the above reference.) + +# Look for 'git' or 'eg' (easy git) +# +set(git_names git eg) + +# Prefer .cmd variants on Windows unless running in a Makefile +# in the MSYS shell. +# +if(WIN32) + if(NOT CMAKE_GENERATOR MATCHES "MSYS") + set(git_names git.cmd git eg.cmd eg) + endif() +endif() + +find_program(GIT_EXECUTABLE + NAMES ${git_names} + DOC "git command line client" + ) +mark_as_advanced(GIT_EXECUTABLE) + +# Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if +# all listed variables are TRUE + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Git DEFAULT_MSG GIT_EXECUTABLE) diff --git a/host/Modules/UHDComponent.cmake b/host/Modules/UHDComponent.cmake index 0263b071f..4ea55bbb9 100644 --- a/host/Modules/UHDComponent.cmake +++ b/host/Modules/UHDComponent.cmake @@ -27,27 +27,17 @@ SET(_uhd_disabled_components "" CACHE INTERNAL "" FORCE) # - deps a list of dependencies # - dis the default disable setting ######################################################################## -FUNCTION(LIBUHD_REGISTER_COMPONENT name var enb deps dis) - INCLUDE(CMakeDependentOption) +MACRO(LIBUHD_REGISTER_COMPONENT name var enb deps dis) MESSAGE(STATUS "") MESSAGE(STATUS "Configuring ${name} support...") - IF(DEFINED ${var}) - MESSAGE(STATUS "${name} support configured ${var}=${${var}}") - ELSE(DEFINED ${var}) #not defined: automatic enabling of component - MESSAGE(STATUS "${name} support configured automatically") - ENDIF(DEFINED ${var}) + FOREACH(dep ${deps}) + MESSAGE(STATUS " Dependency ${dep} = ${${dep}}") + ENDFOREACH(dep) #setup the dependent option for this component + INCLUDE(CMakeDependentOption) CMAKE_DEPENDENT_OPTION(${var} "enable ${name} support" ${enb} "${deps}" ${dis}) - #remove previous occurrence of component in either list - IF(DEFINED _uhd_enabled_components) - LIST(REMOVE_ITEM _uhd_enabled_components ${name}) - ENDIF(DEFINED _uhd_enabled_components) - IF(DEFINED _uhd_disabled_components) - LIST(REMOVE_ITEM _uhd_disabled_components ${name}) - ENDIF(DEFINED _uhd_disabled_components) - #append the component into one of the lists IF(${var}) MESSAGE(STATUS " Enabling ${name} support.") @@ -56,11 +46,12 @@ FUNCTION(LIBUHD_REGISTER_COMPONENT name var enb deps dis) MESSAGE(STATUS " Disabling ${name} support.") LIST(APPEND _uhd_disabled_components ${name}) ENDIF(${var}) + MESSAGE(STATUS " Override with -D${var}=ON/OFF") #make components lists into global variables SET(_uhd_enabled_components ${_uhd_enabled_components} CACHE INTERNAL "" FORCE) SET(_uhd_disabled_components ${_uhd_disabled_components} CACHE INTERNAL "" FORCE) -ENDFUNCTION(LIBUHD_REGISTER_COMPONENT) +ENDMACRO(LIBUHD_REGISTER_COMPONENT) ######################################################################## # Print the registered component summary @@ -68,7 +59,7 @@ ENDFUNCTION(LIBUHD_REGISTER_COMPONENT) FUNCTION(UHD_PRINT_COMPONENT_SUMMARY) MESSAGE(STATUS "") MESSAGE(STATUS "######################################################") - MESSAGE(STATUS "# LibUHD enabled components ") + MESSAGE(STATUS "# UHD enabled components ") MESSAGE(STATUS "######################################################") FOREACH(comp ${_uhd_enabled_components}) MESSAGE(STATUS " * ${comp}") @@ -76,7 +67,7 @@ FUNCTION(UHD_PRINT_COMPONENT_SUMMARY) MESSAGE(STATUS "") MESSAGE(STATUS "######################################################") - MESSAGE(STATUS "# LibUHD disabled components ") + MESSAGE(STATUS "# UHD disabled components ") MESSAGE(STATUS "######################################################") FOREACH(comp ${_uhd_disabled_components}) MESSAGE(STATUS " * ${comp}") diff --git a/host/Modules/UHDVersion.cmake b/host/Modules/UHDVersion.cmake index 4bd740185..c22286d59 100644 --- a/host/Modules/UHDVersion.cmake +++ b/host/Modules/UHDVersion.cmake @@ -1,5 +1,5 @@ # -# Copyright 2010 Ettus Research LLC +# Copyright 2010-2011 Ettus Research LLC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ INCLUDE(UHDPython) #requires python for parsing ######################################################################## # Setup Version Numbers ######################################################################## -SET(UHD_VERSION_MAJOR 0001) #API compatibility number +SET(UHD_VERSION_MAJOR 002) #API compatibility number SET(UHD_VERSION_MINOR 0) #Timestamp of git commit SET(UHD_VERSION_PATCH 0) #Short hash of git commit @@ -34,7 +34,7 @@ IF(GIT_FOUND) #grab the git log entry for the current head EXECUTE_PROCESS( WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND ${GIT_EXECUTABLE} log HEAD~..HEAD --date=raw + COMMAND ${GIT_EXECUTABLE} log HEAD~..HEAD --date=raw -n1 OUTPUT_VARIABLE _git_log OUTPUT_STRIP_TRAILING_WHITESPACE ) |