From 27cbbf8dc870fef2f1b041a99f52b50df77647c9 Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Thu, 27 Jun 2019 11:16:56 +0200 Subject: [PATCH] CMake: Set policies by version --- CMakeLists.txt | 5 ++--- cmake/FairLoggerLib.cmake | 21 +-------------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80298d2..4f0a961 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ ################################################################################ -# Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# Copyright (C) 2018-2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # # # # This software is distributed under the terms of the # # GNU Lesser General Public Licence (LGPL) version 3, # @@ -7,13 +7,12 @@ ################################################################################ cmake_minimum_required(VERSION 3.9.4 FATAL_ERROR) - +cmake_policy(VERSION 3.9...3.14) # Project ###################################################################### set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) include(FairLoggerLib) -set_fairlogger_cmake_policies() get_git_version(OUTVAR_PREFIX FairLogger) project(FairLogger VERSION ${FairLogger_VERSION} LANGUAGES C CXX) diff --git a/cmake/FairLoggerLib.cmake b/cmake/FairLoggerLib.cmake index d48d676..69b311e 100644 --- a/cmake/FairLoggerLib.cmake +++ b/cmake/FairLoggerLib.cmake @@ -1,5 +1,5 @@ ################################################################################ -# Copyright (C) 2018 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# Copyright (C) 2018-2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # # # # This software is distributed under the terms of the # # GNU Lesser General Public Licence (LGPL) version 3, # @@ -29,25 +29,6 @@ if(NOT WIN32 AND NOT DISABLE_COLOR) set(BWhite "${Esc}[1;37m") endif() -# set_fairlogger_cmake_policies() -# -# Sets CMake policies. -macro(set_fairlogger_cmake_policies) - # Find more details to each policy with cmake --help-policy CMPXXXX - foreach(policy - CMP0025 # Compiler id for Apple Clang is now AppleClang. - CMP0028 # Double colon in target name means ALIAS or IMPORTED target. - CMP0042 # MACOSX_RPATH is enabled by default. - CMP0048 # The ``project()`` command manages VERSION variables. - CMP0054 # Only interpret ``if()`` arguments as variables or keywords when unquoted. - ) - if(POLICY ${policy}) - cmake_policy(SET ${policy} NEW) - endif() - endforeach() -endmacro() - - find_package(Git) # get_git_version([DEFAULT_VERSION version] [DEFAULT_DATE date] [OUTVAR_PREFIX prefix]) #