aboutsummaryrefslogtreecommitdiffstats
path: root/gr-utils
diff options
context:
space:
mode:
authorVolker Schroer <3470424+dl1ksv@users.noreply.github.com>2021-12-11 03:31:51 +0100
committerGitHub <noreply@github.com>2021-12-10 21:31:51 -0500
commit7976d7836a23c2a7a86f6d7af2c5d538eec1bcb1 (patch)
tree81ae3383adc38ce24965991892ba4fd2b932815a /gr-utils
parentruntime: configurable blkd_input timer (diff)
downloadgnuradio-7976d7836a23c2a7a86f6d7af2c5d538eec1bcb1.tar.xz
gnuradio-7976d7836a23c2a7a86f6d7af2c5d538eec1bcb1.zip
cmake: Maintain compiler settings at one point.
* cmake: Maintain compiler settings at one point. Signed-off-by: Volker Schroer <3470424+dl1ksv@users.noreply.github.com>
Diffstat (limited to 'gr-utils')
-rw-r--r--gr-utils/modtool/templates/gr-newmod/CMakeLists.txt40
1 files changed, 12 insertions, 28 deletions
diff --git a/gr-utils/modtool/templates/gr-newmod/CMakeLists.txt b/gr-utils/modtool/templates/gr-newmod/CMakeLists.txt
index 6295ccbe2..382467b06 100644
--- a/gr-utils/modtool/templates/gr-newmod/CMakeLists.txt
+++ b/gr-utils/modtool/templates/gr-newmod/CMakeLists.txt
@@ -28,6 +28,8 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
# Make sure our local CMake Modules path comes first
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules)
+# Find gnuradio to get access to the cmake modules
+find_package(Gnuradio "3.10" REQUIRED)
# Set the version information here
set(VERSION_MAJOR 1)
@@ -41,39 +43,20 @@ cmake_policy(SET CMP0011 NEW)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
########################################################################
-# Compiler specific setup
+# Minimum Version Requirements
########################################################################
-if((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
- CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- AND NOT WIN32)
- #http://gcc.gnu.org/wiki/Visibility
- add_definitions(-fvisibility=hidden)
-endif()
-IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- SET(CMAKE_CXX_STANDARD 17)
-ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- SET(CMAKE_CXX_STANDARD 17)
-ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- SET(CMAKE_CXX_STANDARD 17)
-ELSE()
- message(WARNING "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
-ENDIF()
-
-IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
- SET(CMAKE_C_STANDARD 11)
-ELSEIF(CMAKE_C_COMPILER_ID MATCHES "Clang")
- SET(CMAKE_C_STANDARD 11)
-ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
- SET(CMAKE_C_STANDARD 11)
-ELSE()
- message(WARNING "C standard could not be set because compiler is not GNU, Clang or MSVC.")
-ENDIF()
+include(GrMinReq)
+
+########################################################################
+# Compiler settings
+########################################################################
+
+include(GrCompilerSettings)
########################################################################
# Install directories
########################################################################
-find_package(Gnuradio "3.10" REQUIRED)
include(GrVersion)
include(GrPlatform) #define LIB_SUFFIX
@@ -164,4 +147,5 @@ configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/Modules/targetConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/Modules/${target}Config.cmake
INSTALL_DESTINATION ${GR_CMAKE_DIR}
-) \ No newline at end of file
+)
+