← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/GLVND_18_10 into lp:widelands

 

Toni Förster has proposed merging lp:~widelands-dev/widelands/GLVND_18_10 into lp:widelands.

Commit message:
set CMP0072 to OLD for Ubuntu 18.10

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1772079 in widelands: "CMake 3.11: warning about FindOpenGL"
  https://bugs.launchpad.net/widelands/+bug/1772079

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/GLVND_18_10/+merge/356771

Since it is only possible to compile with GLVND when using Clang on Ubuntu 18.10 we set CMP0072 to OLD behavior
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/GLVND_18_10 into lp:widelands.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2018-10-14 20:56:48 +0000
+++ CMakeLists.txt	2018-10-16 00:25:31 +0000
@@ -3,7 +3,7 @@
 cmake_minimum_required (VERSION 2.8.7)
 cmake_policy(VERSION 2.8.7)
 
-# This policy is not known to versions prior 3.1 and would result in errors, 
+# This policy is not known to versions prior 3.1 and would result in errors,
 # if set on such systems. This can be removed when cmake_minimum_required is set
 # to 3.1 or newer by using:
 # cmake_policy(VERSION 3.1)
@@ -11,12 +11,34 @@
    cmake_policy(SET CMP0054 NEW)
 endif(POLICY CMP0054)
 
-# This policy is not known to versions prior 3.11 and would result in errors, 
+# This policy is not known to versions prior 3.11 and would result in errors,
 # if set on such systems. This can be removed when cmake_minimum_required is set
 # to 3.11 or newer  by using:
 # cmake_policy(VERSION 3.11)
 if(POLICY CMP0072)
    cmake_policy(SET CMP0072 NEW)
+
+   # On Ubuntu 18.10 uwe need to set this to OLD since it currently does not
+   # compile using the default compiler, GCC 8.2, on this system. Only Clang is
+   # able to compile at the moment.
+   #
+   #TODO(stonerl): Check for later releases whether this is needed or not 
+   if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+       find_program(LSB_RELEASE_EXEC lsb_release)
+       execute_process(COMMAND ${LSB_RELEASE_EXEC} -is
+           OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT
+           OUTPUT_STRIP_TRAILING_WHITESPACE
+       )
+       execute_process(COMMAND ${LSB_RELEASE_EXEC} -cs
+           OUTPUT_VARIABLE RELEASE_CODENAME
+           OUTPUT_STRIP_TRAILING_WHITESPACE
+       )
+   endif()
+   
+   if (LSB_RELEASE_ID_SHORT STREQUAL "Ubuntu" AND RELEASE_CODENAME STREQUAL "cosmic")
+       cmake_policy(SET CMP0072 OLD)
+   endif()
+   
 endif(POLICY CMP0072)
 
 include("${CMAKE_SOURCE_DIR}/cmake/WlFunctions.cmake")


Follow ups