Skip to content

Commit c4d5dfd

Browse files
authored
CMake: No Deprecation Warnings (#321)
Setting a `cmake_policy` to `OLD` is deprecated by definition and will raise a verbose warning.
1 parent b3cf010 commit c4d5dfd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ endif()
1616

1717
# CMake policies ##############################################################
1818
#
19+
# Setting a cmake_policy to OLD is deprecated by definition and will raise a
20+
# verbose warning
21+
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
22+
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
23+
endif()
24+
1925
# CMake 3.18+: CMAKE_CUDA_ARCHITECTURES
2026
# https://cmake.org/cmake/help/latest/policy/CMP0104.html
2127
if(POLICY CMP0104)

0 commit comments

Comments
 (0)