Skip to content

Commit cdb0aa2

Browse files
kresanMohammadAlTurany
authored andcommitted
Add separate cmake module for policies
1 parent efca5c8 commit cdb0aa2

File tree

3 files changed

+30
-21
lines changed

3 files changed

+30
-21
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,16 @@ If(NOT _HAS_CXX11_FLAG)
6262
Message(FATAL_ERROR "The used C++ compiler (${CMAKE_CXX_COMPILER}) does not support C++11. CbmRoot can only be compiled with compilers supporting C++11. Please install such a compiler.")
6363
EndIf()
6464

65+
# set cmake policies
66+
include(FairRootCmakePolicies)
67+
set_fairroot_cmake_policies()
68+
6569
# Load some basic macros which are needed later on
6670
include(FairMacros)
6771
include(WriteConfigFile)
6872
include(Dart)
6973
include(CheckCompiler)
7074

71-
# set cmake policies
72-
set_fairroot_cmake_policies()
73-
7475
#Check the compiler and set the compile and link flags
7576
Check_Compiler()
7677

cmake/modules/FairMacros.cmake

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,6 @@ ENDMACRO()
6666
set(BWhite "${Esc}[1;37m")
6767
endif()
6868

69-
################################################################################
70-
#Sets CMake policies.
71-
MACRO(set_fairroot_cmake_policies)
72-
#Find more details to each policy with cmake-- help - policy CMPXXXX
73-
foreach(policy
74-
CMP0025 # Compiler id for Apple Clang is now AppleClang.
75-
CMP0028 # Double colon in target name means ALIAS or IMPORTED target.
76-
CMP0042 # MACOSX_RPATH is enabled by default.
77-
CMP0048 # The ``project()`` command manages VERSION variables.
78-
CMP0054 # Only interpret ``if()`` arguments as variables or keywords when unquoted.
79-
CMP0074 # searches prefixes specified by the <PackageName>_ROOT
80-
)
81-
if(POLICY ${policy})
82-
cmake_policy(SET ${policy} NEW)
83-
endif()
84-
endforeach()
85-
ENDMACRO()
86-
8769
################################################################################
8870
MACRO(SUBDIRLIST result curdir)
8971
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
################################################################################
2+
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
3+
# #
4+
# This software is distributed under the terms of the #
5+
# GNU Lesser General Public Licence (LGPL) version 3, #
6+
# copied verbatim in the file "LICENSE" #
7+
################################################################################
8+
9+
################################################################################
10+
#Sets CMake policies.
11+
MACRO(set_fairroot_cmake_policies)
12+
#Find more details to each policy with cmake-- help - policy CMPXXXX
13+
foreach(policy
14+
CMP0025 # Compiler id for Apple Clang is now AppleClang.
15+
CMP0028 # Double colon in target name means ALIAS or IMPORTED target.
16+
CMP0042 # MACOSX_RPATH is enabled by default.
17+
CMP0048 # The ``project()`` command manages VERSION variables.
18+
CMP0054 # Only interpret ``if()`` arguments as variables or keywords when unquoted.
19+
CMP0074 # searches prefixes specified by the <PackageName>_ROOT
20+
)
21+
if(POLICY ${policy})
22+
cmake_policy(SET ${policy} NEW)
23+
endif()
24+
endforeach()
25+
ENDMACRO()
26+

0 commit comments

Comments
 (0)