-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0001-Fix-CMake-import.patch
More file actions
29 lines (25 loc) · 1.43 KB
/
0001-Fix-CMake-import.patch
File metadata and controls
29 lines (25 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From fa1dc3b8f1603622d33ba3010b9ed5962e8f39c4 Mon Sep 17 00:00:00 2001
From: Bradley Austin Davis <bdavis@saintandreas.org>
Date: Fri, 18 Oct 2019 13:02:32 -0700
Subject: [PATCH] Fix CMake import
Using CMake 3.15 & Visual Studio 2019 to build on windows produced a cmake configuration which was unable to be used by clients. Investigating this I was eventually able to determine this was caused by a mismatch in the target properties. Specifically, it was setting the TYPE property to STATIC_LIBRARY even though it was building as a SHARED_LIBRARY.
This in turn was because the if clause on line `if(@BUILD_SHARED_LIBS@)` of this file was evaluating to `if (ON)` which was then not properly evaluated while under the CMake 2.6 policy. Explicitly setting the `CMP0012` policy to NEW fixes the problem.
---
assimpTargets.cmake.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/assimpTargets.cmake.in b/assimpTargets.cmake.in
index ab1a8d2c..afef9cbd 100644
--- a/assimpTargets.cmake.in
+++ b/assimpTargets.cmake.in
@@ -5,6 +5,9 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.6)
+# Required for the evaluation of "if(@BUILD_SHARED_LIBS@)" below to function
+cmake_policy(SET CMP0012 NEW)
+
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
--
2.28.0.windows.1