diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4531496b5017f553dc934cee607b89afd5e9aa8..ec55d8cd7d54eb066916bbaad8afc4bf531d7d06 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,9 +3,6 @@
 ############################################################################
 
 cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
-if(POLICY CMP0042)
-cmake_policy(SET CMP0042 NEW)
-endif()
 
 project(BornAgain)
 
diff --git a/ThirdParty/gtest/CMakeLists.txt b/ThirdParty/gtest/CMakeLists.txt
index cad6a3abcf65f52b032d83ed07f0d955b1791af0..ae244f3feb5ac31f09668013dcae64ed7f4cc8b9 100644
--- a/ThirdParty/gtest/CMakeLists.txt
+++ b/ThirdParty/gtest/CMakeLists.txt
@@ -2,6 +2,9 @@
 # CMakeLists.txt file for building gtest library
 ############################################################################
 
+if(POLICY CMP0042)
+cmake_policy(SET CMP0042 NEW)
+endif()
 
 if(MSVC)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_VARIADIC_MAX=10")