summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-05-07 11:14:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-05-10 11:19:22 +0200
commitae2ced1284d3364c3f061044de377cfc624ca02e (patch)
tree01d25a03f5f78267a7923cd922fa54575d298482 /cmake
parentf8b3c341164fdb336eea43a820af814cff5b6485 (diff)
cmake: fix var expansion for older cmake versions
Diffstat (limited to 'cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake2
-rw-r--r--cmake/opentrack-policy.cmake32
2 files changed, 6 insertions, 28 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 7a88e6ef..35ef1d22 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -88,7 +88,7 @@ function(otr_compat target)
if(CMAKE_COMPILER_IS_GNUCXX)
set(c-props "-fvisibility=hidden")
- if(NOT linker-lang STREQUAL "C")
+ if(NOT ".${linker-lang}" STREQUAL ".C")
set(c-props "${c-props} -fuse-cxa-atexit")
endif()
endif()
diff --git a/cmake/opentrack-policy.cmake b/cmake/opentrack-policy.cmake
index 2d88e218..7ded20f7 100644
--- a/cmake/opentrack-policy.cmake
+++ b/cmake/opentrack-policy.cmake
@@ -1,27 +1,5 @@
-if(POLICY CMP0020)
- cmake_policy(SET CMP0020 NEW)
-endif()
-
-if(POLICY CMP0058)
- cmake_policy(SET CMP0058 NEW)
-endif()
-
-if(POLICY CMP0028)
- cmake_policy(SET CMP0028 NEW)
-endif()
-
-if(POLICY CMP0042)
- cmake_policy(SET CMP0042 NEW)
-endif()
-
-if(POLICY CMP0063)
- cmake_policy(SET CMP0063 NEW)
-endif()
-
-if(POLICY CMP0053)
- cmake_policy(SET CMP0053 OLD)
-endif()
-
-if(POLICY CMP0011)
- cmake_policy(SET CMP0011 NEW)
-endif()
+foreach(k CMP0020 CMP0058 CMP0028 CMP0042 CMP0063 CMP0053 CMP0011 CMP0054)
+ if(POLICY ${k})
+ cmake_policy(SET ${k} NEW)
+ endif()
+endforeach()