Skip to content

Commit 09d154f

Browse files
committed
Fixed policy setting so it works on old cmakes
1 parent 014f1d1 commit 09d154f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dlib/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
1212
# Suppress cmake warnings about changes in new versions.
1313
if(COMMAND cmake_policy)
1414
cmake_policy(SET CMP0003 NEW)
15-
cmake_policy(SET CMP0054 NEW)
15+
if (POLICY CMP0054)
16+
cmake_policy(SET CMP0054 NEW)
17+
endif()
1618
endif()
1719

1820

dlib/cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ cmake_minimum_required(VERSION 2.6.4)
33

44

55
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
6-
cmake_policy(SET CMP0054 NEW)
6+
if (POLICY CMP0054)
7+
cmake_policy(SET CMP0054 NEW)
8+
endif()
79

810
# Don't add dlib if it's already been added to the cmake project
911
if (NOT TARGET dlib)

0 commit comments

Comments
 (0)