summarylogtreecommitdiffstats
path: root/python39.patch
blob: 89bee438d30c4091fc32708635a828d86f056132 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff -Naur orig/appleseed-2.1.0-beta/src/appleseed.python/CMakeLists.txt appleseed-2.1.0-beta/src/appleseed.python/CMakeLists.txt
--- orig/appleseed-2.1.0-beta/src/appleseed.python/CMakeLists.txt	2020-06-21 14:33:19.991451200 +0200
+++ appleseed-2.1.0-beta/src/appleseed.python/CMakeLists.txt	2020-06-21 15:05:11.215126100 +0200
@@ -34,8 +34,10 @@
 
 set (BOOST_NEEDED_LIBS)
 
+# Don't use Boost_VERSION directly as it changed format with Boost 1.70.
+
 if (WITH_PYTHON2_BINDINGS)
-    if (Boost_VERSION GREATER_EQUAL 106700)
+    if ((Boost_MAJOR_VERSION GREATER 1) OR (Boost_MINOR_VERSION GREATER_EQUAL 67))
         set (BOOST_NEEDED_LIBS ${BOOST_NEEDED_LIBS} python27)
     else ()
         set (BOOST_NEEDED_LIBS ${BOOST_NEEDED_LIBS} python)
@@ -46,14 +48,14 @@
     find_package (Python3 REQUIRED)
     find_package (OpenGL REQUIRED)
 
-    if (Boost_VERSION GREATER_EQUAL 106700)
-        set (BOOST_NEEDED_LIBS ${BOOST_NEEDED_LIBS} python35)
+    if ((Boost_MAJOR_VERSION GREATER 1) OR (Boost_MINOR_VERSION GREATER_EQUAL 67))
+        set (BOOST_NEEDED_LIBS ${BOOST_NEEDED_LIBS} python39)
     else ()
         set (BOOST_NEEDED_LIBS ${BOOST_NEEDED_LIBS} python3)
     endif ()
 endif ()
 
-find_package (Boost 1.61 COMPONENTS ${BOOST_NEEDED_LIBS})
+find_package (Boost 1.61 REQUIRED COMPONENTS ${BOOST_NEEDED_LIBS})
 
 
 #--------------------------------------------------------------------------------------------------
@@ -235,9 +237,18 @@
 
     target_link_libraries (appleseed.python
         appleseed
-        ${Boost_PYTHON_LIBRARY}             # Only Boost.Python2 library
-        ${PYTHON_LIBRARIES}
+        ${Boost_PYTHON_LIBRARY}         # Only Boost.Python2 library
     )
+
+    if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
+        target_link_libraries (appleseed.python
+            ${PYTHON_LIBRARIES}
+        )
+    endif ()
+
+    if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+        set_target_properties (appleseed.python PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+    endif ()
 endif ()
 
 if (WITH_PYTHON3_BINDINGS)
@@ -245,11 +256,20 @@
 
     target_link_libraries (appleseed.python3
         appleseed
-        ${Boost_PYTHON3_LIBRARY}        # Only Boost.Python3 library
         glad
-        ${PYTHON3_LIBRARY}
+        ${Boost_PYTHON3_LIBRARY}        # Only Boost.Python3 library
     )
 
+    if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
+        target_link_libraries (appleseed.python3
+            ${PYTHON3_LIBRARY}
+        )
+    endif ()
+
+    if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+        set_target_properties (appleseed.python3 PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+    endif ()
+
     if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
         target_link_libraries (appleseed.python3
             util
--- orig/appleseed-2.1.0-beta/CMakeLists.txt	2020-06-21 14:33:15.782637900 +0200
+++ appleseed-2.1.0-beta/CMakeLists.txt	2020-06-21 15:01:25.819131200 +0200
@@ -239,6 +239,10 @@
     set (Boost_USE_STATIC_LIBS TRUE)
 endif ()
 
+# Boost 1.70 breaks compatibility with the old way of doing things. This restores compatibility.
+# See https://gitlab.kitware.com/cmake/cmake/issues/18865 for details.
+set (Boost_NO_BOOST_CMAKE ON)
+
 find_package (Boost 1.61 REQUIRED COMPONENTS atomic chrono date_time filesystem regex system thread wave)
 
 add_definitions (-DBOOST_FILESYSTEM_VERSION=3 -DBOOST_FILESYSTEM_NO_DEPRECATED)