aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Markgraf <steve@steve-m.de>2020-03-02 21:11:40 +0100
committerSteve Markgraf <steve@steve-m.de>2020-03-02 21:11:40 +0100
commitd6ca2b0fc5e9f12fe8e8509ac7c334b947858591 (patch)
treec106bfe63fa14ee99b96b1478bfee3b285483be8
parent3d7cdc5221d5c43794e6ca21a36df2c7003133ef (diff)
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
-rw-r--r--CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
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)