about summary refs log tree commit diff homepage
path: root/unittests
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@comsys.rwth-aachen.de>2023-04-02 13:55:39 +0200
committerMartinNowack <2443641+MartinNowack@users.noreply.github.com>2023-06-07 18:01:43 +0100
commit43414c9eaebbe47c9bd59338b8a1cd574feb37bc (patch)
treeab101a2624415b3f81a1935be92666853d0366fe /unittests
parentae1ee275c2268397fb843c4f9a7a04ce8030d1f0 (diff)
downloadklee-43414c9eaebbe47c9bd59338b8a1cd574feb37bc.tar.gz
unittests/CMakeLists.txt: remove obsolete policy
Checking for policy CMP0077 is obsolete as we now require CMake 3.16.0
as minimum version.
Diffstat (limited to 'unittests')
-rw-r--r--unittests/CMakeLists.txt39
1 files changed, 12 insertions, 27 deletions
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index ca90aead..5fd90457 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -8,36 +8,21 @@
 #===------------------------------------------------------------------------===#
 
 function(add_vanilla_googletest_subdirectory directory)
-  if (POLICY CMP0077)
-    # Prevent Google Test from adding to our install target (Google Test 1.8.0+)
-    # However, this can only be disabled starting with 1.8.1 (a.k.a. 1.9.0)
-    set(INSTALL_GTEST OFF)
-
-    # Google Mock is currently not used by our tests
-    set(BUILD_GMOCK OFF)
-
-    # (only) Google Test 1.8.0 with BUILD_GMOCK=OFF needs BUILD_GTEST=ON
-    set(BUILD_GTEST ON)
-
-    # Make option() in subdirectory respect normal variables (as set above).
-    # NOTE: The enclosing function limits the scope of this policy setting.
-    # FIXME: Remove once all supported Google Test versions require CMake 3.13+
-    #        (or set policy CMP0077 to NEW by themselves)
-    set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
-  else()
-    # FIXME: Remove with CMake minimum version 3.13+
-    # Use cache variable workaround as option() ignores normal variables
+  # Prevent Google Test from adding to our install target (Google Test 1.8.0+)
+  # However, this can only be disabled starting with 1.8.1 (a.k.a. 1.9.0)
+  set(INSTALL_GTEST OFF)
 
-    # Prevent Google Test from adding to our install target (Google Test 1.8.0+)
-    # However, this can only be disabled starting with 1.8.1 (a.k.a. 1.9.0)
-    set(INSTALL_GTEST OFF CACHE BOOL "disable installing Google Test" FORCE)
+  # Google Mock is currently not used by our tests
+  set(BUILD_GMOCK OFF)
 
-    # Google Mock is currently not used by our tests
-    set(BUILD_GMOCK OFF CACHE BOOL "disable building Google Mock" FORCE)
+  # (only) Google Test 1.8.0 with BUILD_GMOCK=OFF needs BUILD_GTEST=ON
+  set(BUILD_GTEST ON)
 
-    # (only) Google Test 1.8.0 with BUILD_GMOCK=OFF needs BUILD_GTEST=ON
-    set(BUILD_GTEST ON CACHE BOOL "enable building Google Test" FORCE)
-  endif()
+  # Make option() in subdirectory respect normal variables (as set above).
+  # NOTE: The enclosing function limits the scope of this policy setting.
+  # FIXME: Remove once all supported Google Test versions require CMake 3.13+
+  #        (or set policy CMP0077 to NEW by themselves)
+  set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
 
   # include Google Test's CMakeLists.txt
   add_subdirectory(${directory} "${CMAKE_CURRENT_BINARY_DIR}/gtest_build")