]> granicus.if.org Git - json-c/commitdiff
Problem: cmake 3.25.1 warns about CMP0042 not being set
authorYurii Rashkovskii <yrashk@gmail.com>
Fri, 23 Dec 2022 22:59:59 +0000 (14:59 -0800)
committerYurii Rashkovskii <yrashk@gmail.com>
Fri, 23 Dec 2022 23:05:46 +0000 (15:05 -0800)
Solution: set it explictly to OLD behavior

CMakeLists.txt

index 2be027d677a2dbf541051dbf2b06b2fbfaec940a..f8000a6cb5ab656eb7e1d9da9b98bd59700f81ff 100644 (file)
@@ -19,10 +19,17 @@ endif()
 
 # If we've got 3.0 then it's good, let's provide support. Otherwise, leave it be.
 if(POLICY CMP0038)
-  # Policy CMP0038 introduced was in CMake 3.0
+  # Policy CMP0038 was introduced in CMake 3.0
   cmake_policy(SET CMP0038 NEW)
 endif()
 
+if(POLICY CMP0042)
+    # Policy CMP0042 was introduced in CMake 3.0
+    # CMake version 3.25.1 warns when the policy is not set and uses OLD behavior
+    # We set it explicitly to avoid the warning
+    cmake_policy(SET CMP0042 OLD)
+endif()
+
 if(POLICY CMP0054)
     cmake_policy(SET CMP0054 NEW)
 endif()