From d6ca2b0fc5e9f12fe8e8509ac7c334b947858591 Mon Sep 17 00:00:00 2001 From: Steve Markgraf Date: Mon, 2 Mar 2020 21:11:40 +0100 Subject: [PATCH] Fix for CMake < 3.12.0 As several current LTS distributions currently ship with CMake < 3.12.0, add a work-around for CMake Issue 16967. Otherwise we get: CMake Error at /usr/share/cmake-3.7/Modules/CheckCXXSourceCompiles.cmake:64 (try_compile): Unknown extension ".cxx" for file /tmp/rtl-sdr/build/CMakeFiles/CMakeTmp/src.cxx try_compile() works only for enabled languages. Currently these are: C --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 419908a..2def354 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,13 @@ # Project setup ######################################################################## cmake_minimum_required(VERSION 3.7.2) -project(rtlsdr C) + +# workaround for https://gitlab.kitware.com/cmake/cmake/issues/16967 +if(${CMAKE_VERSION} VERSION_LESS "3.12.0") + project(rtlsdr) +else() + project(rtlsdr C) +endif() #select the release build type by default to get optimization flags if(NOT CMAKE_BUILD_TYPE)