mirror of
https://github.com/steve-m/hsdaoh.git
synced 2025-12-10 07:44:41 +01:00
add missing cmakes files
This commit is contained in:
parent
656fc6f33f
commit
6f904d2fbb
2 changed files with 67 additions and 0 deletions
58
cmake/Modules/Version.cmake
Normal file
58
cmake/Modules/Version.cmake
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# Copyright 2013 OSMOCOM Project
|
||||
#
|
||||
# This file is part of hsdaoh
|
||||
#
|
||||
# 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
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
if(DEFINED __INCLUDED_VERSION_CMAKE)
|
||||
return()
|
||||
endif()
|
||||
set(__INCLUDED_VERSION_CMAKE TRUE)
|
||||
|
||||
# VERSION_INFO_* variables must be provided by user
|
||||
set(MAJOR_VERSION ${VERSION_INFO_MAJOR_VERSION})
|
||||
set(MINOR_VERSION ${VERSION_INFO_MINOR_VERSION})
|
||||
set(PATCH_VERSION ${VERSION_INFO_PATCH_VERSION})
|
||||
|
||||
########################################################################
|
||||
# Extract the version string from git describe.
|
||||
########################################################################
|
||||
find_package(Git QUIET)
|
||||
|
||||
if(GIT_FOUND)
|
||||
message(STATUS "Extracting version information from git describe...")
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=4 --long
|
||||
OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
else()
|
||||
set(GIT_DESCRIBE "v${MAJOR_VERSION}.${MINOR_VERSION}.x-xxx-xunknown")
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# Use the logic below to set the version constants
|
||||
########################################################################
|
||||
if("${PATCH_VERSION}" STREQUAL "git")
|
||||
# VERSION: 3.6git-xxx-gxxxxxxxx
|
||||
# LIBVER: 3.6git
|
||||
set(VERSION "${GIT_DESCRIBE}")
|
||||
set(LIBVER "${MAJOR_VERSION}.${MINOR_VERSION}${PATCH_VERSION}")
|
||||
else()
|
||||
# This is a numbered release.
|
||||
# VERSION: 3.6.1
|
||||
# LIBVER: 3.6.1
|
||||
set(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
|
||||
set(LIBVER "${VERSION}")
|
||||
endif()
|
||||
9
cmake/hsdaohConfig.cmake
Normal file
9
cmake/hsdaohConfig.cmake
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
include(FindPkgConfig)
|
||||
pkg_check_modules(LIBUSB libusb-1.0 IMPORTED_TARGET)
|
||||
pkg_check_modules(LIBUVC libuvc IMPORTED_TARGET)
|
||||
|
||||
get_filename_component(HSDAOH_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
|
||||
if(NOT TARGET hsdaoh::hsdaoh)
|
||||
include("${HSDAOH_CMAKE_DIR}/hsdaohTargets.cmake")
|
||||
endif()
|
||||
Loading…
Add table
Reference in a new issue