Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Asteborg <maastebo@microsoft.com>2020-06-25 07:25:57 +0300
committerRalph Giles <giles@thaumas.net>2020-08-08 20:10:51 +0300
commit8ad827c3ff99f08b4087cf47637c722020d3c958 (patch)
treebdeef23623c0289d6cc0e91256db277a7a6507c3 /CMakeLists.txt
parent5edb5aacba5c6941b66ef48002f47fbe1c3f39b7 (diff)
cmake - fix bugs around consuming Opus as a submodule in cmake and package version parsing
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 7 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 960692fd..6c45cda8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,23 +1,12 @@
cmake_minimum_required(VERSION 3.1)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
-include(OpusFunctions)
-
-get_library_version(OPUS_LIBRARY_VERSION OPUS_LIBRARY_VERSION_MAJOR)
-message(STATUS "Opus library version: ${OPUS_LIBRARY_VERSION}")
-
-get_package_version(PACKAGE_VERSION)
-message(STATUS "Opus package version: ${PACKAGE_VERSION}")
-
-string(REGEX
- REPLACE "^([0-9]+.[0-9]+\\.?([0-9]+)?).*"
- "\\1"
- PROJECT_VERSION
- ${PACKAGE_VERSION})
-message(STATUS "Opus project version: ${PROJECT_VERSION}")
+include(OpusPackageVersion)
+get_package_version(PACKAGE_VERSION PROJECT_VERSION)
project(Opus LANGUAGES C VERSION ${PROJECT_VERSION})
+include(OpusFunctions)
include(OpusBuildtype)
include(OpusConfig)
include(OpusSources)
@@ -228,6 +217,9 @@ endif()
add_library(opus ${opus_headers} ${opus_sources} ${opus_sources_float} ${Opus_PUBLIC_HEADER})
add_library(Opus::opus ALIAS opus)
+get_library_version(OPUS_LIBRARY_VERSION OPUS_LIBRARY_VERSION_MAJOR)
+message(STATUS "Opus library version: ${OPUS_LIBRARY_VERSION}")
+
set_target_properties(opus
PROPERTIES SOVERSION
${OPUS_LIBRARY_VERSION_MAJOR}
@@ -490,7 +482,7 @@ if(OPUS_INSTALL_CMAKE_CONFIG_MODULE)
include(CMakePackageConfigHelpers)
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
- configure_package_config_file(${CMAKE_SOURCE_DIR}/cmake/OpusConfig.cmake.in
+ configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/OpusConfig.cmake.in
OpusConfig.cmake
INSTALL_DESTINATION
${CMAKE_INSTALL_PACKAGEDIR}