0001-buildsystem-relax-requirement-on-cmake-version.patch 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. From e8b6b7adc138a66f8d47396a2e707366d3771028 Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Mon, 31 Dec 2018 18:42:09 +0100
  4. Subject: [PATCH] buildsystem: relax requirement on cmake version
  5. Commit 73cc5089 (Using target_compile_features to specify C++ 11
  6. standard) bumped the required cmake version, from 3.0 to 3.8, so
  7. as to get the definition of target_compile_features().
  8. However, target_compile_features() was introduced in cmake-3.1:
  9. https://cmake.org/cmake/help/v3.1/command/target_compile_features.html
  10. And using cmake-3.1 is indeed sufficient to properly build.
  11. As such, relax the minimum required version down to cmake-3.1,
  12. so we can build on oldish, entreprise-grade distributions that
  13. only have cmake-3.1 (or at least, don't have up to cmake-3.8).
  14. Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  15. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  16. ---
  17. Upstream status: MR pending
  18. https://github.com/nlohmann/json/pull/1409
  19. ---
  20. CMakeLists.txt | 2 +-
  21. benchmarks/CMakeLists.txt | 2 +-
  22. test/cmake_add_subdirectory/project/CMakeLists.txt | 2 +-
  23. test/cmake_import/project/CMakeLists.txt | 2 +-
  24. test/cmake_import_minver/project/CMakeLists.txt | 2 +-
  25. 5 files changed, 5 insertions(+), 5 deletions(-)
  26. diff --git a/CMakeLists.txt b/CMakeLists.txt
  27. index 409f5bff..da6f08e7 100644
  28. --- a/CMakeLists.txt
  29. +++ b/CMakeLists.txt
  30. @@ -1,4 +1,4 @@
  31. -cmake_minimum_required(VERSION 3.8)
  32. +cmake_minimum_required(VERSION 3.1)
  33. ##
  34. ## PROJECT
  35. diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt
  36. index a53812c1..dd3f3027 100644
  37. --- a/benchmarks/CMakeLists.txt
  38. +++ b/benchmarks/CMakeLists.txt
  39. @@ -1,4 +1,4 @@
  40. -cmake_minimum_required(VERSION 3.8)
  41. +cmake_minimum_required(VERSION 3.1)
  42. project(JSON_Benchmarks LANGUAGES CXX)
  43. # set compiler flags
  44. diff --git a/test/cmake_add_subdirectory/project/CMakeLists.txt b/test/cmake_add_subdirectory/project/CMakeLists.txt
  45. index 2c5be183..21357b68 100644
  46. --- a/test/cmake_add_subdirectory/project/CMakeLists.txt
  47. +++ b/test/cmake_add_subdirectory/project/CMakeLists.txt
  48. @@ -1,4 +1,4 @@
  49. -cmake_minimum_required(VERSION 3.8)
  50. +cmake_minimum_required(VERSION 3.1)
  51. project(DummyImport CXX)
  52. diff --git a/test/cmake_import/project/CMakeLists.txt b/test/cmake_import/project/CMakeLists.txt
  53. index d268d72c..fe892fc1 100644
  54. --- a/test/cmake_import/project/CMakeLists.txt
  55. +++ b/test/cmake_import/project/CMakeLists.txt
  56. @@ -1,4 +1,4 @@
  57. -cmake_minimum_required(VERSION 3.8)
  58. +cmake_minimum_required(VERSION 3.1)
  59. project(DummyImport CXX)
  60. diff --git a/test/cmake_import_minver/project/CMakeLists.txt b/test/cmake_import_minver/project/CMakeLists.txt
  61. index eeef3296..29056bdc 100644
  62. --- a/test/cmake_import_minver/project/CMakeLists.txt
  63. +++ b/test/cmake_import_minver/project/CMakeLists.txt
  64. @@ -1,4 +1,4 @@
  65. -cmake_minimum_required(VERSION 3.8)
  66. +cmake_minimum_required(VERSION 3.1)
  67. project(DummyImportMinVer CXX)
  68. --
  69. 2.14.1