set CMake policy CMP0075 if it exists

Otherwise newer versions of CMake are throwing a warning.
This commit is contained in:
Steve Markgraf 2020-01-19 16:56:51 +01:00
parent b5af355b1d
commit be2e4f899a

View File

@ -1,21 +1,19 @@
# Copyright 2012 OSMOCOM Project # Copyright 2012-2020 Osmocom Project
# #
# This file is part of rtl-sdr # This file is part of rtl-sdr
# #
# GNU Radio is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option) # the Free Software Foundation, either version 2 of the License, or
# any later version. # (at your option) any later version.
# #
# GNU Radio is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to # along with this program. If not, see <http://www.gnu.org/licenses/>.
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
######################################################################## ########################################################################
@ -24,6 +22,11 @@
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
project(rtlsdr C) project(rtlsdr C)
# CMP0075 Include file check macros honor CMAKE_REQUIRED_LIBRARIES
if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif()
#select the release build type by default to get optimization flags #select the release build type by default to get optimization flags
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")