cmake - add include guards to cmake files

Signed-off-by: Mark Harris <mark.hsj@gmail.com>
This commit is contained in:
Marcus Asteborg 2020-04-22 22:42:18 -07:00 committed by Mark Harris
parent 48055ccc23
commit d00d866e8c
No known key found for this signature in database
GPG key ID: 92293B4D0118BDB0
4 changed files with 18 additions and 5 deletions

View file

@ -1,4 +1,8 @@
# Set a default build type if none was specified # Set a default build type if none was specified
if(__opus_buildtype)
return()
endif()
set(__opus_buildtype INCLUDED)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
if(CMAKE_C_FLAGS) if(CMAKE_C_FLAGS)

View file

@ -1,3 +1,8 @@
if(__opus_config)
return()
endif()
set(__opus_config INCLUDED)
include(OpusFunctions) include(OpusFunctions)
configure_file(${CMAKE_SOURCE_DIR}/cmake/config.h.cmake.in config.h @ONLY) configure_file(${CMAKE_SOURCE_DIR}/cmake/config.h.cmake.in config.h @ONLY)

View file

@ -1,8 +1,7 @@
#[[Cmake helper function to parse source files from make files if(__opus_functions)
this is to avoid breaking existing make and auto make support return()
but still have the option to use CMake with only lists at one place]] endif()
set(__opus_functions INCLUDED)
cmake_minimum_required(VERSION 3.1)
function(get_library_version OPUS_LIBRARY_VERSION OPUS_LIBRARY_VERSION_MAJOR) function(get_library_version OPUS_LIBRARY_VERSION OPUS_LIBRARY_VERSION_MAJOR)
file(STRINGS configure.ac opus_lt_current_string file(STRINGS configure.ac opus_lt_current_string

View file

@ -1,3 +1,8 @@
if(__opus_sources)
return()
endif()
set(__opus_sources INCLUDED)
include(OpusFunctions) include(OpusFunctions)
get_opus_sources(SILK_HEAD silk_headers.mk silk_headers) get_opus_sources(SILK_HEAD silk_headers.mk silk_headers)