1
1

Compare commits

..

211 Commits

Author SHA1 Message Date
e13e8d727a Merge branch 'property-search-all-tabs-v2' into property-search-ui-v2 2020-09-14 17:36:42 -05:00
adaf9947b1 Merge branch 'property-search-all-tabs' into property-search-ui-v2 2020-09-14 17:34:23 -05:00
b037801f5e Merge branch 'property-search-highlight-tabs' into property-search-all-tabs-v2 2020-09-14 17:34:01 -05:00
fd89ef4d2f Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs 2020-09-14 17:33:45 -05:00
572ce24f7e Merge branch 'property-search-single-tab' into property-search-start-end-operators 2020-09-14 17:33:32 -05:00
2c2d30df60 Property Search: Apply fixes from all tab code 2020-09-14 17:33:18 -05:00
4fbc49ff4b Property Search: Fixes for all tab search V2 2020-09-14 17:21:42 -05:00
d9b0afcf19 Merge branch 'property-search-highlight-tabs' into property-search-all-tabs-v2 2020-09-14 13:50:40 -05:00
742b8d2ca1 Merge branch 'property-search-highlight-tabs' into property-search-all-tabs 2020-09-14 13:39:00 -05:00
dcfbee5c80 Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs 2020-09-14 13:38:25 -05:00
d8420767d3 Property Search: Use runtime struct properly for seach string 2020-09-14 13:38:11 -05:00
a90b701ab3 Merge branch 'property-search-highlight-tabs' into property-search-all-tabs 2020-09-14 13:36:03 -05:00
18d384ffaf Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs 2020-09-14 13:33:55 -05:00
601d323d96 Merge branch 'property-search-single-tab' into property-search-start-end-operators 2020-09-14 11:23:20 -05:00
0106127364 Property Search: Fix storing search string in runtime struct 2020-09-14 11:17:01 -05:00
360549b31b Property Search: Use pointer for properties space runtime struct 2020-09-14 10:39:14 -05:00
530183b60a Property Search: Add explanatory comment 2020-09-14 10:22:56 -05:00
dabed53d12 Merge branch 'property-search-add-theme-color' into property-search-single-tab 2020-09-14 09:48:06 -05:00
97212d6258 Merge branch 'property-search-move-context-to-panel' into property-search-add-theme-color 2020-09-14 09:47:50 -05:00
ca3cc95f3d Merge branch 'property-search-button-label-pointer' into property-search-move-context-to-panel 2020-09-14 09:47:37 -05:00
3eae5f71d1 Merge branch 'master' into property-search-button-label-pointer 2020-09-14 09:47:22 -05:00
d23036e510 Property Search: New implementation for all-tab search
Use a bespoke pass for running property search in a panel region.
While this method results in more code, it doesn't reuse the panel
search, which has a few benefits:
1. It's possible to exit early when a results is found for a tab. Although
   this doesn't affect worse case performance, in general it's a benefit.
2. The code for searching all tabs in the properties editor becomes
   much simpler.
3. There should be other performance improvements, as the search
   code can skip everything not related to search.

This is accomplished by ED_region_panels_layout_ex in area.c, which
was a bit too long of a function anyway.
2020-09-13 19:52:12 -05:00
98d4da32dd Merge branch 'property-search-highlight-tabs' into property-search-all-tabs 2020-09-12 18:48:47 -05:00
a67067253b Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs 2020-09-12 18:48:32 -05:00
d3dd76789c Merge branch 'property-search-single-tab' into property-search-start-end-operators 2020-09-12 18:47:54 -05:00
43533f4269 Property Search: Fix memory leak 2020-09-12 18:47:40 -05:00
cd35233ea7 Merge branch 'property-search-add-theme-color' into property-search-single-tab 2020-09-12 18:30:57 -05:00
6c1f3b40c6 Merge branch 'property-search-move-context-to-panel' into property-search-add-theme-color 2020-09-12 18:30:44 -05:00
94aa5c0dd6 Merge branch 'property-search-button-label-pointer' into property-search-move-context-to-panel 2020-09-12 18:30:30 -05:00
2dd0161860 Property Search: Replace pointer in group when button type switches 2020-09-12 18:30:13 -05:00
11f0dd4951 Merge branch 'property-search-highlight-tabs' into property-search-all-tabs 2020-09-12 17:43:46 -05:00
1496526dce Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs 2020-09-12 17:43:21 -05:00
3eaca73753 Merge branch 'property-search-single-tab' into property-search-start-end-operators 2020-09-12 17:42:27 -05:00
8f6740b275 Merge branch 'property-search-add-theme-color' into property-search-single-tab 2020-09-12 17:37:49 -05:00
f9dd47475a Merge branch 'property-search-move-context-to-panel' into property-search-add-theme-color 2020-09-12 17:22:12 -05:00
7b714a9897 Merge branch 'property-search-button-label-pointer' into property-search-move-context-to-panel 2020-09-12 17:22:01 -05:00
d78a5f022d Merge branch 'master' into property-search-button-label-pointer 2020-09-12 17:20:06 -05:00
b57cd0e359 Property Search: Use LinkData instead of button for group 2020-09-12 17:17:55 -05:00
cf877d717c Merge branch 'master' into property-search-button-label-pointer 2020-09-11 14:28:58 -05:00
5c329ba2b5 Merge branch 'master' into property-search-button-label-pointer 2020-09-11 14:15:01 -05:00
245cb6e972 Property Search: Fixes for button group 2020-09-11 13:58:08 -05:00
68a5d4c56d Property Search: Code to use new button group structs 2020-09-11 12:36:22 -05:00
bc730e4ae6 Merge branch 'property-search-add-theme-color' into property-search-single-tab 2020-09-11 12:36:04 -05:00
7ce4911a71 Merge branch 'property-search-move-context-to-panel' into property-search-add-theme-color 2020-09-11 12:15:06 -05:00
3c52c75af2 Merge branch 'property-search-button-label-pointer' into property-search-move-context-to-panel 2020-09-11 12:14:51 -05:00
28f13a5697 Property Search: Use button groups instead of button pointers 2020-09-11 12:14:27 -05:00
9a2d04677a Merge branch 'property-search-add-theme-color' into property-search-single-tab 2020-09-11 10:45:20 -05:00
3c26181cd9 Merge branch 'property-search-move-context-to-panel' into property-search-add-theme-color 2020-09-11 10:44:54 -05:00
537daa5dd4 Merge branch 'property-search-button-label-pointer' into property-search-move-context-to-panel 2020-09-11 10:44:41 -05:00
5c5d022649 Merge branch 'properties-pin-operator' into property-search-button-label-pointer 2020-09-11 10:44:25 -05:00
86993444a0 Merge branch 'master' into properties-pin-operator 2020-09-11 10:44:12 -05:00
a8eb263678 Merge branch 'property-search-all-tabs' into property-search-ui-v2 2020-09-10 17:44:56 -05:00
e9c9f7d5c4 Merge branch 'property-search-highlight-tabs' into property-search-all-tabs 2020-09-10 17:44:36 -05:00
6ebc8278de Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs 2020-09-10 17:44:21 -05:00
5545d83315 Merge branch 'property-search-single-tab' into property-search-start-end-operators 2020-09-10 17:44:05 -05:00
2f22d6aa7c Merge branch 'property-search-add-theme-color' into property-search-single-tab 2020-09-10 17:43:51 -05:00
bbacf94c69 Merge branch 'property-search-move-context-to-panel' into property-search-add-theme-color 2020-09-10 17:43:39 -05:00
eabba50141 Merge branch 'property-search-button-label-pointer' into property-search-move-context-to-panel 2020-09-10 17:43:08 -05:00
a444b38fa3 Merge branch 'properties-pin-operator' into property-search-button-label-pointer 2020-09-10 17:41:45 -05:00
9ba5d0e4b1 Merge branch 'master' into properties-pin-operator 2020-09-10 17:37:44 -05:00
099d603e7b Merge branch 'property-search-all-tabs' into property-search-ui-v2 2020-09-10 17:33:38 -05:00
b7b5227640 Merge branch 'property-search-highlight-tabs' into property-search-all-tabs 2020-09-10 17:33:19 -05:00
3069c4a3f7 Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs 2020-09-10 17:32:28 -05:00
afe0213bca Property Search: Fix clear operator after recent change 2020-09-10 17:32:11 -05:00
2baec9e65f Merge branch 'property-search-highlight-tabs' into property-search-all-tabs 2020-09-10 17:29:34 -05:00
055d3fbe2f Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs 2020-09-10 17:27:05 -05:00
83eacc0352 Merge branch 'property-search-single-tab' into property-search-start-end-operators 2020-09-10 17:26:42 -05:00
4baf63ab73 Property Search: Fix tab buttons graying out after refactor 2020-09-10 17:25:59 -05:00
46db0d65bd Property Search: Clear region search filter active flag on read 2020-09-10 15:01:23 -05:00
4e636376ca Property Search: Set expansion for subpanels based on results 2020-09-10 14:54:35 -05:00
deabcf00f2 Property Search: Use RNA_property_enum_items_gettexted 2020-09-10 13:42:23 -05:00
8679b24b91 Property Search: Remove redundant button hiding code 2020-09-10 12:39:46 -05:00
36b3364ef3 Property Search: Refactor block search into new function 2020-09-10 12:34:52 -05:00
d53e093b3e Property Search: Move search string to a runtime struct 2020-09-10 11:19:17 -05:00
01d17c525c Cleanup: Remove unecessary cast 2020-09-10 10:28:49 -05:00
01d292f151 Property Search: Clarify comment 2020-09-10 10:26:56 -05:00
9d06994229 Property Search: Refactor setting block search filter 2020-09-10 10:24:26 -05:00
049eb2f33a Property Search: Add comment to field, make const 2020-09-10 09:35:59 -05:00
79c5b90040 Merge branch 'property-search-all-tabs' into property-search-ui-v2 2020-09-10 09:09:52 -05:00
5b7a534211 Merge branch 'property-search-highlight-tabs' into property-search-all-tabs 2020-09-10 09:09:12 -05:00
b89e8b71f9 Merge branch 'property-search-start-end-operators' into property-search-highlight-tabs 2020-09-10 09:08:52 -05:00
e56e34ddd1 Merge branch 'property-search-single-tab' into property-search-start-end-operators 2020-09-10 09:07:58 -05:00
09217fc22d Merge branch 'property-search-add-theme-color' into property-search-single-tab 2020-09-10 08:56:29 -05:00
66f5008b33 Merge branch 'property-search-move-context-to-panel' into property-search-add-theme-color 2020-09-10 08:55:55 -05:00
1b5f355af8 Merge branch 'property-search-button-label-pointer' into property-search-move-context-to-panel 2020-09-10 08:54:46 -05:00
f4c8b81595 Reapply changes after failed merge 2020-09-10 08:54:17 -05:00
9a60f5cf93 Merge branch 'properties-pin-operator' into property-search-button-label-pointer 2020-09-10 08:53:57 -05:00
417fa6765e Remove changes from property-search-button-label-pointer 2020-09-10 08:48:11 -05:00
3860e8bfeb Merge branch 'master' into properties-pin-operator 2020-09-10 08:29:05 -05:00
59fcb799ca Merge branch 'properties-pin-operator' into property-search-button-label-pointer 2020-09-10 08:26:42 -05:00
3dc7c4fa83 Merge branch 'master' into properties-pin-operator 2020-09-10 08:26:25 -05:00
3551b8c83e Merge branch 'property-search-all-tabs' into property-search-ui-v2 2020-09-09 14:03:09 -05:00
4a4e36ff9b Property Search: All tabs
This patch enables property search for all tabs in the property editor.
This is definitely the most "crazy" of the changes in terms of code, but
it's also where the new functionality gets good.

There is one piece of funcionality that wasn't obvious when I began the
implementation. In order to make interaction faster, if the editor's
current tab doesn't have a result, the search moves you to the next panel
that does. That way you can just press `ctrl-F`, search, and have the
result appear.

In order to keep the searching safe, to make sure the editor isn't influenced
by anything that happens while building the layout for the other tabs,
the space is duplicated and the new search is run in the duplicated
editor. This also helps isolate this code, which could be fairly invasive
otherwise. Only the layout pass is done in the other tabs, and it works
by just running the regular single tab property search  (D8856) and
checking if any of the active panels in the tab match the search filter.

The search match status for every current tab of the property editor is
stored in a runtime field and them displayed later by dimming icons in
the tab selector panel to the left. The functionality for that dimming is
in D8858.

Note that there are currently some issues with the tool tab, where some
context variables end up being `None`. I'm curious if reviewers have any
advice if they encounter this.

**Future Improvements**
This patch does not addresss the performance aspects of searching every
tab. This shouldn't be too bad, but it would be good to make some changes
to improve this, ideally in separate patches. I have done some initial profiling,
and it looks like a significant portion of time is spent doing string comparisons,
so that may be the best place to start. Here are some ideas:
1. Use ghash instead of string lookups for panel types
2. Possibly only search in other tabs while editing search string. I would like
   to avoid this though.
3. Look into using ED_region_tag_redraw_no_rebuild for some interactions
   like panel dragging.

Differential Revision: https://developer.blender.org/D8859
2020-09-09 13:46:27 -05:00
44dcc742c6 Property Search: Add highlight arguments to tab buttons
For searching multiple tabs, we need a way to show which tabs have a search
result, but we still need to be able to show which tab is active. Also, multiple
tabs can be highlighted, so that argument needs be be a bitfield enum. This
requires giving extra arguments to `ui_item_enum_expand_tabs`.

Unforunately this adds a bit of ugly complexity to this function. It would be
better if RNA enum items could have an "active" flag, but that change would
probably have larger scope.

Differential Revision: https://developer.blender.org/D8858
2020-09-09 13:27:55 -05:00
863ea6a32c Property Search: Quick start and clear operators
This patch adds quick start and quick clear operators.

`ctrl-F` is obviously necessary, but the clear operator, `alt-F` requires
a bit of explanation. First, it maps nicely to the paradigm of "key to set,
alt-key to clear," which makes it pretty unobtrusive. Second, it can be
a quicker way to clear the search than moving the mouse to the top.
Finally, a future improvement I would like to make to property search
is adding the ability to reset the panels to their expansion before the
search started. Either escaping out of the button while text editing or
pressing `alt-F` would be the way to do that.

Differential Revision: https://developer.blender.org/D8857
2020-09-09 13:14:16 -05:00
58488c08b8 Property Search: Single tab
This adds a search bar to the properties editor. The full search for every tab
isn't includede in this patch, but the interaction with panels, searching
behavior, internal UI, region level, and DNA changes are included here.

The block-level search works by iterating over the block's buttons and
checking whether they match the search. If they do, they are tagged with
a flag, and the block's panel is tagged too.

For every update (text edit), the panel's expansion is set to whether the
panel has a result or not.

There is some complications to this that you might no initially think of:
1. Closed panel's subpanels have to be searched too. This adds some
   complexity and special cases to the area-level panel layout code.
2. //Maybe more if I think of things to add here//

There might be some methods of simplifying some of the logic, particularly
around choosing whether to highlight panel headers. Also note that automatic
subpanel expansion isn't working right now. I'll look into this, but I want to post
all the patches first.

**Future Improvements**
Here are some improvements possible in the future that won't be part of this patch:
1. Use the new fuzzy search in BLI
2. Reseting panels to their expansion before the search started if you `esc`
   out of the text box
3. Open parent panels if their subpanels have a match but they don't. This
   requires adding a reference to parent panels for subpanels.

Differential Revision: https://developer.blender.org/D8856
2020-09-09 13:01:32 -05:00
6a76eeaced Property Search: Add "Search match" theme color
We use a highlight on panel headers to convey that they have a search match.
It's also conceivable to use this color to highlight the property editor tabs
that have search results.

Normally we don't like adding new theme colors, but this is quite a special
case. For example, the color in the outliner is green. This patch has a blue
highlight so it feels more cohesive though.

Differential Revision: https://developer.blender.org/D8854
2020-09-09 12:08:43 -05:00
f3197de265 Property Search: Move properties context buttons back to a panel
The context path buttons used to be in a panel in 2.79. Although they look
a bit better in the header, there is not space for them with the property
search field in the header as well.

In the long term, maybe it will be possible to shrink the text button and
then animate it expanding when property search begins, then there
would be enough room for both.

Note that this diff is just for review, Blender won't ever actually have only
the pin button in the header like the following image.

{F8858554 size=full}

Differential Revision: https://developer.blender.org/D8853
2020-09-09 11:57:27 -05:00
a3f61ade7a Property Search: Small cleanups 2020-09-09 11:25:21 -05:00
407f8f5a4e Merge branch 'property-search-button-label-pointer' into property-search-ui-v2 2020-09-09 11:17:13 -05:00
e2f3455956 Merge branch 'properties-pin-operator' into property-search-button-label-pointer 2020-09-09 11:16:23 -05:00
27ce07a010 Merge branch 'master' into properties-pin-operator 2020-09-09 11:15:58 -05:00
e9489757ea Merge branch 'properties-pin-operator' into property-search-ui-v2 2020-09-09 11:02:03 -05:00
27f3f3d8a7 Use RNA to set the pin ID 2020-09-09 10:54:34 -05:00
69be090944 Merge branch 'master' into properties-pin-operator 2020-09-09 10:14:10 -05:00
ca0d4d90c6 Merge branch 'master' into property-search-ui-v2 2020-09-02 11:15:50 -05:00
277e03c6bd UI: Keep track of button's relationship with label buttons
This is needed for property search where we want to highlight a button's label if it matches the search
filter. Otherwise the button itself is highlighted but it has no idea what label to highlight.

This is especially important because of the use of property split layouts where the label is almost
always outside of the button in a separate column.

The additional logic in the layout code isn't ideal, but I think this is generally a good thing to keep track of.
For example, another use for this could be adding a highlight to a buttons label on mouseover.

Differential Revision: https://developer.blender.org/D8783
2020-09-02 09:39:35 -05:00
c335173a78 Merge branch 'master' into property-search-ui-v2 2020-09-01 23:32:18 -05:00
6d2069f348 Merge branch 'master' into property-search-ui-v2 2020-09-01 13:55:05 -05:00
293405b653 Merge branch 'master' into property-search-ui-v2 2020-08-30 22:36:20 -05:00
0c4a9085f8 Merge branch 'master' into property-search-ui-v2 2020-08-26 17:12:39 -05:00
fbcedf96cb Property Search: Add comment explaining menu search limitation 2020-08-26 09:24:24 -05:00
d17e2e8101 Merge branch 'master' into property-search-ui-v2 2020-08-25 22:47:36 -05:00
caa79adffb Property Search: Update panel expansion while searching 2020-08-20 16:06:11 -04:00
612b19f4e7 Property Search: Correct the last commit
Accidentally committed the wrong file...
2020-08-20 14:54:00 -04:00
171090c489 Property Search: Switch to the next tab with a result 2020-08-20 14:43:51 -04:00
31ef82b2cf Merge branch 'master' into property-search-ui-v2 2020-08-20 14:23:02 -04:00
3eea67e8c5 Property Search: Update the "search on" flag for the proper region 2020-08-20 11:55:47 -04:00
a22a8cdeeb Merge branch 'master' into property-search-ui-v2 2020-08-20 10:57:15 -04:00
abe6bd2bd2 Merge branch 'master' into property-search-ui-v2 2020-08-17 09:46:56 -04:00
ce6270d24d Property Search: Clarify comments, rename function 2020-08-14 16:12:56 -04:00
f8c386a331 Property Search: Fix ctrl-F shortcut after recent renaming change 2020-08-14 16:05:28 -04:00
7d6562d280 Property Search: Gray out panels with no search match 2020-08-14 15:53:02 -04:00
dcc3211650 Property Search: Add search filter active flag to region
This seems like a good way to quickly check whether or not to gray out
panel header text (in addition to whether they have a match).  It might
be nice to have this information quickly accessible in the future as well.
2020-08-14 15:52:30 -04:00
c8dfe0800d Merge branch 'master' into property-search-ui-v2 2020-08-14 13:36:27 -04:00
b9c4e5bd23 Property Search: Search in pulldown button RNA enums
This introduces a memory leak when accessing the enum items.
I'll solve that later.
2020-08-13 18:20:03 -04:00
904e7830e1 Property Search: Search based on label buttons 2020-08-13 17:34:33 -04:00
629c8344c4 Merge branch 'master' into property-search-ui-v2 2020-08-13 16:50:58 -04:00
1ea46cd039 Merge branch 'master' into property-search-ui-v2 2020-08-12 21:22:16 -04:00
f2c8935295 Merge branch 'master' into property-search-ui-v2 2020-08-11 22:14:01 -04:00
95fabb12cb Property Search: Highlight panel headers with a search match 2020-07-30 17:44:22 -04:00
b02e8e3504 Property Search: Add "search match" theme color 2020-07-30 17:42:42 -04:00
1836a97958 Property Search: Continued refactoring / cleanup 2020-07-30 15:23:18 -04:00
99862a72b1 Property Search: Miscellaneous cleanup
Mostly renaming UI_FILTERED to UI_SEARCH_FILTER_MATCHES
and reversing its meaning. Also reverting some unrelated changes.
2020-07-30 14:59:47 -04:00
aa3a053f31 Property Search: Gray out buttons that don't match the search 2020-07-30 14:49:59 -04:00
ba2eef2f6f Property Search: Remove code for changing to search layout
The design for this task has changed so that the layouts won't be changed
to only list the matching properties. Instead we will use highlights to
communicate matching properties.

After this commit property search doesn't do anything visible.
Functionality will be added back in future commits.
2020-07-30 12:29:14 -04:00
fff7a29861 Merge branch 'master' into property-search-ui-v2 2020-07-30 11:53:59 -04:00
68df739bb1 Merge branch 'master' into property-search-ui-v2 2020-07-29 17:21:13 -04:00
1f768bbe41 Merge branch 'master' into property-search-ui 2020-07-28 17:25:39 -04:00
ce6cf2b475 Property Search: Various cleanups and comment changes 2020-07-28 17:12:09 -04:00
f957e09398 Merge branch 'master' into property-search-ui 2020-07-28 14:25:00 -04:00
d58f361099 Property Search: Remove commented out code 2020-07-28 13:48:36 -04:00
1b391f14fc Property Search: Fixes for other-tab searching
The main change here is not running the search twice for the active tab.
We also check for the panel being active rather than just not filtered.

There are still errors when the tool tab is active, those will be solved
in a future commit.
2020-07-28 12:11:48 -04:00
b4b2185da0 Property Search: Remove debugging information 2020-07-27 16:39:43 -04:00
8f548fd856 Merge branch 'master' into property-search-ui 2020-07-27 16:32:49 -04:00
634bf8e4fc Merge branch 'master' into property-search-ui 2020-07-27 12:34:08 -04:00
6776607913 UI: Use an operator to set the property editor's pinned data-block
This is another change pulled from the `property-search-ui` branch. This is useful
because it means the pin button doesn't have to be a custom button defined in C.

Replacing the use of button callbacks with operators is always nice too.

Differential Revision: https://developer.blender.org/D8376
2020-07-23 13:21:08 -04:00
af146e7745 Use operator to toggle pin data-block 2020-07-23 12:16:49 -04:00
4b0a94661c Property Search: Clean up some unecessary changes 2020-07-23 11:36:40 -04:00
8eda823dbc Merge branch 'master' into property-search-ui 2020-07-23 11:04:11 -04:00
e40225577b Merge branch 'master' into property-search-ui 2020-07-22 22:28:48 -04:00
d219d0efa1 Property Search: Fix graying out tabs with no results 2020-07-22 15:14:06 -04:00
cc1201dce3 Property Search: Improve debug printing 2020-07-22 12:09:54 -04:00
1afdc92511 Merge branch 'master' into property-search-ui 2020-07-22 11:35:02 -04:00
20ce4a77bd Property Search: Properly filter labels for color buttons 2020-07-20 16:24:39 -04:00
7d3d6ac085 Merge branch 'master' into property-search-ui 2020-07-20 15:45:34 -04:00
304e9a0b9e Merge branch 'master' into property-search-ui 2020-07-10 13:20:49 -04:00
31657ebbbe Property Search: Initial implementation of searching all tabs
The basics should be close to working. The space and necessary context
is duplicated, then the context is switched and that tab is searched.
However, this is still pretty buggy and the enum isn't drawing correctly.
I'm probably not filling the bitfield correctly.

Mainly committing this to get it out there and focus on smaller fixes /
improvements to it.
2020-07-09 16:25:20 -04:00
169ac2805e Property Search: Add search filter active tabs property
I also generalized the tab "adding" code in RNA to make it usable for filling
both the context enum and the active search filter tabs properties. The tab
layout code might need to be extended to add the idea of a custom
highlight property.
2020-07-09 08:45:54 -04:00
c914bff16d Property Search: Fix panels occasionally overlapping 2020-07-08 13:56:55 -04:00
7758bb25e7 Property Search: Fix panels animating when added 2020-07-08 11:52:52 -04:00
94272e8347 Merge branch 'master' into property-search-ui 2020-07-08 11:06:47 -04:00
67d6d1363d Property Search: Properly filter box buttons 2020-07-07 15:27:29 -04:00
b7d47e9892 Property Search: Apply filter to operator buttons 2020-07-07 14:44:30 -04:00
6f5ca857fc Property Search: Move button tagging to separate function 2020-07-07 13:55:34 -04:00
71c6af4d59 Property Search: Solve memory leak 2020-07-07 13:21:23 -04:00
2f68b79fa8 Property Search: Cleanup, remove unrelated changes 2020-07-07 12:24:14 -04:00
98c6349bca Merge branch 'master' into property-search-ui 2020-07-07 11:10:53 -04:00
4c1095d33c Property Search: Support labels and expanded enums 2020-07-07 10:58:06 -04:00
847837c808 Property Search: Support labels and array buttons 2020-07-07 10:48:49 -04:00
16bf1807a1 Merge branch 'master' into property-search-ui 2020-07-07 10:18:44 -04:00
052baecc0d Merge branch 'master' into property-search-ui 2020-07-02 18:11:25 -04:00
34c5245c32 Property Search: Support heading labels 2020-07-01 15:16:44 -04:00
42e5314727 Property Search: Support checkboxes with no headings
Further changes will be needed to keep track of the labels added
for headings.
2020-07-01 15:10:40 -04:00
7137e99ff3 Property Search: Fix some filtered buttons not hidden 2020-07-01 12:35:57 -04:00
f3e409c1bf Property Search: Fix X margin accumulating for box panels 2020-07-01 12:11:14 -04:00
92c201b493 Property Search: Turn off search for add constraints buttons 2020-07-01 11:35:20 -04:00
7955c26f41 Merge branch 'master' into property-search-ui 2020-07-01 11:11:19 -04:00
26450636cd Property Search: Support labels with number buttons 2020-06-30 21:29:04 -04:00
f3b83271e6 Property Search: Support labels with ui_item_with_label
This includes unexpanded enums and "pointer" selection buttons, and
possibly others.

This necessitates changing uiItemL_respect_property_split to return the
label button it creates, which is reasonably anyway as it makes it
consistent with uiItemL_.
2020-06-30 21:17:27 -04:00
136475dca3 Property Search: Refactor to simpler method
This method doesn't try to change the input layouts at all. Instead it
filters out the empty buttons and removes layouts that become empty
after that.

Pointers for labels and decorators have been added to uiBut. They will
be set during the layout building process in future commits. For now
all labels will be removed though.
2020-06-30 18:54:10 -04:00
544ac33b61 Property Search: Always animate panels when filter status changes
This should finally be a proper solution to this problem. Now the last
search filter status is stored and compared to the new one to
activate animation.
2020-06-30 12:07:28 -04:00
263e42a172 Property Search: Filter panel names without case sensitivity 2020-06-30 11:42:44 -04:00
b7938c3768 Merge branch 'master' into property-search-ui 2020-06-30 09:28:26 -04:00
be7a4f4a81 Property Search: Cleaup: Remove unused variable 2020-06-29 17:09:45 -04:00
dbc9f1b0f3 Merge branch 'master' into property-search-ui 2020-06-29 17:08:57 -04:00
f3caadec90 Merge branch 'master' into property-search-ui 2020-06-29 11:29:55 -04:00
11b89dd56c Property Search: Don't remove layouts with search turned off
This mostly fixes panel headers, although they still end up with the same
problems as other layouts, with a minimum column size enforced for some
reason and misplaced labels.
2020-06-26 14:16:44 -04:00
5218fb969f Merge branch 'master' into property-search-ui 2020-06-26 10:16:50 -04:00
411f425973 Merge branch 'master' into property-search-ui 2020-06-26 09:21:29 -04:00
d4b9f41a56 Property Search: Print debug with colors 2020-06-26 09:20:06 -04:00
66ac0448ef Property Search: Improve layout debugging tool
The tool now prints button types as well. Click to drag a panel while a
search is active to print a tree of the layouts, sublayouts, and buttons.
2020-06-25 21:39:05 -04:00
170a40c338 Property Search: Sort filtered panels properly
Instead of just putting the filtered panels at the bottom, or not updating
their search order, we stop increasing the offset while the current panel
is invisible. This way the order is not completely broken if you drag to
reorder a panel while some have been filtered out.
2020-06-25 16:53:18 -04:00
d2c00d1d7f Merge branch 'master' into property-search-ui 2020-06-25 16:17:08 -04:00
cf99c25dbe Merge branch 'master' into property-search-ui 2020-06-25 12:16:26 -04:00
c95d6de3b3 Property Search: Improve interaction with panels 2020-06-19 07:41:12 -04:00
a33720329b Property Search: New method that reuses existing layouts
This method just transforms each layout into a row or a column, without
adding any new layouts at all. There are a few problems with this method
though, the columns have a fixed width for some reason, and it becomes
more difficult to add the label column.
2020-06-18 17:00:38 -04:00
9029c7be19 Merge branch 'master' into property-search-ui 2020-06-18 08:46:53 -04:00
463c4ef39e Property Search: Support aligned rows in search layout 2020-06-17 17:31:22 -04:00
c891ba0086 Property Search: Solve memory leak 2020-06-17 16:31:03 -04:00
09e555142a Merge branch 'master' into property-search-ui 2020-06-17 14:50:08 -04:00
4d5b6409ee Property Search: Expose layout flag to RNA, use for modifiers 2020-06-17 13:15:26 -04:00
712ccc2602 Property Search: Improve interaction with panels
This isn't perfect yet, but the animation is back, and it works much better.
There are still two issues though:
  1. Order doesn't update sometimes while searching / ending search.
  2. Panels are still displayed when empty in some situations.
The solution is probably just adding some more special cases. Possibly
a tag for panel aligning when the search filter is changed to force special
ordering calculations.
2020-06-17 13:14:58 -04:00
85fe4a18e8 Property Search: Various small cleanups 2020-06-17 10:21:38 -04:00
8357b7fe46 Merge branch 'master' into property-search-ui 2020-06-17 09:08:26 -04:00
13b283ca8e Property Search: Make ctrl-F work, and alt-F to clear 2020-06-16 11:54:38 -04:00
723f6e7f53 Merge branch 'master' into property-search-ui 2020-06-16 10:50:35 -04:00
040931a9b2 Merge branch 'master' into property-search-ui 2020-06-12 22:01:59 -04:00
a34c25046b Property Search: Refactor / simplify, and better layout
The single column layout works much better now, as most of the code that
dealt with trying to remove empty layouts has been rewritten. The search
filter code is not a completely separate pass for the sake of simplicity.

Also, toggle buttons have their text replaced with the rna property name.

There branch is far from stable, and there's a tricky memory leak still to
track down as well.
2020-06-12 21:59:07 -04:00
e299727fba Merge branch 'master' into property-search-ui 2020-06-12 10:26:05 -04:00
db76f34ed6 UI: Start towards property search in public branch
This is VERY WIP, but I will continue work in this branch. Implementation
starts with a few things:
  - A pass at the end of the layout system to scan buttons based on a
    search string set by the properties space. Buttons which don't fit
    the filter are removed from the layouts.
  - A pass after the filter to move buttons that are still in layouts
    to a single column "search layout." There is currently a bug with
    this that adds too much space in between items.
  - An attempt to only show panels that haven't been completely
    filtered by the previous two steps. This is quite buggy right now:
    panels don't animate properly and sometimes it fails.
  - An attempt at a keymap item "ctrl-F" to activate the search button.
    "alt-F" should probably clear the button too.
2020-06-11 18:07:24 -04:00
11459 changed files with 1167481 additions and 1615178 deletions

View File

@@ -2,7 +2,7 @@
# Configuration of clang-format # Configuration of clang-format
# ============================= # =============================
# #
# Tested to work with versions: 8 to 11. # Tested to work with versions: 6 to 8.
# This causes parameters on continuations to align to the opening brace. # This causes parameters on continuations to align to the opening brace.
# #
@@ -61,17 +61,17 @@ ContinuationIndentWidth: 4
# This tries to match Blender's style as much as possible. One # This tries to match Blender's style as much as possible. One
BreakBeforeBraces: Custom BreakBeforeBraces: Custom
BraceWrapping: { BraceWrapping: {
AfterClass: 'false', AfterClass: 'false'
AfterControlStatement: 'false', AfterControlStatement: 'false'
AfterEnum : 'false', AfterEnum : 'false'
AfterFunction : 'true', AfterFunction : 'true'
AfterNamespace : 'false', AfterNamespace : 'false'
AfterStruct : 'false', AfterStruct : 'false'
AfterUnion : 'false', AfterUnion : 'false'
BeforeCatch : 'true', BeforeCatch : 'true'
BeforeElse : 'true', BeforeElse : 'true'
IndentBraces : 'false', IndentBraces : 'false'
AfterObjCDeclaration: 'true', AfterObjCDeclaration: 'true'
} }
# For switch statements, indent the cases. # For switch statements, indent the cases.
@@ -161,8 +161,6 @@ PenaltyBreakString: 1000000
# "^\s+[A-Z][A-Z0-9_]+\s*\([^\n]*\)\n\s*\{" # "^\s+[A-Z][A-Z0-9_]+\s*\([^\n]*\)\n\s*\{"
ForEachMacros: ForEachMacros:
- BEGIN_ANIMFILTER_SUBCHANNELS - BEGIN_ANIMFILTER_SUBCHANNELS
- BKE_pbvh_vertex_iter_begin
- BKE_pbvh_face_iter_begin
- BLI_FOREACH_SPARSE_RANGE - BLI_FOREACH_SPARSE_RANGE
- BLI_SMALLSTACK_ITER_BEGIN - BLI_SMALLSTACK_ITER_BEGIN
- BMO_ITER - BMO_ITER
@@ -181,7 +179,6 @@ ForEachMacros:
- CTX_DATA_BEGIN_WITH_ID - CTX_DATA_BEGIN_WITH_ID
- DEG_OBJECT_ITER_BEGIN - DEG_OBJECT_ITER_BEGIN
- DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN - DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN
- DRW_ENABLED_ENGINE_ITER
- DRIVER_TARGETS_LOOPER_BEGIN - DRIVER_TARGETS_LOOPER_BEGIN
- DRIVER_TARGETS_USED_LOOPER_BEGIN - DRIVER_TARGETS_USED_LOOPER_BEGIN
- FOREACH_BASE_IN_EDIT_MODE_BEGIN - FOREACH_BASE_IN_EDIT_MODE_BEGIN
@@ -206,7 +203,6 @@ ForEachMacros:
- FOREACH_SCENE_COLLECTION_BEGIN - FOREACH_SCENE_COLLECTION_BEGIN
- FOREACH_SCENE_OBJECT_BEGIN - FOREACH_SCENE_OBJECT_BEGIN
- FOREACH_SELECTED_BASE_BEGIN - FOREACH_SELECTED_BASE_BEGIN
- FOREACH_SELECTED_BEZT_BEGIN
- FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN - FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN
- FOREACH_SELECTED_OBJECT_BEGIN - FOREACH_SELECTED_OBJECT_BEGIN
- FOREACH_TRANS_DATA_CONTAINER - FOREACH_TRANS_DATA_CONTAINER
@@ -258,7 +254,7 @@ ForEachMacros:
- SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN - SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
- SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN - SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
- SEQ_ALL_BEGIN - SEQ_ALL_BEGIN
- SEQ_ITERATOR_FOREACH - SEQ_CURRENT_BEGIN
- SURFACE_QUAD_ITER_BEGIN - SURFACE_QUAD_ITER_BEGIN
- foreach - foreach
- ED_screen_areas_iter - ED_screen_areas_iter
@@ -266,13 +262,9 @@ ForEachMacros:
- SET_SLOT_PROBING_BEGIN - SET_SLOT_PROBING_BEGIN
- MAP_SLOT_PROBING_BEGIN - MAP_SLOT_PROBING_BEGIN
- VECTOR_SET_SLOT_PROBING_BEGIN - VECTOR_SET_SLOT_PROBING_BEGIN
- WL_ARRAY_FOR_EACH
- FOREACH_SPECTRUM_CHANNEL
StatementMacros: # Use once we bump the minimum version to version 8.
- PyObject_HEAD # # Without this string literals that in-line 'STRINGIFY' behave strangely (a bug?).
- PyObject_VAR_HEAD # StatementMacros:
- ccl_gpu_kernel_postfix # - PyObject_VAR_HEAD
# - STRINGIFY
MacroBlockBegin: "^OSL_CLOSURE_STRUCT_BEGIN$"
MacroBlockEnd: "^OSL_CLOSURE_STRUCT_END$"

View File

@@ -1,8 +1,6 @@
# The warnings below are disabled because they are too pedantic and not worth fixing. # The warnings below are disabled because they are too pedantic and not worth fixing.
# Some of them will be enabled as part of the Clang-Tidy task, see T78535. # Some of them will be enabled as part of the Clang-Tidy task, see T78535.
# NOTE: No comments in the list below is allowed. Clang-tidy will ignore items after comments in the lists flag list.
# This is because the comment is not a valid list item and it will stop parsing flags if a list item is a comment.
Checks: > Checks: >
-*, -*,
readability-*, readability-*,
@@ -14,13 +12,11 @@ Checks: >
-readability-avoid-const-params-in-decls, -readability-avoid-const-params-in-decls,
-readability-simplify-boolean-expr, -readability-simplify-boolean-expr,
-readability-make-member-function-const, -readability-make-member-function-const,
-readability-suspicious-call-argument,
-readability-redundant-member-init,
-readability-misleading-indentation,
-readability-use-anyofallof,
-readability-identifier-length,
-readability-function-cognitive-complexity, -readability-misleading-indentation,
-readability-redundant-member-init,
-readability-use-anyofallof,
bugprone-*, bugprone-*,
-bugprone-narrowing-conversions, -bugprone-narrowing-conversions,
@@ -28,26 +24,8 @@ Checks: >
-bugprone-branch-clone, -bugprone-branch-clone,
-bugprone-macro-parentheses, -bugprone-macro-parentheses,
-bugprone-reserved-identifier, -bugprone-reserved-identifier,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-sizeof-expression, -bugprone-sizeof-expression,
-bugprone-integer-division, -bugprone-integer-division,
-bugprone-redundant-branch-condition, WarningsAsErrors: '*'
-bugprone-suspicious-include,
modernize-*,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-nodiscard,
-modernize-loop-convert,
-modernize-pass-by-value,
-modernize-raw-string-literal,
-modernize-return-braced-init-list
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: 1

View File

@@ -34,15 +34,6 @@ indent_style = space
indent_size = 2 indent_size = 2
max_line_length = 99 max_line_length = 99
# Tom's Obvious Minimal Language
[*.toml]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 120
# reStructuredText # reStructuredText
[*.rst] [*.rst]
charset = utf-8 charset = utf-8
@@ -51,12 +42,3 @@ insert_final_newline = true
indent_style = space indent_style = space
indent_size = 3 indent_size = 3
max_line_length = 120 max_line_length = 120
# Makefile
[{Makefile,GNUmakefile}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4
max_line_length = 120

View File

@@ -1,104 +0,0 @@
# git config blame.ignoreRevsFile .git-blame-ignore-revs
#
# After running the above, commits listed in this file will be
# ignored by git blame. The blame will be shifted to the person
# who edited the line(s) before the ignored commit.
#
# To disable this ignorance for a command, run as follows
# git blame --ignore-revs-file="" <other options>
#
# Changes that belong here:
# - Massive comment, doxy-sections, or spelling corrections.
# - Clang-format, PEP8 or other automated changes which are *strictly* "no functional change".
# - Several commits should be added to this list at once, because adding
# one extra commit (to edit this file) after every cleanup is noisy.
# - No clang-tidy changes.
#
# Note:
# - The comment above the SHA should be the first line of the commit.
# - It is fine to pack together similar commits if they have the same explanatory comment.
# - Use only 40 character git SHAs; not smaller ones, not prefixed with rB.
#
# https://git-scm.com/docs/git-blame/2.23.0
# white space commit. (2 spaces -> tab).
0a3694cd6ebec710da7110e9f168a72d47c71ee0
# Cycles: Cleanup, spacing after preprocessor
cb4b5e12abf1fc6cf9ffc0944e0a1bc406286c63
# ClangFormat: apply to source, most of intern
e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1
# Code Style: use "#pragma once" in source directory
91694b9b58ab953f3b313be9389cc1303e472fc2
# Code Style: use "#pragma once" in some newer headers
8198dbb888856b8c11757586df02aca15f132f90
# Code Style: use "#pragma once" in intern/ghost
1b1129f82a9cf316b54fbc025f8cfcc1a74b8589
# Cleanup: mostly comments, use doxy syntax & typos
e0cb02587012b4b2f4b18363dc7d0a7da2c02093
# Cleanup: use C comments for descriptive text
2abfcebb0eb7989e3d1e7d03f37ecf5c088210af
# use lowercase for cmake builtin names and macros, remove contents in else() and endif() which is no longer needed.
afacd184982e58a9c830a3d5366e25983939a7ba
# Spelling: It's Versus Its
3a7fd309fce89213b0224b3c6807adb2d1fe7ca8
# Spelling: Then Versus Than
d1eefc421544e2ea632fb35cb6bcaade4c39ce6b
# Spelling: Miscellaneous
84ef3b80de4915a24a9fd2fd214d0fa44e59b854
# Spelling: Loose Versus Lose
c0a6bc19794c69843c38451c762e91bc10136e0f
# Spelling: Apart Versus A Part
3d26cd01b9ba6381eb165e11536345ae652dfb41
# Cleanup: use 2 space indentation for CMake
3076d95ba441cd32706a27d18922a30f8fd28b8a
# Cleanup: use over-line for doxy comments
4b188bb08cf5aaae3c68ab57bbcfa037eef1ac10
# Cleanup: General comment style clean up of graph_edit.c and fcurve.c
0105f146bb40bd609ccbda3d3f6aeb8e14ad3f9e
# Cleanup: pep8 (indentation, spacing, long lines)
41d2d6da0c96d351b47acb64d3e0decdba16cb16
# Cleanup: pep8, blank lines
bab9de2a52929fe2b45ecddb1eb09da3378e303b
# Cleanup: PEP8 for python changes
1e7e94588daa66483190f45a9de5e98228f80e05
# GPencil: Cleanup pep8
a09cc3ee1a99f2cd5040bbf30c8ab8c588bb2bb1
# Cleanup: trailing space, remove tabs, pep8
c42a6b77b52560d257279de2cb624b4ef2c0d24c
# Cleanup: use C style doxygen comments
8c1726918374e1d2d2123e17bae8db5aadde3433
# Cleanup: use doxy sections for imbuf
c207f7c22e1439e0b285fba5d2c072bdae23f981
# Cleanup: clang-format
c4d8f6a4a8ddc29ed27311ed7578b3c8c31399d2
b5d310b569e07a937798a2d38539cfd290149f1c
8c846cccd6bdfd3e90a695fabbf05f53e5466a57
4eac03d821fa17546f562485f7d073813a5e5943
1166110a9d66af9c5a47cee2be591f50fdc445e8
# Cleanup: clang-format.
40d4a4cb1a6b4c3c2a486e8f2868f547530e0811

View File

@@ -1,41 +0,0 @@
name: Bug Report
about: File a bug report
labels:
- bug
body:
- type: markdown
attributes:
value: |
### Instructions
First time reporting? See [tips](https://wiki.blender.org/wiki/Process/Bug_Reports) and [walkthrough video](https://www.youtube.com/watch?v=JTD0OJq_rF4).
* Use **Help > Report a Bug** in Blender to fill system information and exact Blender version.
* Test [daily builds](https://builder.blender.org/) to verify if the issue is already fixed.
* Test [previous versions](https://download.blender.org/release/) to find an older working version.
* For feature requests, feedback, questions or build issues, see [communication channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
* If there are multiple bugs, make multiple bug reports.
- type: textarea
id: body
attributes:
label: "Description"
value: |
**System Information**
Operating system:
Graphics card:
**Blender Version**
Broken: (example: 2.80, edbf15d3c044, master, 2018-11-28, as found on the splash screen)
Worked: (newest version of Blender that worked as expected)
**Short description of error**
**Exact steps for others to reproduce the error**
Based on the default startup or an attached .blend file (as simple as possible).
- type: markdown
attributes:
value: |
### Help the developers
Bug fixing is important, the developers will handle reports swiftly. For that reason, carefully provide exact steps and a **small and simple .blend file** to reproduce the problem. You do your half of the work, then we do our half!

View File

@@ -1 +0,0 @@
blank_issues_enabled: false

View File

@@ -1,9 +0,0 @@
name: Design
about: Create a design task (for developers only)
labels:
- design
body:
- type: textarea
id: body
attributes:
label: "Description"

View File

@@ -1,9 +0,0 @@
name: To Do
about: Create a to do task (for developers only)
labels:
- todo
body:
- type: textarea
id: body
attributes:
label: "Description"

View File

@@ -1,20 +0,0 @@
name: Pull Request
about: Contribute code to Blender
body:
- type: markdown
attributes:
value: |
### Instructions
Guides to [contributing code](https://wiki.blender.org/index.php/Dev:Doc/Process/Contributing_Code) and effective [code review](https://wiki.blender.org/index.php/Dev:Doc/Tools/Code_Review).
By submitting code here, you agree that the code is (compatible with) GNU GPL v2 or later.
- type: textarea
id: body
attributes:
label: "Description"
value: |
Description of the problem that is addressed in the patch.
Description of the proposed solution and its implementation.

View File

@@ -1,5 +0,0 @@
This repository is only used as a mirror of git.blender.org. Blender development happens on
https://developer.blender.org.
To get started with contributing code, please see:
https://wiki.blender.org/wiki/Process/Contributing_Code

3
.gitignore vendored
View File

@@ -46,6 +46,3 @@ Desktop.ini
# smoke simulation noise tile (generated) # smoke simulation noise tile (generated)
waveletNoiseTile.bin waveletNoiseTile.bin
# testing environment
/Testing

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,23 @@
# SPDX-License-Identifier: GPL-2.0-or-later # -*- mode: gnumakefile; tab-width: 4; indent-tabs-mode: t; -*-
# vim: tabstop=4
#
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# This Makefile does an out-of-source CMake build in ../build_`OS`_`CPU` # This Makefile does an out-of-source CMake build in ../build_`OS`_`CPU`
# eg: # eg:
@@ -7,33 +26,25 @@
define HELP_TEXT define HELP_TEXT
Blender Convenience Targets Convenience Targets
Provided for building Blender (multiple targets can be used at once). Provided for building Blender, (multiple at once can be used).
* debug: Build a debug binary. * debug: Build a debug binary.
* full: Enable all supported dependencies & options. * full: Enable all supported dependencies & options.
* lite: Disable non essential features for a smaller binary and faster build. * lite: Disable non essential features for a smaller binary and faster build.
* release: Complete build with all options enabled including CUDA and Optix, matching the releases on blender.org * release Complete build with all options enabled including CUDA and Optix, matching the releases on blender.org
* headless: Build without an interface (renderfarm or server automation). * headless: Build without an interface (renderfarm or server automation).
* cycles: Build Cycles standalone only, without Blender. * cycles: Build Cycles standalone only, without Blender.
* bpy: Build as a python module which can be loaded from python directly. * bpy: Build as a python module which can be loaded from python directly.
* developer: Enable faster builds, error checking and tests, recommended for developers. * deps: Build library dependencies (intended only for platform maintainers).
* ninja: Use ninja build tool for faster builds.
* ccache: Use ccache for faster rebuilds. * developer: Enable faster builds, error checking and tests, recommended for developers.
* config: Run cmake configuration tool to set build options.
* ninja: Use ninja build tool for faster builds.
Note: when passing in multiple targets their order is not important.
So for a fast build you can for e.g. run 'make lite ccache ninja'.
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir. Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments. Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
Other Convenience Targets
Provided for other building operations.
* config: Run cmake configuration tool to set build options.
* deps: Build library dependencies (intended only for platform maintainers).
The existence of locally build dependencies overrides the pre-built dependencies from subversion.
These must be manually removed from '../lib/' to go back to using the pre-compiled libraries.
Project Files Project Files
Generate project files for development environments. Generate project files for development environments.
@@ -44,43 +55,41 @@ Project Files
Package Targets Package Targets
* package_archive: Build an archive package. * package_debian: Build a debian package.
* package_pacman: Build an arch linux pacman package.
* package_archive: Build an archive package.
Testing Targets Testing Targets
Not associated with building Blender. Not associated with building Blender.
* test: * test:
Run automated tests with ctest. Run automated tests with ctest.
* test_cmake:
Runs our own cmake file checker
which detects errors in the cmake file list definitions
* test_pep8:
Checks all python script are pep8
which are tagged to use the stricter formatting
* test_deprecated:
Checks for deprecation tags in our code which may need to be removed
Static Source Code Checking Static Source Code Checking
Not associated with building Blender. Not associated with building Blender.
* check_cppcheck: Run blender source through cppcheck (C & C++). * check_cppcheck: Run blender source through cppcheck (C & C++).
* check_clang_array: Run blender source through clang array checking script (C & C++). * check_clang_array: Run blender source through clang array checking script (C & C++).
* check_deprecated: Check if there is any deprecated code to remove.
* check_splint: Run blenders source through splint (C only). * check_splint: Run blenders source through splint (C only).
* check_sparse: Run blenders source through sparse (C only). * check_sparse: Run blenders source through sparse (C only).
* check_smatch: Run blenders source through smatch (C only). * check_smatch: Run blenders source through smatch (C only).
* check_descriptions: Check for duplicate/invalid descriptions. * check_descriptions: Check for duplicate/invalid descriptions.
* check_licenses: Check license headers follow the SPDX license specification,
using one of the accepted licenses in 'doc/license/SPDX-license-identifiers.txt'
Append with 'SHOW_HEADERS=1' to show all unique headers
which can be useful for spotting license irregularities.
* check_cmake: Runs our own cmake file checker which detects errors in the cmake file list definitions.
* check_pep8: Checks all Python script are pep8 which are tagged to use the stricter formatting.
* check_mypy: Checks all Python scripts using mypy,
see: source/tools/check_source/check_mypy_config.py scripts which are included.
Spell Checkers Spell Checkers
This runs the spell checker from the developer tools repositor.
* check_spelling_c: Check for spelling errors (C/C++ only), * check_spelling_c: Check for spelling errors (C/C++ only),
* check_spelling_osl: Check for spelling errors (OSL only). * check_spelling_osl: Check for spelling errors (OSL only).
* check_spelling_py: Check for spelling errors (Python only). * check_spelling_py: Check for spelling errors (Python only).
Note: an additional word-list is maintained at: 'source/tools/check_source/check_spelling_c_config.py' Note that spell checkers can tak a 'CHECK_SPELLING_CACHE' filepath argument,
Note: that spell checkers can take a 'CHECK_SPELLING_CACHE' filepath argument,
so re-running does not need to re-check unchanged files. so re-running does not need to re-check unchanged files.
Example: Example:
@@ -110,17 +119,11 @@ Utilities
* source_archive: * source_archive:
Create a compressed archive of the source code. Create a compressed archive of the source code.
* source_archive_complete:
Create a compressed archive of the source code and all the libraries of dependencies.
* update: * update:
Updates git and all submodules and svn. updates git and all submodules
* update_code: * format
Updates git and all submodules but not svn. Format source code using clang (uses PATHS if passed in). For example::
* format:
Format source code using clang-format & autopep8 (uses PATHS if passed in). For example::
make format PATHS="source/blender/blenlib source/blender/blenkernel" make format PATHS="source/blender/blenlib source/blender/blenkernel"
@@ -130,7 +133,6 @@ Environment Variables
* BUILD_DIR: Override default build path. * BUILD_DIR: Override default build path.
* PYTHON: Use this for the Python command (used for checking tools). * PYTHON: Use this for the Python command (used for checking tools).
* NPROCS: Number of processes to use building (auto-detect when omitted). * NPROCS: Number of processes to use building (auto-detect when omitted).
* AUTOPEP8: Command used for Python code-formatting (used for the format target).
Documentation Targets Documentation Targets
Not associated with building Blender. Not associated with building Blender.
@@ -150,7 +152,7 @@ endef
# This makefile is not meant for Windows # This makefile is not meant for Windows
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
$(error On Windows, use "cmd //c make.bat" instead of "make") $(error On Windows, use "cmd //c make.bat" instead of "make")
endif endif
# System Vars # System Vars
@@ -162,7 +164,6 @@ CPU:=$(shell uname -m)
# Source and Build DIR's # Source and Build DIR's
BLENDER_DIR:=$(shell pwd -P) BLENDER_DIR:=$(shell pwd -P)
BUILD_TYPE:=Release BUILD_TYPE:=Release
BLENDER_IS_PYTHON_MODULE:=
# CMake arguments, assigned to local variable to make it mutable. # CMake arguments, assigned to local variable to make it mutable.
CMAKE_CONFIG_ARGS := $(BUILD_CMAKE_ARGS) CMAKE_CONFIG_ARGS := $(BUILD_CMAKE_ARGS)
@@ -181,13 +182,8 @@ endif
ifndef DEPS_INSTALL_DIR ifndef DEPS_INSTALL_DIR
DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE) DEPS_INSTALL_DIR:=$(shell dirname "$(BLENDER_DIR)")/lib/$(OS_NCASE)
# Add processor type to directory name, except for darwin x86_64 ifneq ($(OS_NCASE),darwin)
# which by convention does not have it. # Add processor type to directory name
ifeq ($(OS_NCASE),darwin)
ifneq ($(CPU),x86_64)
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
endif
else
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU) DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
endif endif
endif endif
@@ -201,47 +197,17 @@ endif
# in libraries, or python 2 for running make update to get it. # in libraries, or python 2 for running make update to get it.
ifeq ($(OS_NCASE),darwin) ifeq ($(OS_NCASE),darwin)
ifeq (, $(shell command -v $(PYTHON))) ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=$(DEPS_INSTALL_DIR)/python/bin/python3.10 PYTHON:=../lib/darwin/python/bin/python3.7m
ifeq (, $(shell command -v $(PYTHON))) ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=python PYTHON:=python
endif endif
endif endif
endif endif
# Set the LIBDIR, an empty string when not found.
LIBDIR:=$(wildcard ../lib/${OS_NCASE}_${CPU})
ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard ../lib/${OS_NCASE}_${CPU}_glibc_228)
endif
ifeq (, $(LIBDIR))
LIBDIR:=$(wildcard ../lib/${OS_NCASE})
endif
# Use the autopep8 module in ../lib/ (which can be executed via Python directly).
# Otherwise the "autopep8" command can be used.
ifndef AUTOPEP8
ifneq (, $(LIBDIR))
AUTOPEP8:=$(wildcard $(LIBDIR)/python/lib/python3.10/site-packages/autopep8.py)
endif
ifeq (, $(AUTOPEP8))
AUTOPEP8:=autopep8
endif
endif
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Additional targets for the build configuration # additional targets for the build configuration
# NOTE: These targets can be combined and are applied in reverse order listed here. # support 'make debug'
# So it's important that `bpy` comes before `release` (for example)
# `make bpy release` first loads `release` configuration, then `bpy`.
# This is important as `bpy` will turn off some settings enabled by release.
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake" $(CMAKE_CONFIG_ARGS)
BLENDER_IS_PYTHON_MODULE:=1
endif
ifneq "$(findstring debug, $(MAKECMDGOALS))" "" ifneq "$(findstring debug, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_debug BUILD_DIR:=$(BUILD_DIR)_debug
BUILD_TYPE:=Debug BUILD_TYPE:=Debug
@@ -266,15 +232,15 @@ ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_headless BUILD_DIR:=$(BUILD_DIR)_headless
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake" $(CMAKE_CONFIG_ARGS) CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake" $(CMAKE_CONFIG_ARGS)
endif endif
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/bpy_module.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring developer, $(MAKECMDGOALS))" "" ifneq "$(findstring developer, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS) CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_developer.cmake" $(CMAKE_CONFIG_ARGS)
endif endif
ifneq "$(findstring ccache, $(MAKECMDGOALS))" ""
CMAKE_CONFIG_ARGS:=-DWITH_COMPILER_CCACHE=YES $(CMAKE_CONFIG_ARGS)
endif
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# build tool # build tool
@@ -303,10 +269,8 @@ endif
# use the default build path can still use utility helpers. # use the default build path can still use utility helpers.
ifeq ($(OS), Darwin) ifeq ($(OS), Darwin)
BLENDER_BIN?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender" BLENDER_BIN?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender"
BLENDER_BIN_DIR?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender"
else else
BLENDER_BIN?="$(BUILD_DIR)/bin/blender" BLENDER_BIN?="$(BUILD_DIR)/bin/blender"
BLENDER_BIN_DIR?="$(BUILD_DIR)/bin"
endif endif
@@ -338,7 +302,7 @@ CMAKE_CONFIG = cmake $(CMAKE_CONFIG_ARGS) \
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Tool for 'make config' # Tool for 'make config'
# X11 specific. # X11 spesific
ifdef DISPLAY ifdef DISPLAY
CMAKE_CONFIG_TOOL = cmake-gui CMAKE_CONFIG_TOOL = cmake-gui
else else
@@ -363,12 +327,8 @@ all: .FORCE
@echo Building Blender ... @echo Building Blender ...
$(BUILD_COMMAND) -C "$(BUILD_DIR)" -j $(NPROCS) install $(BUILD_COMMAND) -C "$(BUILD_DIR)" -j $(NPROCS) install
@echo @echo
@echo Edit build configuration with: \"$(BUILD_DIR)/CMakeCache.txt\" run make again to rebuild. @echo edit build configuration with: "$(BUILD_DIR)/CMakeCache.txt" run make again to rebuild.
@if test -z "$(BLENDER_IS_PYTHON_MODULE)"; then \ @echo Blender successfully built, run from: $(BLENDER_BIN)
echo Blender successfully built, run from: $(BLENDER_BIN); \
else \
echo Blender successfully built as a Python module, \"bpy\" can be imported from: $(BLENDER_BIN_DIR); \
fi
@echo @echo
debug: all debug: all
@@ -380,7 +340,6 @@ headless: all
bpy: all bpy: all
developer: all developer: all
ninja: all ninja: all
ccache: all
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Build dependencies # Build dependencies
@@ -395,7 +354,7 @@ deps: .FORCE
@cmake -H"$(DEPS_SOURCE_DIR)" \ @cmake -H"$(DEPS_SOURCE_DIR)" \
-B"$(DEPS_BUILD_DIR)" \ -B"$(DEPS_BUILD_DIR)" \
-DHARVEST_TARGET=$(DEPS_INSTALL_DIR) -DHARVEST_TARGET=$(DEPS_INSTALL_DIR)
@echo @echo
@echo Building dependencies ... @echo Building dependencies ...
@@ -419,6 +378,11 @@ help: .FORCE
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Packages # Packages
# #
package_debian: .FORCE
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
package_pacman: .FORCE
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg
package_archive: .FORCE package_archive: .FORCE
make -C "$(BUILD_DIR)" -s package_archive make -C "$(BUILD_DIR)" -s package_archive
@@ -429,7 +393,21 @@ package_archive: .FORCE
# Tests # Tests
# #
test: .FORCE test: .FORCE
@$(PYTHON) ./build_files/utils/make_test.py "$(BUILD_DIR)" $(PYTHON) ./build_files/utils/make_test.py "$(BUILD_DIR)"
# run pep8 check check on scripts we distribute.
test_pep8: .FORCE
$(PYTHON) tests/python/pep8.py > test_pep8.log 2>&1
@echo "written: test_pep8.log"
# run some checks on our cmakefiles.
test_cmake: .FORCE
$(PYTHON) build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1
@echo "written: test_cmake_consistency.log"
# run deprecation tests, see if we have anything to remove.
test_deprecated: .FORCE
$(PYTHON) tests/check_deprecated.py
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@@ -451,44 +429,40 @@ project_eclipse: .FORCE
# #
check_cppcheck: .FORCE check_cppcheck: .FORCE
@$(CMAKE_CONFIG) $(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
$(PYTHON) \ $(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
"$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
"$(BLENDER_DIR)/check_cppcheck.txt" "$(BLENDER_DIR)/check_cppcheck.txt"
@echo "written: check_cppcheck.txt" @echo "written: check_cppcheck.txt"
check_clang_array: .FORCE check_clang_array: .FORCE
@$(CMAKE_CONFIG) $(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py" $(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
check_splint: .FORCE check_splint: .FORCE
@$(CMAKE_CONFIG) $(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py" $(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
check_sparse: .FORCE check_sparse: .FORCE
@$(CMAKE_CONFIG) $(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py" $(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
check_smatch: .FORCE check_smatch: .FORCE
@$(CMAKE_CONFIG) $(CMAKE_CONFIG)
@cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py" $(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_mypy: .FORCE
@$(PYTHON) "$(BLENDER_DIR)/source/tools/check_source/check_mypy.py"
check_spelling_py: .FORCE check_spelling_py: .FORCE
@cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \ PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \ "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/release/scripts" "$(BLENDER_DIR)/release/scripts"
check_spelling_c: .FORCE check_spelling_c: .FORCE
@cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 $(PYTHON) \ PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \ "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \ --cache-file=$(CHECK_SPELLING_CACHE) \
@@ -498,71 +472,40 @@ check_spelling_c: .FORCE
"$(BLENDER_DIR)/intern/ghost" \ "$(BLENDER_DIR)/intern/ghost" \
check_spelling_osl: .FORCE check_spelling_osl: .FORCE
@cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ;\
PYTHONIOENCODING=utf_8 $(PYTHON) \ PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \ "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
--cache-file=$(CHECK_SPELLING_CACHE) \ --cache-file=$(CHECK_SPELLING_CACHE) \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" "$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions: .FORCE check_descriptions: .FORCE
@$(BLENDER_BIN) --background -noaudio --factory-startup --python \ $(BLENDER_BIN) --background -noaudio --factory-startup --python \
"$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py" "$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
check_deprecated: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
source/tools/check_source/check_deprecated.py
check_licenses: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_licenses.py" \
"--show-headers=$(SHOW_HEADERS)"
check_pep8: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
tests/python/pep8.py
check_cmake: .FORCE
@PYTHONIOENCODING=utf_8 $(PYTHON) \
source/tools/check_source/check_cmake_consistency.py
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Utilities # Utilities
# #
source_archive: .FORCE source_archive: .FORCE
@$(PYTHON) ./build_files/utils/make_source_archive.py ./build_files/utils/make_source_archive.sh
source_archive_complete: .FORCE
@cmake \
-S "$(BLENDER_DIR)/build_files/build_environment" -B"$(BUILD_DIR)/source_archive" \
-DCMAKE_BUILD_TYPE_INIT:STRING=$(BUILD_TYPE) -DPACKAGE_USE_UPSTREAM_SOURCES=OFF
# This assumes CMake is still using a default `PACKAGE_DIR` variable:
@$(PYTHON) ./build_files/utils/make_source_archive.py --include-packages "$(BUILD_DIR)/source_archive/packages"
INKSCAPE_BIN?="inkscape" INKSCAPE_BIN?="inkscape"
icons: .FORCE icons: .FORCE
@BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \ BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py" "$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
@INKSCAPE_BIN=$(INKSCAPE_BIN) \ BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py" "$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
@INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/alert_icons_update.py"
icons_geom: .FORCE icons_geom: .FORCE
@BLENDER_BIN=$(BLENDER_BIN) \ BLENDER_BIN=$(BLENDER_BIN) \
"$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py" "$(BLENDER_DIR)/release/datafiles/blender_icons_geom_update.py"
update: .FORCE update: .FORCE
@$(PYTHON) ./build_files/utils/make_update.py $(PYTHON) ./build_files/utils/make_update.py
update_code: .FORCE
@$(PYTHON) ./build_files/utils/make_update.py --no-libraries
format: .FORCE format: .FORCE
@PATH="${LIBDIR}/llvm/bin/:$(PATH)" $(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS) PATH="../lib/${OS_NCASE}_${CPU}/llvm/bin/:../lib/${OS_NCASE}_centos7_${CPU}/llvm/bin/:../lib/${OS_NCASE}/llvm/bin/:$(PATH)" \
@$(PYTHON) source/tools/utils_maintenance/autopep8_format_paths.py --autopep8-command="$(AUTOPEP8)" $(PATHS) $(PYTHON) source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@@ -571,25 +514,23 @@ format: .FORCE
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation. # Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py: .FORCE doc_py: .FORCE
@ASAN_OPTIONS=halt_on_error=0:${ASAN_OPTIONS} \ ASAN_OPTIONS=halt_on_error=0 \
$(BLENDER_BIN) \ $(BLENDER_BIN) --background -noaudio --factory-startup \
--background -noaudio --factory-startup \ --python doc/python_api/sphinx_doc_gen.py
--python doc/python_api/sphinx_doc_gen.py cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
@sphinx-build -b html -j $(NPROCS) doc/python_api/sphinx-in doc/python_api/sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'" @echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/index.html'"
doc_doxy: .FORCE doc_doxy: .FORCE
@cd doc/doxygen; doxygen Doxyfile cd doc/doxygen; doxygen Doxyfile
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'" @echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna: .FORCE doc_dna: .FORCE
@$(BLENDER_BIN) \ $(BLENDER_BIN) --background -noaudio --factory-startup \
--background -noaudio --factory-startup \ --python doc/blender_file_format/BlendFileDnaExporter_25.py
--python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'" @echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man: .FORCE doc_man: .FORCE
@$(PYTHON) doc/manpage/blender.1.py --blender="$(BLENDER_BIN)" --output=blender.1 --verbose $(PYTHON) doc/manpage/blender.1.py $(BLENDER_BIN) blender.1
help_features: .FORCE help_features: .FORCE
@$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_print_build_options.py" $(BLENDER_DIR)"/CMakeLists.txt" @$(PYTHON) "$(BLENDER_DIR)/build_files/cmake/cmake_print_build_options.py" $(BLENDER_DIR)"/CMakeLists.txt"

View File

@@ -1,38 +0,0 @@
<!--
Keep this document short & concise,
linking to external resources instead of including content in-line.
See 'release/text/readme.html' for the end user read-me.
-->
Blender
=======
Blender is the free and open source 3D creation suite.
It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing,
motion tracking and video editing.
![Blender screenshot](https://code.blender.org/wp-content/uploads/2018/12/springrg.jpg "Blender screenshot")
Project Pages
-------------
- [Main Website](http://www.blender.org)
- [Reference Manual](https://docs.blender.org/manual/en/latest/index.html)
- [User Community](https://www.blender.org/community/)
Development
-----------
- [Build Instructions](https://wiki.blender.org/wiki/Building_Blender)
- [Code Review & Bug Tracker](https://developer.blender.org)
- [Developer Forum](https://devtalk.blender.org)
- [Developer Documentation](https://wiki.blender.org)
License
-------
Blender as a whole is licensed under the GNU General Public License, Version 3.
Individual files may have a different, but compatible license.
See [blender.org/about/license](https://www.blender.org/about/license) for details.

View File

@@ -1,6 +1,22 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
################################################################################################## ####################################################################################################
# #
# This is a build system used by platform maintainers to build library dependencies on # This is a build system used by platform maintainers to build library dependencies on
# Windows, macOS and Linux. # Windows, macOS and Linux.
@@ -14,124 +30,91 @@
# build_deps 2015 x64 / build_deps 2015 x86 # build_deps 2015 x64 / build_deps 2015 x86
# #
# MAC OS X USAGE: # MAC OS X USAGE:
# Install with homebrew: brew install autoconf automake bison cmake libtool pkg-config yasm # Install with homebrew: brew install cmake autoconf automake libtool yasm nasm bison
# Additional requirements for macOS arm64: brew install flex
# Run "make deps" from main Blender directory # Run "make deps" from main Blender directory
# #
# LINUX USAGE: # LINUX USAGE:
# Install compiler cmake autoconf automake libtool yasm tcl # Install compiler cmake autoconf automake libtool yasm nasm tcl
# Run "make deps" from main Blender directory # Run "make deps" from main Blender directory
# #
################################################################################################## ####################################################################################################
project("BlenderDependencies") project("BlenderDependencies")
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW) # CMake 3.24+ Set the date/time for extracted files to time of extraction
endif()
include(ExternalProject) include(ExternalProject)
include(cmake/check_software.cmake) include(cmake/check_software.cmake)
include(cmake/options.cmake) include(cmake/options.cmake)
# `versions.cmake` needs to be included after `options.cmake`
# due to the `BLENDER_PLATFORM_ARM` variable being needed.
include(cmake/versions.cmake) include(cmake/versions.cmake)
include(cmake/boost_build_options.cmake)
include(cmake/download.cmake)
include(cmake/macros.cmake)
if(ENABLE_MINGW64) if(ENABLE_MINGW64)
include(cmake/setup_mingw64.cmake) include(cmake/setup_mingw64.cmake)
else() else()
set(mingw_LIBDIR ${LIBDIR}) set(mingw_LIBDIR ${LIBDIR})
endif() endif()
include(cmake/ssl.cmake)
include(cmake/zlib.cmake) include(cmake/zlib.cmake)
include(cmake/zstd.cmake)
include(cmake/openal.cmake) include(cmake/openal.cmake)
include(cmake/png.cmake) include(cmake/png.cmake)
include(cmake/jpeg.cmake) include(cmake/jpeg.cmake)
include(cmake/blosc.cmake) include(cmake/blosc.cmake)
include(cmake/pthreads.cmake) include(cmake/pthreads.cmake)
include(cmake/imath.cmake)
include(cmake/openexr.cmake) include(cmake/openexr.cmake)
include(cmake/brotli.cmake)
include(cmake/freetype.cmake) include(cmake/freetype.cmake)
include(cmake/epoxy.cmake)
include(cmake/freeglut.cmake) include(cmake/freeglut.cmake)
include(cmake/glew.cmake)
include(cmake/alembic.cmake) include(cmake/alembic.cmake)
include(cmake/glfw.cmake)
include(cmake/clew.cmake)
include(cmake/cuew.cmake)
include(cmake/opensubdiv.cmake) include(cmake/opensubdiv.cmake)
include(cmake/sdl.cmake) include(cmake/sdl.cmake)
include(cmake/opencollada.cmake) include(cmake/opencollada.cmake)
include(cmake/opencolorio.cmake)
include(cmake/llvm.cmake)
include(cmake/clang.cmake)
if(APPLE) if(APPLE)
include(cmake/openmp.cmake) include(cmake/openmp.cmake)
endif()
if(UNIX)
include(cmake/nasm.cmake) include(cmake/nasm.cmake)
endif() endif()
include(cmake/openimageio.cmake)
include(cmake/tiff.cmake) include(cmake/tiff.cmake)
if(WIN32) include(cmake/flexbison.cmake)
include(cmake/flexbison.cmake)
elseif(UNIX AND NOT APPLE)
include(cmake/flex.cmake)
endif()
include(cmake/tbb.cmake)
include(cmake/python.cmake)
include(cmake/llvm.cmake)
include(cmake/osl.cmake) include(cmake/osl.cmake)
option(USE_PIP_NUMPY "Install NumPy using pip wheel instead of building from source" OFF) include(cmake/tbb.cmake)
if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")) include(cmake/openvdb.cmake)
set(USE_PIP_NUMPY ON) include(cmake/python.cmake)
else()
include(cmake/numpy.cmake)
endif()
include(cmake/python_site_packages.cmake) include(cmake/python_site_packages.cmake)
include(cmake/package_python.cmake) include(cmake/package_python.cmake)
include(cmake/openimageio.cmake) include(cmake/numpy.cmake)
include(cmake/usd.cmake) include(cmake/usd.cmake)
include(cmake/materialx.cmake) # Boost needs to be included after python.cmake due to the PYTHON_BINARY variable being needed.
include(cmake/openvdb.cmake)
include(cmake/potrace.cmake)
include(cmake/haru.cmake)
# Boost needs to be included after `python.cmake` due to the PYTHON_BINARY variable being needed.
include(cmake/boost.cmake) include(cmake/boost.cmake)
include(cmake/pugixml.cmake) if(UNIX)
include(cmake/ispc.cmake) # Rely on PugiXML compiled with OpenImageIO
include(cmake/openimagedenoise.cmake) else()
include(cmake/embree.cmake) include(cmake/pugixml.cmake)
include(cmake/openpgl.cmake) endif()
include(cmake/fmt.cmake) if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
include(cmake/robinmap.cmake) include(cmake/ispc.cmake)
include(cmake/xml2.cmake) include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
include(cmake/fribidi.cmake) endif()
include(cmake/harfbuzz.cmake)
if(NOT APPLE) if(NOT APPLE)
include(cmake/xr_openxr.cmake) include(cmake/xr_openxr.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
include(cmake/dpcpp.cmake)
include(cmake/dpcpp_deps.cmake)
endif()
if(NOT WIN32)
include(cmake/igc.cmake)
include(cmake/gmmlib.cmake)
include(cmake/ocloc.cmake)
endif()
endif() endif()
# OpenColorIO and dependencies. if(WITH_WEBP)
include(cmake/expat.cmake) include(cmake/webp.cmake)
include(cmake/pystring.cmake)
include(cmake/yamlcpp.cmake)
include(cmake/minizipng.cmake)
include(cmake/opencolorio.cmake)
if(BLENDER_PLATFORM_ARM)
include(cmake/sse2neon.cmake)
endif() endif()
include(cmake/webp.cmake) if(WIN32)
if(NOT APPLE) # OCIO deps
include(cmake/level-zero.cmake) include(cmake/tinyxml.cmake)
include(cmake/yamlcpp.cmake)
# LCMS is an OCIO dep, but only if you build the apps, leaving it here for convenience
# include(cmake/lcms.cmake)
endif() endif()
if(NOT WIN32 OR ENABLE_MINGW64) if(NOT WIN32 OR ENABLE_MINGW64)
@@ -149,7 +132,6 @@ if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/vpx.cmake) include(cmake/vpx.cmake)
include(cmake/x264.cmake) include(cmake/x264.cmake)
include(cmake/xvidcore.cmake) include(cmake/xvidcore.cmake)
include(cmake/aom.cmake)
include(cmake/ffmpeg.cmake) include(cmake/ffmpeg.cmake)
include(cmake/fftw.cmake) include(cmake/fftw.cmake)
include(cmake/sndfile.cmake) include(cmake/sndfile.cmake)
@@ -158,6 +140,7 @@ if(NOT WIN32 OR ENABLE_MINGW64)
endif() endif()
if(UNIX) if(UNIX)
include(cmake/flac.cmake) include(cmake/flac.cmake)
include(cmake/xml2.cmake)
if(NOT APPLE) if(NOT APPLE)
include(cmake/spnav.cmake) include(cmake/spnav.cmake)
include(cmake/jemalloc.cmake) include(cmake/jemalloc.cmake)
@@ -170,20 +153,13 @@ if(UNIX)
include(cmake/bzip2.cmake) include(cmake/bzip2.cmake)
include(cmake/ffi.cmake) include(cmake/ffi.cmake)
include(cmake/lzma.cmake) include(cmake/lzma.cmake)
include(cmake/ssl.cmake)
include(cmake/sqlite.cmake) include(cmake/sqlite.cmake)
endif() endif()
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
include(cmake/libglu.cmake) include(cmake/libglu.cmake)
include(cmake/mesa.cmake) include(cmake/mesa.cmake)
include(cmake/wayland_protocols.cmake)
# Can be removed when the build-bot upgrades to v1.20.x or newer.
include(cmake/wayland.cmake)
include(cmake/wayland_libdecor.cmake)
endif() endif()
include(cmake/shaderc_deps.cmake)
include(cmake/shaderc.cmake)
include(cmake/vulkan.cmake)
include(cmake/pybind11.cmake)
include(cmake/harvest.cmake) include(cmake/harvest.cmake)
include(cmake/cve_check.cmake)

View File

@@ -1,23 +1,62 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(ALEMBIC_EXTRA_ARGS set(ALEMBIC_EXTRA_ARGS
-DImath_ROOT=${LIBDIR}/imath -DBUILDSTATIC=ON
-DUSE_PYALEMBIC=OFF -DLINKSTATIC=ON
-DUSE_ARNOLD=OFF -DALEMBIC_LIB_USES_BOOST=ON
-DUSE_MAYA=OFF -DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DUSE_PRMAN=OFF -DBoost_USE_MULTITHREADED=ON
-DUSE_HDF5=OFF -DUSE_STATIC_BOOST=On
-DUSE_TESTS=OFF -DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBoost_DEBUG=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DILMBASE_ROOT=${LIBDIR}/openexr
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/openexr/include/OpenEXR
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_IMATH_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_ILMTHREAD_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_IEX_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DALEMBIC_ILMBASE_IEXMATH_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}IexMath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DUSE_PYILMBASE=0
-DUSE_PYALEMBIC=0
-DUSE_ARNOLD=0
-DUSE_MAYA=0
-DUSE_PRMAN=0
-DUSE_HDF5=Off
-DUSE_STATIC_HDF5=Off
-DUSE_TESTS=Off
-DALEMBIC_NO_OPENGL=1
-DUSE_BINARIES=ON -DUSE_BINARIES=ON
-DALEMBIC_ILMBASE_LINK_STATIC=OFF -DALEMBIC_ILMBASE_LINK_STATIC=On
-DALEMBIC_SHARED_LIBS=OFF -DALEMBIC_SHARED_LIBS=OFF
-DGLUT_INCLUDE_DIR=""
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
) )
ExternalProject_Add(external_alembic ExternalProject_Add(external_alembic
URL file://${PACKAGE_DIR}/${ALEMBIC_FILE} URL ${ALEMBIC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ALEMBIC_HASH_TYPE}=${ALEMBIC_HASH} URL_HASH MD5=${ALEMBIC_MD5}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/alembic PREFIX ${BUILD_DIR}/alembic
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/alembic -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ALEMBIC_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/alembic -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ALEMBIC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/alembic INSTALL_DIR ${LIBDIR}/alembic
@@ -42,5 +81,7 @@ endif()
add_dependencies( add_dependencies(
external_alembic external_alembic
external_imath external_boost
external_zlib
external_openexr
) )

View File

@@ -1,41 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
# The default generator on windows is msbuild, which we do not
# want to use for this dep, as needs to build with mingw
set(AOM_GENERATOR "Ninja")
# The default flags are full of MSVC options given this will be
# building with mingw, it'll have an unhappy time with that and
# we need to clear them out.
set(AOM_CMAKE_FLAGS )
else()
set(AOM_GENERATOR "Unix Makefiles")
set(AOM_CMAKE_FLAGS ${DEFAULT_CMAKE_FLAGS})
endif()
set(AOM_EXTRA_ARGS
-DENABLE_TESTDATA=OFF
-DENABLE_TESTS=OFF
-DENABLE_TOOLS=OFF
-DENABLE_EXAMPLES=OFF
${AOM_EXTRA_ARGS_WIN32}
)
# This is slightly different from all other deps in the way that
# aom uses cmake as a build system, but still needs the environment setup
# to include perl so we manually setup the environment and call
# cmake directly for the configure, build and install commands.
ExternalProject_Add(external_aom
URL file://${PACKAGE_DIR}/${AOM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${AOM_HASH_TYPE}=${AOM_HASH}
PREFIX ${BUILD_DIR}/aom
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/aom/src/external_aom < ${PATCH_DIR}/aom.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/aom/src/external_aom-build/ &&
${CMAKE_COMMAND} -G "${AOM_GENERATOR}" -DCMAKE_INSTALL_PREFIX=${LIBDIR}/aom ${AOM_CMAKE_FLAGS} ${AOM_EXTRA_ARGS} ${BUILD_DIR}/aom/src/external_aom/
BUILD_COMMAND ${CMAKE_COMMAND} --build .
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install
INSTALL_DIR ${LIBDIR}/aom
)

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(BLOSC_EXTRA_ARGS set(BLOSC_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
@@ -13,17 +29,18 @@ set(BLOSC_EXTRA_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
) )
# Prevent blosc from including its own local copy of zlib in the object file # Prevent blosc from including it's own local copy of zlib in the object file
# and cause linker errors with everybody else. # and cause linker errors with everybody else.
set(BLOSC_EXTRA_ARGS ${BLOSC_EXTRA_ARGS} set(BLOSC_EXTRA_ARGS ${BLOSC_EXTRA_ARGS}
-DPREFER_EXTERNAL_ZLIB=ON -DPREFER_EXTERNAL_ZLIB=ON
) )
ExternalProject_Add(external_blosc ExternalProject_Add(external_blosc
URL file://${PACKAGE_DIR}/${BLOSC_FILE} URL ${BLOSC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BLOSC_HASH_TYPE}=${BLOSC_HASH} URL_HASH MD5=${BLOSC_HASH}
PREFIX ${BUILD_DIR}/blosc PREFIX ${BUILD_DIR}/blosc
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/blosc/src/external_blosc < ${PATCH_DIR}/blosc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc ${DEFAULT_CMAKE_FLAGS} ${BLOSC_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blosc ${DEFAULT_CMAKE_FLAGS} ${BLOSC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/blosc INSTALL_DIR ${LIBDIR}/blosc
) )
@@ -38,3 +55,19 @@ if(WIN32)
external_pthreads external_pthreads
) )
endif() endif()
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_blosc after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/blosc/lib/libblosc.lib ${HARVEST_TARGET}/blosc/lib/libblosc.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/blosc/include/ ${HARVEST_TARGET}/blosc/include/
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_blosc after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/blosc/lib/libblosc_d.lib ${HARVEST_TARGET}/blosc/lib/libblosc_d.lib
DEPENDEES install
)
endif()
endif()

View File

@@ -1,46 +1,67 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(BOOST_ADDRESS_MODEL 64)
if(WIN32) if(WIN32)
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
set(BOOST_CONFIGURE_COMMAND bootstrap.bat) set(BOOST_CONFIGURE_COMMAND bootstrap.bat)
set(BOOST_BUILD_COMMAND b2) set(BOOST_BUILD_COMMAND bjam)
set(BOOST_BUILD_OPTIONS runtime-link=shared) set(BOOST_BUILD_OPTIONS runtime-link=shared )
if(BUILD_MODE STREQUAL Debug) set(BOOST_HARVEST_CMD ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/ )
list(APPEND BOOST_BUILD_OPTIONS python-debugging=on variant=debug)
if(WITH_OPTIMIZED_DEBUG)
list(APPEND BOOST_BUILD_OPTIONS debug-symbols=off)
else()
list(APPEND BOOST_BUILD_OPTIONS debug-symbols=on)
endif()
else()
list(APPEND BOOST_BUILD_OPTIONS variant=release)
endif()
set(BOOST_HARVEST_CMD ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/lib/ ${HARVEST_TARGET}/boost/lib/)
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-${BOOST_VERSION_NODOTS_SHORT}/ ${HARVEST_TARGET}/boost/include/) set(BOOST_HARVEST_CMD ${BOOST_HARVEST_CMD} && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/boost/include/boost-${BOOST_VERSION_NODOTS_SHORT}/ ${HARVEST_TARGET}/boost/include/)
endif() endif()
elseif(APPLE) elseif(APPLE)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh) set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./b2) set(BOOST_BUILD_COMMAND ./b2)
set(BOOST_BUILD_OPTIONS toolset=clang-darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off) set(BOOST_BUILD_OPTIONS toolset=clang-darwin cxxflags=${PLATFORM_CXXFLAGS} linkflags=${PLATFORM_LDFLAGS} visibility=global --disable-icu boost.locale.icu=off)
set(BOOST_HARVEST_CMD echo .) set(BOOST_HARVEST_CMD echo .)
set(BOOST_PATCH_COMMAND echo .)
else() else()
set(BOOST_HARVEST_CMD echo .) set(BOOST_HARVEST_CMD echo .)
set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh) set(BOOST_CONFIGURE_COMMAND ./bootstrap.sh)
set(BOOST_BUILD_COMMAND ./b2) set(BOOST_BUILD_COMMAND ./b2)
set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off) set(BOOST_BUILD_OPTIONS cxxflags=${PLATFORM_CXXFLAGS} --disable-icu boost.locale.icu=off)
set(BOOST_PATCH_COMMAND echo .)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(BOOST_ADDRESS_MODEL 64)
else()
set(BOOST_ADDRESS_MODEL 32)
endif()
endif() endif()
set(JAM_FILE ${BUILD_DIR}/boost.user-config.jam) if(WITH_BOOST_PYTHON)
configure_file(${PATCH_DIR}/boost.user.jam.in ${JAM_FILE}) set(JAM_FILE ${BUILD_DIR}/boost.user-config.jam)
set(BOOST_PYTHON_OPTIONS configure_file(${PATCH_DIR}/boost.user.jam.in ${JAM_FILE})
--with-python
--user-config=${JAM_FILE}
)
if(WIN32 AND BUILD_MODE STREQUAL Debug)
set(BOOST_PYTHON_OPTIONS set(BOOST_PYTHON_OPTIONS
${BOOST_PYTHON_OPTIONS} --with-python
define=BOOST_DEBUG_PYTHON --user-config=${JAM_FILE}
) )
if(WIN32 AND BUILD_MODE STREQUAL Debug)
set(BOOST_PYTHON_OPTIONS
${BOOST_PYTHON_OPTIONS}
define=BOOST_DEBUG_PYTHON
)
endif()
endif() endif()
set(BOOST_OPTIONS set(BOOST_OPTIONS
@@ -65,20 +86,22 @@ set(BOOST_OPTIONS
string(TOLOWER ${BUILD_MODE} BOOST_BUILD_TYPE) string(TOLOWER ${BUILD_MODE} BOOST_BUILD_TYPE)
ExternalProject_Add(external_boost ExternalProject_Add(external_boost
URL file://${PACKAGE_DIR}/${BOOST_FILE} URL ${BOOST_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BOOST_HASH_TYPE}=${BOOST_HASH} URL_HASH MD5=${BOOST_HASH}
PREFIX ${BUILD_DIR}/boost PREFIX ${BUILD_DIR}/boost
UPDATE_COMMAND "" UPDATE_COMMAND ""
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/boost/src/external_boost < ${PATCH_DIR}/boost.diff PATCH_COMMAND ${BOOST_PATCH_COMMAND}
CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND} CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND}
BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=${BOOST_ARCHITECTURE} address-model=${BOOST_ADDRESS_MODEL} link=shared threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install BUILD_COMMAND ${BOOST_BUILD_COMMAND} ${BOOST_BUILD_OPTIONS} -j${MAKE_THREADS} architecture=x86 address-model=${BOOST_ADDRESS_MODEL} link=static threading=multi ${BOOST_OPTIONS} --prefix=${LIBDIR}/boost install
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
INSTALL_COMMAND "${BOOST_HARVEST_CMD}" INSTALL_COMMAND "${BOOST_HARVEST_CMD}"
) )
add_dependencies( if(WITH_BOOST_PYTHON)
external_boost add_dependencies(
external_python external_boost
external_numpy external_python
) external_numpy
)
endif()

View File

@@ -1,31 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(BOOST_ADDRESS_MODEL 64)
if(BLENDER_PLATFORM_ARM)
set(BOOST_ARCHITECTURE arm)
else()
set(BOOST_ARCHITECTURE x86)
endif()
if(WIN32)
if(MSVC_VERSION GREATER_EQUAL 1920) # 2019
set(BOOST_TOOLSET toolset=msvc-14.2)
set(BOOST_COMPILER_STRING -vc142)
else() # 2017
set(BOOST_TOOLSET toolset=msvc-14.1)
set(BOOST_COMPILER_STRING -vc141)
endif()
endif()
set(DEFAULT_BOOST_FLAGS
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=OFF
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DBoost_ADDITIONAL_VERSIONS=${BOOST_VERSION_SHORT}
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_USE_DEBUG_PYTHON=On
)

View File

@@ -1,22 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(BROTLI_EXTRA_ARGS
)
ExternalProject_Add(external_brotli
URL file://${PACKAGE_DIR}/${BROTLI_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BROTLI_HASH_TYPE}=${BROTLI_HASH}
PREFIX ${BUILD_DIR}/brotli
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/brotli ${DEFAULT_CMAKE_FLAGS} ${BROTLI_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/brotli
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_brotli after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/brotli/include ${HARVEST_TARGET}/brotli/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlidec-static${LIBEXT} ${HARVEST_TARGET}/brotli/lib/brotlidec-static${LIBEXT}
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/brotli/lib/brotlicommon-static${LIBEXT} ${HARVEST_TARGET}/brotli/lib/brotlicommon-static${LIBEXT}
DEPENDEES install
)
endif()

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(BZIP2_PREFIX "${LIBDIR}/bzip2") set(BZIP2_PREFIX "${LIBDIR}/bzip2")
set(BZIP2_CONFIGURE_ENV echo .) set(BZIP2_CONFIGURE_ENV echo .)
@@ -14,9 +30,9 @@ else()
endif() endif()
ExternalProject_Add(external_bzip2 ExternalProject_Add(external_bzip2
URL file://${PACKAGE_DIR}/${BZIP2_FILE} URL ${BZIP2_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${BZIP2_HASH_TYPE}=${BZIP2_HASH} URL_HASH SHA256=${BZIP2_HASH}
PREFIX ${BUILD_DIR}/bzip2 PREFIX ${BUILD_DIR}/bzip2
CONFIGURE_COMMAND echo . CONFIGURE_COMMAND echo .
BUILD_COMMAND ${BZIP2_CONFIGURE_ENV} && cd ${BUILD_DIR}/bzip2/src/external_bzip2/ && make CFLAGS=${BZIP2_CFLAGS} LDFLAGS=${BZIP2_LDFLAGS} -j${MAKE_THREADS} BUILD_COMMAND ${BZIP2_CONFIGURE_ENV} && cd ${BUILD_DIR}/bzip2/src/external_bzip2/ && make CFLAGS=${BZIP2_CFLAGS} LDFLAGS=${BZIP2_LDFLAGS} -j${MAKE_THREADS}

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(UNIX) if(UNIX)
if(APPLE) if(APPLE)
@@ -10,20 +26,13 @@ if(UNIX)
set(_required_software set(_required_software
autoconf autoconf
automake automake
bison
${_libtoolize_name} ${_libtoolize_name}
ninja nasm
pkg-config
tclsh
yasm yasm
tclsh
bison
) )
if(APPLE)
list(APPEND _required_software dos2unix)
else()
list(APPEND _required_software patchelf)
endif()
foreach(_software ${_required_software}) foreach(_software ${_required_software})
find_program(_software_find NAMES ${_software}) find_program(_software_find NAMES ${_software})
if(NOT _software_find) if(NOT _software_find)
@@ -33,14 +42,8 @@ if(UNIX)
endforeach() endforeach()
if(APPLE) if(APPLE)
# Homebrew has different default locations for ARM and Intel macOS. if(NOT EXISTS "/usr/local/opt/bison/bin/bison")
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64") set(_software_missing "${_software_missing} bison")
set(HOMEBREW_LOCATION "/opt/homebrew")
else()
set(HOMEBREW_LOCATION "/usr/local")
endif()
if(NOT EXISTS "${HOMEBREW_LOCATION}/opt/bison/bin/bison")
string(APPEND _software_missing " bison")
endif() endif()
endif() endif()
@@ -51,10 +54,10 @@ if(UNIX)
" ${_software_missing}\n" " ${_software_missing}\n"
"\n" "\n"
"On Debian and Ubuntu:\n" "On Debian and Ubuntu:\n"
" apt install autoconf automake bison libtool yasm tcl ninja-build meson python3-mako patchelf\n" " apt install autoconf automake libtool yasm nasm tcl\n"
"\n" "\n"
"On macOS (with homebrew):\n" "On macOS (with homebrew):\n"
" brew install autoconf automake bison dos2unix flex libtool meson ninja pkg-config yasm\n" " brew install cmake autoconf automake libtool yasm nasm bison\n"
"\n" "\n"
"Other platforms:\n" "Other platforms:\n"
" Install equivalent packages.\n") " Install equivalent packages.\n")

View File

@@ -0,0 +1,66 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CLANG_EXTRA_ARGS
-DCLANG_PATH_TO_LLVM_SOURCE=${BUILD_DIR}/ll/src/ll
-DCLANG_PATH_TO_LLVM_BUILD=${LIBDIR}/llvm
-DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd
-DLLVM_CONFIG=${LIBDIR}/llvm/bin/llvm-config
)
if(WIN32)
set(CLANG_GENERATOR "Ninja")
else()
set(CLANG_GENERATOR "Unix Makefiles")
endif()
if(APPLE)
set(CLANG_EXTRA_ARGS ${CLANG_EXTRA_ARGS}
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
)
endif()
ExternalProject_Add(external_clang
URL ${CLANG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLANG_HASH}
PREFIX ${BUILD_DIR}/clang
CMAKE_GENERATOR ${CLANG_GENERATOR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clang ${DEFAULT_CMAKE_FLAGS} ${CLANG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clang
)
if(MSVC)
if(BUILD_MODE STREQUAL Release)
set(CLANG_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/ ${HARVEST_TARGET}/llvm/)
else()
set(CLANG_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/lib/ ${HARVEST_TARGET}/llvm/debug/lib/
)
endif()
ExternalProject_Add_Step(external_clang after_install
COMMAND ${CLANG_HARVEST_COMMAND}
DEPENDEES mkdir update patch download configure build install
)
endif()
add_dependencies(
external_clang
ll
)

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CLEW_EXTRA_ARGS)
ExternalProject_Add(external_clew
URL ${CLEW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CLEW_HASH}
PREFIX ${BUILD_DIR}/clew
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/clew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CLEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/clew
)

View File

@@ -0,0 +1,29 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(CUEW_EXTRA_ARGS)
ExternalProject_Add(external_cuew
URL ${CUEW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${CUEW_HASH}
PREFIX ${BUILD_DIR}/cuew
PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/cuew/src/external_cuew < ${PATCH_DIR}/cuew.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/cuew -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${CUEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/cuew
)

View File

@@ -1,75 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# CVE Check requirements
#
# - A working installation of intels cve-bin-tool [1] has to be available in
# your path
#
# - Not strictly required, but highly recommended is obtaining a NVD key from
# nist since it significantly speeds up downloading/updating the required
# databases one can request a key on the following website:
# https://nvd.nist.gov/developers/request-an-api-key
# Bill of Materials construction
#
# This constructs a CSV cve-bin-tool [1] can read and process. Sadly
# cve-bin-tool at this point does not take a list of CPE's and output a check
# based on that list. so we need to pick apart the CPE retrieve the vendor,
# product and version tokens and generate a CSV.
#
# [1] https://github.com/intel/cve-bin-tool
# Because not all deps are downloaded (ie python packages) but can still have a
# xxx_CPE declared loop over all variables and look for variables ending in CPE.
set(SBOMCONTENTS)
get_cmake_property(_variableNames VARIABLES)
foreach(_variableName ${_variableNames})
if(_variableName MATCHES "CPE$")
string(REPLACE ":" ";" CPE_LIST ${${_variableName}})
string(REPLACE "_CPE" "_ID" CPE_DEPNAME ${_variableName})
list(GET CPE_LIST 3 CPE_VENDOR)
list(GET CPE_LIST 4 CPE_NAME)
list(GET CPE_LIST 5 CPE_VERSION)
set(${CPE_DEPNAME} "${CPE_VENDOR},${CPE_NAME},${CPE_VERSION}")
set(SBOMCONTENTS "${SBOMCONTENTS}${CPE_VENDOR},${CPE_NAME},${CPE_VERSION},,,\n")
endif()
endforeach()
configure_file(${CMAKE_SOURCE_DIR}/cmake/cve_check.csv.in ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv @ONLY)
# Custom Targets
#
# This defines two new custom targets one could run in the build folder
# `cve_check` which will output the report to the console, and `cve_check_html`
# which will write out blender_dependencies.html in the build folder that one
# could share with other people or be used to get more information on the
# reported CVE's.
#
# cve-bin-tool takes data from the nist nvd database which rate limits
# unauthenticated requests to 1 requests per 6 seconds making the database
# download take "quite a bit" of time.
#
# When adding -DCVE_CHECK_NVD_KEY=your_api_key_here to your cmake invocation
# this key will be passed on to cve-bin-tool speeding up the process.
#
if(DEFINED CVE_CHECK_NVD_KEY)
set(NVD_ARGS --nvd-api-key ${CVE_CHECK_NVD_KEY})
endif()
# This will just report to the console
add_custom_target(cve_check
COMMAND cve-bin-tool
${NVD_ARGS}
-i ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
--affected-versions
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
)
# This will write out blender_dependencies.html
add_custom_target(cve_check_html
COMMAND cve-bin-tool
${NVD_ARGS}
-i ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
-f html
SOURCES ${CMAKE_CURRENT_BINARY_DIR}/cve_check.csv
)

View File

@@ -1,29 +0,0 @@
vendor,product,version,cve_number,remarks,comment
@OPENJPEG_ID@,CVE-2016-9675,Ignored,issue in convert command line tool not used by blender
@PYTHON_ID@,CVE-2009-2940,Ignored,issue in pygresql not used by blender
@PYTHON_ID@,CVE-2020-29396,Ignored,issue in odoo not used by blender
@PYTHON_ID@,CVE-2021-32052,Ignored,issue in django not used by blender
@PYTHON_ID@,CVE-2009-3720,Ignored,already fixed in libexpat version used
@SSL_ID@,CVE-2009-1390,Ignored,issue in mutt not used by blender
@SSL_ID@,CVE-2009-3765,Ignored,issue in mutt not used by blender
@SSL_ID@,CVE-2009-3766,Ignored,issue in mutt not used by blender
@SSL_ID@,CVE-2009-3767,Ignored,issue in ldap not used by blender
@SSL_ID@,CVE-2019-0190,Ignored,issue in apache not used by blender
@TIFF_ID@,CVE-2022-2056,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2057,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2058,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2519,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2520,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2521,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-2953,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-34526,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3570,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3597,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3598,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3599,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3626,Ignored,issue in tiff command line tool not used by blender
@TIFF_ID@,CVE-2022-3627,Ignored,issue in tiff command line tool not used by blender
@XML2_ID@,CVE-2016-3709,Ignored,not affecting blender and not considered a security issue upstream
@GMP_ID@,CVE-2021-43618,Mitigated,patched using upstream commit 561a9c25298e
@SQLITE_ID@,CVE-2022-35737,Ignored,only affects SQLITE_ENABLE_STAT4 compile option not used by blender or python
@SBOMCONTENTS@

View File

@@ -1,177 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
## Update and uncomment this in the release branch
# set(BLENDER_VERSION 3.1)
function(download_source dep)
set(TARGET_FILE ${${dep}_FILE})
set(TARGET_HASH_TYPE ${${dep}_HASH_TYPE})
set(TARGET_HASH ${${dep}_HASH})
if(PACKAGE_USE_UPSTREAM_SOURCES)
set(TARGET_URI ${${dep}_URI})
elseif(BLENDER_VERSION)
set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/tags/blender-${BLENDER_VERSION}-release/lib/packages/${TARGET_FILE})
else()
set(TARGET_URI https://svn.blender.org/svnroot/bf-blender/trunk/lib/packages/${TARGET_FILE})
endif()
# Validate all required variables are set and give an explicit error message
# rather than CMake erroring out later on with a more ambigious error.
if(NOT DEFINED TARGET_FILE)
message(FATAL_ERROR "${dep}_FILE variable not set")
endif()
if(NOT DEFINED TARGET_HASH)
message(FATAL_ERROR "${dep}_HASH variable not set")
endif()
if(NOT DEFINED TARGET_HASH_TYPE)
message(FATAL_ERROR "${dep}_HASH_TYPE variable not set")
endif()
if(NOT DEFINED TARGET_URI)
message(FATAL_ERROR "${dep}_URI variable not set")
endif()
set(TARGET_FILE ${PACKAGE_DIR}/${TARGET_FILE})
message("Checking source : ${dep} (${TARGET_FILE})")
if(NOT EXISTS ${TARGET_FILE})
message("Checking source : ${dep} - source not found downloading from ${TARGET_URI}")
file(
DOWNLOAD ${TARGET_URI} ${TARGET_FILE}
TIMEOUT 1800 # seconds
EXPECTED_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH}
TLS_VERIFY ON
SHOW_PROGRESS
)
endif()
if(EXISTS ${TARGET_FILE})
# Sometimes the download fails, but that is not a
# fail condition for "file(DOWNLOAD" it will warn about
# a CRC mismatch and just carry on, we need to explicitly
# catch this and remove the bogus 0 byte file so we can
# retry without having to go find the file and manually
# delete it.
file(SIZE ${TARGET_FILE} TARGET_SIZE)
if(${TARGET_SIZE} EQUAL 0)
file(REMOVE ${TARGET_FILE})
message(FATAL_ERROR "for ${TARGET_FILE} file size 0, download likely failed, deleted...")
endif()
# If we are using sources from the blender repo also
# validate that the hashes match, this takes a
# little more time, but protects us when we are
# building a release package and one of the packages
# is missing or incorrect.
#
# For regular platform maintenaince this is not needed
# since the actual build of the dep will notify the
# platform maintainer if there is a problem with the
# source package and refuse to build.
if(NOT PACKAGE_USE_UPSTREAM_SOURCES OR FORCE_CHECK_HASH)
file(${TARGET_HASH_TYPE} ${TARGET_FILE} LOCAL_HASH)
if(NOT ${TARGET_HASH} STREQUAL ${LOCAL_HASH})
message(FATAL_ERROR "${TARGET_FILE} ${TARGET_HASH_TYPE} mismatch\nExpected\t: ${TARGET_HASH}\nActual\t: ${LOCAL_HASH}")
endif()
endif()
endif()
endfunction(download_source)
download_source(ZLIB)
download_source(OPENAL)
download_source(PNG)
download_source(JPEG)
download_source(BOOST)
download_source(BLOSC)
download_source(PTHREADS)
download_source(OPENEXR)
download_source(FREETYPE)
download_source(EPOXY)
download_source(FREEGLUT)
download_source(ALEMBIC)
download_source(OPENSUBDIV)
download_source(SDL)
download_source(OPENCOLLADA)
download_source(OPENCOLORIO)
download_source(MINIZIPNG)
download_source(LLVM)
download_source(OPENMP)
download_source(OPENIMAGEIO)
download_source(TIFF)
download_source(OSL)
download_source(PYTHON)
download_source(TBB)
download_source(OPENVDB)
download_source(NUMPY)
download_source(LAME)
download_source(OGG)
download_source(VORBIS)
download_source(THEORA)
download_source(FLAC)
download_source(VPX)
download_source(OPUS)
download_source(X264)
download_source(XVIDCORE)
download_source(OPENJPEG)
download_source(FFMPEG)
download_source(FFTW)
download_source(ICONV)
download_source(SNDFILE)
download_source(WEBP)
download_source(SPNAV)
download_source(JEMALLOC)
download_source(XML2)
download_source(YAMLCPP)
download_source(EXPAT)
download_source(PUGIXML)
download_source(FLEXBISON)
download_source(BZIP2)
download_source(FFI)
download_source(LZMA)
download_source(SSL)
download_source(SQLITE)
download_source(EMBREE)
download_source(USD)
download_source(MATERIALX)
download_source(OIDN)
download_source(LIBGLU)
download_source(MESA)
download_source(NASM)
download_source(XR_OPENXR_SDK)
download_source(WL_PROTOCOLS)
download_source(WAYLAND)
download_source(WAYLAND_LIBDECOR)
download_source(ISPC)
download_source(GMP)
download_source(POTRACE)
download_source(HARU)
download_source(ZSTD)
download_source(SSE2NEON)
download_source(FLEX)
download_source(BROTLI)
download_source(FMT)
download_source(ROBINMAP)
download_source(IMATH)
download_source(PYSTRING)
download_source(OPENPGL)
download_source(LEVEL_ZERO)
download_source(DPCPP)
download_source(VCINTRINSICS)
download_source(OPENCLHEADERS)
download_source(ICDLOADER)
download_source(MP11)
download_source(SPIRV_HEADERS)
download_source(IGC)
download_source(IGC_LLVM)
download_source(IGC_OPENCL_CLANG)
download_source(IGC_VCINTRINSICS)
download_source(IGC_SPIRV_HEADERS)
download_source(IGC_SPIRV_TOOLS)
download_source(IGC_SPIRV_TRANSLATOR)
download_source(GMMLIB)
download_source(OCLOC)
download_source(AOM)
download_source(FRIBIDI)
download_source(HARFBUZZ)
download_source(SHADERC)
download_source(SHADERC_SPIRV_TOOLS)
download_source(SHADERC_SPIRV_HEADERS)
download_source(SHADERC_GLSLANG)
download_source(VULKAN_HEADERS)
download_source(VULKAN_LOADER)
download_source(PYBIND11)

View File

@@ -1,116 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# LLVM does not switch over to cpp17 until llvm 16 and building ealier versions with
# MSVC is leading to some crashes in ISPC. Switch back to their default on all platforms
# for now.
string(REPLACE "-DCMAKE_CXX_STANDARD=17" " " DPCPP_CMAKE_FLAGS "${DEFAULT_CMAKE_FLAGS}")
if(WIN32)
set(LLVM_GENERATOR "Ninja")
else()
set(LLVM_GENERATOR "Unix Makefiles")
endif()
set(DPCPP_CONFIGURE_ARGS
# When external deps dpcpp needs are not found it will automatically
# download the during the configure stage using FetchContent. Given
# we need to keep an archive of all source used during build for compliance
# reasons it CANNOT download anything we do not know about. By setting
# this property to ON, all downloads are disabled, and we will have to
# provide the missing deps some other way, a build error beats a compliance
# violation
--cmake-opt FETCHCONTENT_FULLY_DISCONNECTED=ON
)
set(DPCPP_SOURCE_ROOT ${BUILD_DIR}/dpcpp/src/external_dpcpp/)
set(DPCPP_EXTRA_ARGS
# When external deps dpcpp needs are not found it will automatically
# download the during the configure stage using FetchContent. Given
# we need to keep an archive of all source used during build for compliance
# reasons it CANNOT download anything we do not know about. By setting
# this property to ON, all downloads are disabled, and we will have to
# provide the missing deps some other way, a build or configure error
# beats a compliance violation
-DFETCHCONTENT_FULLY_DISCONNECTED=ON
-DLLVMGenXIntrinsics_SOURCE_DIR=${BUILD_DIR}/vcintrinsics/src/external_vcintrinsics/
-DOpenCL_HEADERS=file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE}
-DOpenCL_LIBRARY_SRC=file://${PACKAGE_DIR}/${ICDLOADER_FILE}
-DBOOST_MP11_SOURCE_DIR=${BUILD_DIR}/mp11/src/external_mp11/
-DLEVEL_ZERO_LIBRARY=${LIBDIR}/level-zero/lib/${LIBPREFIX}ze_loader${SHAREDLIBEXT}
-DLEVEL_ZERO_INCLUDE_DIR=${LIBDIR}/level-zero/include
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${BUILD_DIR}/spirvheaders/src/external_spirvheaders/
# Below here is copied from an invocation of buildbot/config.py
-DLLVM_ENABLE_ASSERTIONS=ON
-DLLVM_TARGETS_TO_BUILD=X86
-DLLVM_EXTERNAL_PROJECTS=sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw
-DLLVM_EXTERNAL_SYCL_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/sycl
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/llvm-spirv
-DLLVM_EXTERNAL_XPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti
-DXPTI_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xpti
-DLLVM_EXTERNAL_XPTIFW_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/xptifw
-DLLVM_EXTERNAL_LIBDEVICE_SOURCE_DIR=${DPCPP_SOURCE_ROOT}/libdevice
-DLLVM_ENABLE_PROJECTS=clang^^sycl^^llvm-spirv^^opencl^^libdevice^^xpti^^xptifw
-DLIBCLC_TARGETS_TO_BUILD=
-DLIBCLC_GENERATE_REMANGLED_VARIANTS=OFF
-DSYCL_BUILD_PI_HIP_PLATFORM=AMD
-DLLVM_BUILD_TOOLS=ON
-DSYCL_ENABLE_WERROR=OFF
-DSYCL_INCLUDE_TESTS=ON
-DLLVM_ENABLE_DOXYGEN=OFF
-DLLVM_ENABLE_SPHINX=OFF
-DBUILD_SHARED_LIBS=OFF
-DSYCL_ENABLE_XPTI_TRACING=ON
-DLLVM_ENABLE_LLD=OFF
-DXPTI_ENABLE_WERROR=OFF
-DSYCL_CLANG_EXTRA_FLAGS=
-DSYCL_ENABLE_PLUGINS=level_zero
-DCMAKE_INSTALL_RPATH=\$ORIGIN
-DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY}
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
-DLLDB_ENABLE_CURSES=OFF
-DLLVM_ENABLE_TERMINFO=OFF
)
if(WIN32)
list(APPEND DPCPP_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER)
endif()
ExternalProject_Add(external_dpcpp
URL file://${PACKAGE_DIR}/${DPCPP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${DPCPP_HASH_TYPE}=${DPCPP_HASH}
PREFIX ${BUILD_DIR}/dpcpp
CMAKE_GENERATOR ${LLVM_GENERATOR}
SOURCE_SUBDIR llvm
LIST_SEPARATOR ^^
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/dpcpp ${DPCPP_CMAKE_FLAGS} ${DPCPP_EXTRA_ARGS}
# CONFIGURE_COMMAND
# ${PYTHON_BINARY}
# ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/configure.py ${DPCPP_CONFIGURE_ARGS}
# BUILD_COMMAND
# echo "." # ${PYTHON_BINARY} ${BUILD_DIR}/dpcpp/src/external_dpcpp/buildbot/compile.py
INSTALL_COMMAND ${CMAKE_COMMAND} --build . -- deploy-sycl-toolchain
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/dpcpp/src/external_dpcpp < ${PATCH_DIR}/dpcpp.diff
INSTALL_DIR ${LIBDIR}/dpcpp
)
add_dependencies(
external_dpcpp
external_python
external_python_site_packages
external_vcintrinsics
external_openclheaders
external_icdloader
external_mp11
external_level-zero
external_spirvheaders
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_dpcpp after_install
COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang-cl.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang-cpp.exe
COMMAND ${CMAKE_COMMAND} -E rm -f ${LIBDIR}/dpcpp/bin/clang.exe
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/dpcpp ${HARVEST_TARGET}/dpcpp
)
endif()

View File

@@ -1,61 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# These are build time requirements for dpcpp
# We only have to unpack these dpcpp will build
# them.
ExternalProject_Add(external_vcintrinsics
URL file://${PACKAGE_DIR}/${VCINTRINSICS_FILE}
URL_HASH ${VCINTRINSICS_HASH_TYPE}=${VCINTRINSICS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/vcintrinsics
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
# opencl headers do not have to be unpacked, dpcpp will do it
# but it wouldn't hurt to do it anyway as an opertunity to validate
# the hash is correct.
ExternalProject_Add(external_openclheaders
URL file://${PACKAGE_DIR}/${OPENCLHEADERS_FILE}
URL_HASH ${OPENCLHEADERS_HASH_TYPE}=${OPENCLHEADERS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/openclheaders
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
# icdloader does not have to be unpacked, dpcpp will do it
# but it wouldn't hurt to do it anyway as an opertunity to validate
# the hash is correct.
ExternalProject_Add(external_icdloader
URL file://${PACKAGE_DIR}/${ICDLOADER_FILE}
URL_HASH ${ICDLOADER_HASH_TYPE}=${ICDLOADER_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/icdloader
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
ExternalProject_Add(external_mp11
URL file://${PACKAGE_DIR}/${MP11_FILE}
URL_HASH ${MP11_HASH_TYPE}=${MP11_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/mp11
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
ExternalProject_Add(external_spirvheaders
URL file://${PACKAGE_DIR}/${SPIRV_HEADERS_FILE}
URL_HASH ${SPIRV_HEADERS_HASH_TYPE}=${SPIRV_HEADERS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/spirvheaders
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# Note the utility apps may use png/tiff/gif system libraries, but the # Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems. # library itself does not depend on them, so should give no problems.
@@ -10,29 +26,30 @@ set(EMBREE_EXTRA_ARGS
-DEMBREE_RAY_MASK=ON -DEMBREE_RAY_MASK=ON
-DEMBREE_FILTER_FUNCTION=ON -DEMBREE_FILTER_FUNCTION=ON
-DEMBREE_BACKFACE_CULLING=OFF -DEMBREE_BACKFACE_CULLING=OFF
-DEMBREE_MAX_ISA=AVX2
-DEMBREE_TASKING_SYSTEM=TBB -DEMBREE_TASKING_SYSTEM=TBB
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb -DEMBREE_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb -DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
) )
if(NOT BLENDER_PLATFORM_ARM)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_MAX_ISA=AVX2
)
endif()
if(TBB_STATIC_LIBRARY) if(TBB_STATIC_LIBRARY)
set(EMBREE_EXTRA_ARGS set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS} ${EMBREE_EXTRA_ARGS}
-DEMBREE_TBB_COMPONENT=tbb_static -DEMBREE_TBB_LIBRARY_NAME=tbb_static
-DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_static
) )
endif() endif()
if(WIN32)
set(EMBREE_BUILD_DIR ${BUILD_MODE}/)
else()
set(EMBREE_BUILD_DIR)
endif()
ExternalProject_Add(external_embree ExternalProject_Add(external_embree
URL file://${PACKAGE_DIR}/${EMBREE_FILE} URL ${EMBREE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EMBREE_HASH_TYPE}=${EMBREE_HASH} URL_HASH MD5=${EMBREE_HASH}
PREFIX ${BUILD_DIR}/embree PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
@@ -53,17 +70,17 @@ if(WIN32)
) )
else() else()
ExternalProject_Add_Step(external_embree after_install ExternalProject_Add_Step(external_embree after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree3.lib ${HARVEST_TARGET}/embree/lib/embree3_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree3.lib ${HARVEST_TARGET}/embree/lib/embree3_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx.lib ${HARVEST_TARGET}/embree/lib/embree_avx_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx.lib ${HARVEST_TARGET}/embree/lib/embree_avx_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx2.lib ${HARVEST_TARGET}/embree/lib/embree_avx2_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx2.lib ${HARVEST_TARGET}/embree/lib/embree_avx2_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_sse42.lib ${HARVEST_TARGET}/embree/lib/embree_sse42_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_sse42.lib ${HARVEST_TARGET}/embree/lib/embree_sse42_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/lexers.lib ${HARVEST_TARGET}/embree/lib/lexers_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/lexers.lib ${HARVEST_TARGET}/embree/lib/lexers_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/math.lib ${HARVEST_TARGET}/embree/lib/math_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/math.lib ${HARVEST_TARGET}/embree/lib/math_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/simd.lib ${HARVEST_TARGET}/embree/lib/simd_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/simd.lib ${HARVEST_TARGET}/embree/lib/simd_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/sys.lib ${HARVEST_TARGET}/embree/lib/sys_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/sys.lib ${HARVEST_TARGET}/embree/lib/sys_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/tasking.lib ${HARVEST_TARGET}/embree/lib/tasking_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/tasking.lib ${HARVEST_TARGET}/embree/lib/tasking_d.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()
endif() endif()

View File

@@ -1,31 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(EPOXY_LIB_TYPE shared)
else()
set(EPOXY_LIB_TYPE static)
endif()
ExternalProject_Add(external_epoxy
URL file://${PACKAGE_DIR}/${EPOXY_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EPOXY_HASH_TYPE}=${EPOXY_HASH}
PREFIX ${BUILD_DIR}/epoxy
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/epoxy/src/external_epoxy/ < ${PATCH_DIR}/epoxy.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${MESON} setup --prefix ${LIBDIR}/epoxy --default-library ${EPOXY_LIB_TYPE} --libdir lib ${BUILD_DIR}/epoxy/src/external_epoxy-build ${BUILD_DIR}/epoxy/src/external_epoxy -Dtests=false
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_epoxy after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/epoxy/include ${HARVEST_TARGET}/epoxy/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/epoxy/bin/epoxy-0.dll ${HARVEST_TARGET}/epoxy/bin/epoxy-0.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/epoxy/lib/epoxy.lib ${HARVEST_TARGET}/epoxy/lib/epoxy.lib
DEPENDEES install
)
endif()
add_dependencies(
external_epoxy
# Needed for `MESON`.
external_python_site_packages
)

View File

@@ -1,19 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(EXPAT_EXTRA_ARGS
-DEXPAT_BUILD_DOCS=OFF
-DEXPAT_BUILD_EXAMPLES=OFF
-DEXPAT_BUILD_TESTS=OFF
-DEXPAT_BUILD_TOOLS=OFF
-DEXPAT_SHARED_LIBS=OFF
)
ExternalProject_Add(external_expat
URL file://${PACKAGE_DIR}/${EXPAT_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${EXPAT_HASH_TYPE}=${EXPAT_HASH}
PREFIX ${BUILD_DIR}/expat
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/expat ${DEFAULT_CMAKE_FLAGS} ${EXPAT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/expat
SOURCE_SUBDIR expat
)

View File

@@ -1,8 +1,24 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_ffi ExternalProject_Add(external_ffi
URL file://${PACKAGE_DIR}/${FFI_FILE} URL ${FFI_URI}
URL_HASH ${FFI_HASH_TYPE}=${FFI_HASH} URL_HASH SHA256=${FFI_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/ffi PREFIX ${BUILD_DIR}/ffi
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ffi/src/external_ffi/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ffi CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ffi/src/external_ffi/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ffi

View File

@@ -1,55 +1,25 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32) set(FFMPEG_CFLAGS "-I${mingw_LIBDIR}/lame/include -I${mingw_LIBDIR}/openjpeg/include/ -I${mingw_LIBDIR}/ogg/include -I${mingw_LIBDIR}/vorbis/include -I${mingw_LIBDIR}/theora/include -I${mingw_LIBDIR}/opus/include -I${mingw_LIBDIR}/vpx/include -I${mingw_LIBDIR}/x264/include -I${mingw_LIBDIR}/xvidcore/include -I${mingw_LIBDIR}/zlib/include")
set(temp_LIBDIR ${mingw_LIBDIR}) set(FFMPEG_LDFLAGS "-L${mingw_LIBDIR}/lame/lib -L${mingw_LIBDIR}/openjpeg/lib -L${mingw_LIBDIR}/ogg/lib -L${mingw_LIBDIR}/vorbis/lib -L${mingw_LIBDIR}/theora/lib -L${mingw_LIBDIR}/opus/lib -L${mingw_LIBDIR}/vpx/lib -L${mingw_LIBDIR}/x264/lib -L${mingw_LIBDIR}/xvidcore/lib -L${mingw_LIBDIR}/zlib/lib")
else() set(FFMPEG_EXTRA_FLAGS --pkg-config-flags=--static --extra-cflags=${FFMPEG_CFLAGS} --extra-ldflags=${FFMPEG_LDFLAGS})
set(temp_LIBDIR ${LIBDIR}) set(FFMPEG_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/x264/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}:${mingw_LIBDIR}/vpx/lib/pkgconfig:${mingw_LIBDIR}/theora/lib/pkgconfig:${mingw_LIBDIR}/openjpeg/lib/pkgconfig:${mingw_LIBDIR}/opus/lib/pkgconfig:)
endif()
set(FFMPEG_CFLAGS "\
-I${temp_LIBDIR}/lame/include \
-I${temp_LIBDIR}/openjpeg/include/ \
-I${temp_LIBDIR}/ogg/include \
-I${temp_LIBDIR}/vorbis/include \
-I${temp_LIBDIR}/theora/include \
-I${temp_LIBDIR}/opus/include \
-I${temp_LIBDIR}/vpx/include \
-I${temp_LIBDIR}/x264/include \
-I${temp_LIBDIR}/xvidcore/include \
-I${temp_LIBDIR}/zlib/include \
-I${temp_LIBDIR}/aom/include"
)
set(FFMPEG_LDFLAGS "\
-L${temp_LIBDIR}/lame/lib \
-L${temp_LIBDIR}/openjpeg/lib \
-L${temp_LIBDIR}/ogg/lib \
-L${temp_LIBDIR}/vorbis/lib \
-L${temp_LIBDIR}/theora/lib \
-L${temp_LIBDIR}/opus/lib \
-L${temp_LIBDIR}/vpx/lib \
-L${temp_LIBDIR}/x264/lib \
-L${temp_LIBDIR}/xvidcore/lib \
-L${temp_LIBDIR}/zlib/lib \
-L${temp_LIBDIR}/aom/lib"
)
set(FFMPEG_EXTRA_FLAGS
--pkg-config-flags=--static
--extra-cflags=${FFMPEG_CFLAGS}
--extra-ldflags=${FFMPEG_LDFLAGS}
)
set(FFMPEG_ENV "PKG_CONFIG_PATH=\
${temp_LIBDIR}/openjpeg/lib/pkgconfig:\
${temp_LIBDIR}/x264/lib/pkgconfig:\
${temp_LIBDIR}/vorbis/lib/pkgconfig:\
${temp_LIBDIR}/ogg/lib/pkgconfig:\
${temp_LIBDIR}/vpx/lib/pkgconfig:\
${temp_LIBDIR}/theora/lib/pkgconfig:\
${temp_LIBDIR}/openjpeg/lib/pkgconfig:\
${temp_LIBDIR}/opus/lib/pkgconfig:\
${temp_LIBDIR}/aom/lib/pkgconfig"
)
unset(temp_LIBDIR)
if(WIN32) if(WIN32)
set(FFMPEG_ENV set ${FFMPEG_ENV} &&) set(FFMPEG_ENV set ${FFMPEG_ENV} &&)
@@ -60,8 +30,13 @@ if(WIN32)
--enable-w32threads --enable-w32threads
--disable-pthreads --disable-pthreads
--enable-libopenjpeg --enable-libopenjpeg
--disable-mediafoundation
) )
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--x86asmexe=yasm
)
endif()
else() else()
set(FFMPEG_EXTRA_FLAGS set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS} ${FFMPEG_EXTRA_FLAGS}
@@ -77,17 +52,12 @@ if(APPLE)
--target-os=darwin --target-os=darwin
--x86asmexe=${LIBDIR}/nasm/bin/nasm --x86asmexe=${LIBDIR}/nasm/bin/nasm
) )
elseif(UNIX)
set(FFMPEG_EXTRA_FLAGS
${FFMPEG_EXTRA_FLAGS}
--x86asmexe=${LIBDIR}/nasm/bin/nasm
)
endif() endif()
ExternalProject_Add(external_ffmpeg ExternalProject_Add(external_ffmpeg
URL file://${PACKAGE_DIR}/${FFMPEG_FILE} URL ${FFMPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FFMPEG_HASH_TYPE}=${FFMPEG_HASH} URL_HASH MD5=${FFMPEG_HASH}
# OpenJpeg is compiled with pthread support on Linux, which is all fine and is what we # OpenJpeg is compiled with pthread support on Linux, which is all fine and is what we
# want for maximum runtime performance, but due to static nature of that library we # want for maximum runtime performance, but due to static nature of that library we
# need to force ffmpeg to link against pthread, otherwise test program used by autoconf # need to force ffmpeg to link against pthread, otherwise test program used by autoconf
@@ -119,7 +89,6 @@ ExternalProject_Add(external_ffmpeg
--disable-librtmp --disable-librtmp
--enable-libx264 --enable-libx264
--enable-libxvid --enable-libxvid
--enable-libaom
--disable-libopencore-amrnb --disable-libopencore-amrnb
--disable-libopencore-amrwb --disable-libopencore-amrwb
--disable-libdc1394 --disable-libdc1394
@@ -166,7 +135,6 @@ add_dependencies(
external_vorbis external_vorbis
external_ogg external_ogg
external_lame external_lame
external_aom
) )
if(WIN32) if(WIN32)
add_dependencies( add_dependencies(
@@ -174,7 +142,7 @@ if(WIN32)
external_zlib_mingw external_zlib_mingw
) )
endif() endif()
if(UNIX) if(APPLE)
add_dependencies( add_dependencies(
external_ffmpeg external_ffmpeg
external_nasm external_nasm

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FFTW_EXTRA_ARGS) set(FFTW_EXTRA_ARGS)
@@ -12,9 +28,9 @@ else()
endif() endif()
ExternalProject_Add(external_fftw3 ExternalProject_Add(external_fftw3
URL file://${PACKAGE_DIR}/${FFTW_FILE} URL ${FFTW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FFTW_HASH_TYPE}=${FFTW_HASH} URL_HASH MD5=${FFTW_HASH}
PREFIX ${BUILD_DIR}/fftw3 PREFIX ${BUILD_DIR}/fftw3
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && ${CONFIGURE_COMMAND} ${FFTW_EXTRA_ARGS} --prefix=${mingw_LIBDIR}/fftw3 CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && ${CONFIGURE_COMMAND} ${FFTW_EXTRA_ARGS} --prefix=${mingw_LIBDIR}/fftw3
PATCH_COMMAND ${FFTW3_PATCH_COMMAND} PATCH_COMMAND ${FFTW3_PATCH_COMMAND}

View File

@@ -1,9 +1,25 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_flac ExternalProject_Add(external_flac
URL file://${PACKAGE_DIR}/${FLAC_FILE} URL ${FLAC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FLAC_HASH_TYPE}=${FLAC_HASH} URL_HASH SHA256=${FLAC_HASH}
PREFIX ${BUILD_DIR}/flac PREFIX ${BUILD_DIR}/flac
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flac --disable-shared --enable-static CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flac --disable-shared --enable-static
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && make -j${MAKE_THREADS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flac/src/external_flac/ && make -j${MAKE_THREADS}

View File

@@ -1,12 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
ExternalProject_Add(external_flex
URL file://${PACKAGE_DIR}/${FLEX_FILE}
URL_HASH ${FLEX_HASH_TYPE}=${FLEX_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/flex
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/flex
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/flex/src/external_flex/ && make install
INSTALL_DIR ${LIBDIR}/flex
)

View File

@@ -1,11 +1,27 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FLEXBISON_EXTRA_ARGS) set(FLEXBISON_EXTRA_ARGS)
ExternalProject_Add(external_flexbison ExternalProject_Add(external_flexbison
URL file://${PACKAGE_DIR}/${FLEXBISON_FILE} URL ${FLEXBISON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FLEXBISON_HASH_TYPE}=${FLEXBISON_HASH} URL_HASH MD5=${FLEXBISON_HASH}
PREFIX ${BUILD_DIR}/flexbison PREFIX ${BUILD_DIR}/flexbison
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/flexbison ${DEFAULT_CMAKE_FLAGS} ${FLEXBISON_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/flexbison ${DEFAULT_CMAKE_FLAGS} ${FLEXBISON_EXTRA_ARGS}
CONFIGURE_COMMAND echo . CONFIGURE_COMMAND echo .

View File

@@ -1,15 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(FMT_EXTRA_ARGS
-DFMT_TEST=OFF
-DFMT_DOC=OFF
)
ExternalProject_Add(external_fmt
URL file://${PACKAGE_DIR}/${FMT_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FMT_HASH_TYPE}=${FMT_HASH}
PREFIX ${BUILD_DIR}/fmt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/fmt ${DEFAULT_CMAKE_FLAGS} ${FMT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/fmt
)

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32) if(WIN32)
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
@@ -8,9 +24,9 @@ if(WIN32)
) )
ExternalProject_Add(external_freeglut ExternalProject_Add(external_freeglut
URL file://${PACKAGE_DIR}/${FREEGLUT_FILE} URL ${FREEGLUT_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FREEGLUT_HASH_TYPE}=${FREEGLUT_HASH} URL_HASH MD5=${FREEGLUT_HASH}
PREFIX ${BUILD_DIR}/freeglut PREFIX ${BUILD_DIR}/freeglut
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freeglut ${DEFAULT_C_FLAGS} ${DEFAULT_CXX_FLAGS} ${FREEGLUT_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freeglut ${DEFAULT_C_FLAGS} ${DEFAULT_CXX_FLAGS} ${FREEGLUT_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/freeglut INSTALL_DIR ${LIBDIR}/freeglut

View File

@@ -1,41 +1,44 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FREETYPE_EXTRA_ARGS set(FREETYPE_EXTRA_ARGS
-DCMAKE_RELEASE_POSTFIX:STRING=2ST -DCMAKE_RELEASE_POSTFIX:STRING=2ST
-DCMAKE_DEBUG_POSTFIX:STRING=2ST_d -DCMAKE_DEBUG_POSTFIX:STRING=2ST_d
-DFT_DISABLE_BZIP2=ON -DWITH_BZip2=OFF
-DFT_DISABLE_HARFBUZZ=ON -DWITH_HarfBuzz=OFF
-DFT_DISABLE_PNG=ON -DFT_WITH_HARFBUZZ=OFF
-DFT_REQUIRE_BROTLI=ON -DFT_WITH_BZIP2=OFF
-DFT_REQUIRE_ZLIB=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE
-DPC_BROTLIDEC_INCLUDEDIR=${LIBDIR}/brotli/include -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE
-DPC_BROTLIDEC_LIBDIR=${LIBDIR}/brotli/lib -DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE)
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
)
ExternalProject_Add(external_freetype ExternalProject_Add(external_freetype
URL file://${PACKAGE_DIR}/${FREETYPE_FILE} URL ${FREETYPE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${FREETYPE_HASH_TYPE}=${FREETYPE_HASH} URL_HASH MD5=${FREETYPE_HASH}
PREFIX ${BUILD_DIR}/freetype PREFIX ${BUILD_DIR}/freetype
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freetype ${DEFAULT_CMAKE_FLAGS} ${FREETYPE_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/freetype ${DEFAULT_CMAKE_FLAGS} ${FREETYPE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/freetype INSTALL_DIR ${LIBDIR}/freetype
) )
add_dependencies(
external_freetype
external_brotli
external_zlib
)
if(BUILD_MODE STREQUAL Release AND WIN32) if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_freetype after_install ExternalProject_Add_Step(external_freetype after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freetype ${HARVEST_TARGET}/freetype
# harfbuzz *NEEDS* to find freetype.lib and will not be conviced to take alternative names so just give it
# what it wants.
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/freetype/lib/freetype2st.lib ${LIBDIR}/freetype/lib/freetype.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -1,31 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(CONFIGURE_ENV ${CONFIGURE_ENV_MSVC})
endif()
ExternalProject_Add(external_fribidi
URL file://${PACKAGE_DIR}/${FRIBIDI_FILE}
URL_HASH ${FRIBIDI_HASH_TYPE}=${FRIBIDI_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/fribidi
CONFIGURE_COMMAND ${MESON} setup --prefix ${LIBDIR}/fribidi -Ddocs=false --default-library static --libdir lib ${BUILD_DIR}/fribidi/src/external_fribidi-build ${BUILD_DIR}/fribidi/src/external_fribidi
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
INSTALL_DIR ${LIBDIR}/fribidi
)
add_dependencies(
external_fribidi
external_python
# Needed for `MESON`.
external_python_site_packages
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_fribidi after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/fribidi/include ${HARVEST_TARGET}/fribidi/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/fribidi/lib/libfribidi.a ${HARVEST_TARGET}/fribidi/lib/libfribidi.lib
DEPENDEES install
)
endif()

View File

@@ -0,0 +1,32 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(GLEW_EXTRA_ARGS
-DBUILD_UTILS=Off
-DBUILD_SHARED_LIBS=Off
)
ExternalProject_Add(external_glew
URL ${GLEW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GLEW_HASH}
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_glew.txt ${BUILD_DIR}/glew/src/external_glew/CMakeLists.txt
PREFIX ${BUILD_DIR}/glew
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glew ${DEFAULT_CMAKE_FLAGS} ${GLEW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/glew
)

View File

@@ -0,0 +1,28 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(GLFW_EXTRA_ARGS)
ExternalProject_Add(external_glfw
URL ${GLFW_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${GLFW_HASH}
PREFIX ${BUILD_DIR}/glfw
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/glfw -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${GLFW_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/glfw
)

View File

@@ -1,13 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(GMMLIB_EXTRA_ARGS
)
ExternalProject_Add(external_gmmlib
URL file://${PACKAGE_DIR}/${GMMLIB_FILE}
URL_HASH ${GMMLIB_HASH_TYPE}=${GMMLIB_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/gmmlib
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/gmmlib ${DEFAULT_CMAKE_FLAGS} ${GMMLIB_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/gmmlib
)

View File

@@ -1,41 +1,42 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(GMP_EXTRA_ARGS -enable-cxx) set(GMP_EXTRA_ARGS -enable-cxx)
if(WIN32) if(WIN32)
# Shared for windows because static libs will drag in a libgcc dependency. # Shared for windows because static libs will drag in a libgcc dependency.
set(GMP_OPTIONS --disable-static --enable-shared --enable-fat --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32) set(GMP_OPTIONS --disable-static --enable-shared --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32)
else() else()
set(GMP_OPTIONS --enable-static --disable-shared ) set(GMP_OPTIONS --enable-static --disable-shared )
endif() endif()
if(APPLE AND NOT BLENDER_PLATFORM_ARM) if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
set(GMP_OPTIONS set(GMP_OPTIONS
${GMP_OPTIONS} ${GMP_OPTIONS}
--with-pic --disable-assembly
)
elseif(UNIX AND NOT APPLE)
set(GMP_OPTIONS
${GMP_OPTIONS}
--with-pic
--enable-fat
)
endif()
# Boolean crashes with Arm assembly, see T103423.
if(BLENDER_PLATFORM_ARM)
set(GMP_OPTIONS
${GMP_OPTIONS}
--disable-assembly
) )
endif() endif()
ExternalProject_Add(external_gmp ExternalProject_Add(external_gmp
URL file://${PACKAGE_DIR}/${GMP_FILE} URL ${GMP_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${GMP_HASH_TYPE}=${GMP_HASH} URL_HASH MD5=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmp PREFIX ${BUILD_DIR}/gmp
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/gmp/src/external_gmp < ${PATCH_DIR}/gmp.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/gmp ${GMP_OPTIONS} ${GMP_EXTRA_ARGS} CONFIGURE_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/gmp ${GMP_OPTIONS} ${GMP_EXTRA_ARGS}
BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make -j${MAKE_THREADS} BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make install INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/gmp/src/external_gmp/ && make install
@@ -48,21 +49,19 @@ endif()
if(BUILD_MODE STREQUAL Release AND WIN32) if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_gmp after_install ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/gmp/bin/libgmp-10.dll ${HARVEST_TARGET}/gmp/lib/libgmp-10.dll COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/gmp/bin/libgmp-10.dll ${HARVEST_TARGET}/gmp/lib/libgmp-10.dll
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib ${HARVEST_TARGET}/gmp/lib/libgmp-10.lib COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib ${HARVEST_TARGET}/gmp/lib/libgmp-10.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmp/include ${HARVEST_TARGET}/gmp/include COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/gmp/include ${HARVEST_TARGET}/gmp/include
DEPENDEES install DEPENDEES install
) )
endif() endif()
if(BUILD_MODE STREQUAL Debug AND WIN32) if(BUILD_MODE STREQUAL Debug AND WIN32)
ExternalProject_Add_Step(external_gmp after_install ExternalProject_Add_Step(external_gmp after_install
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-3.dll.def ${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def
COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib COMMAND lib /def:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.def /machine:x64 /out:${BUILD_DIR}/gmp/src/external_gmp/.libs/libgmp-10.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()
@@ -72,9 +71,9 @@ if(WIN32)
# given the C++ ABI between MSVC and mingw is not compatible, we need to build the bindings # given the C++ ABI between MSVC and mingw is not compatible, we need to build the bindings
# with MSVC, while GMP can only be build with mingw. # with MSVC, while GMP can only be build with mingw.
ExternalProject_Add(external_gmpxx ExternalProject_Add(external_gmpxx
URL file://${PACKAGE_DIR}/${GMP_FILE} URL ${GMP_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${GMP_HASH_TYPE}=${GMP_HASH} URL_HASH MD5=${GMP_HASH}
PREFIX ${BUILD_DIR}/gmpxx PREFIX ${BUILD_DIR}/gmpxx
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_gmpxx.txt ${BUILD_DIR}/gmpxx/src/external_gmpxx/CMakeLists.txt && PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_gmpxx.txt ${BUILD_DIR}/gmpxx/src/external_gmpxx/CMakeLists.txt &&
${CMAKE_COMMAND} -E copy ${PATCH_DIR}/config_gmpxx.h ${BUILD_DIR}/gmpxx/src/external_gmpxx/config.h ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/config_gmpxx.h ${BUILD_DIR}/gmpxx/src/external_gmpxx/config.h

View File

@@ -1,61 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
if(WIN32)
set(HARFBUZZ_CONFIGURE_ENV ${CONFIGURE_ENV_MSVC})
set(HARFBUZZ_PKG_ENV FREETYPE_DIR=${LIBDIR}/freetype)
else()
set(HARFBUZZ_CONFIGURE_ENV ${CONFIGURE_ENV})
set(HARFBUZZ_PKG_ENV "PKG_CONFIG_PATH=\
${LIBDIR}/freetype/lib/pkgconfig:\
${LIBDIR}/brotli/lib/pkgconfig:\
${LIBDIR}/lib/python3.10/pkgconfig:\
$PKG_CONFIG_PATH"
)
endif()
set(HARFBUZZ_EXTRA_OPTIONS
-Dtests=disabled
-Dfreetype=enabled
-Dglib=disabled
-Dgobject=disabled
# Only used for command line utilities,
# disable as this would add an addition & unnecessary build-dependency.
-Dcairo=disabled
)
ExternalProject_Add(external_harfbuzz
URL file://${PACKAGE_DIR}/${HARFBUZZ_FILE}
URL_HASH ${HARFBUZZ_HASH_TYPE}=${HARFBUZZ_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/harfbuzz
CONFIGURE_COMMAND ${HARFBUZZ_CONFIGURE_ENV} &&
${CMAKE_COMMAND} -E env ${HARFBUZZ_PKG_ENV}
${MESON} setup
--prefix ${LIBDIR}/harfbuzz ${HARFBUZZ_EXTRA_OPTIONS}
--default-library static
--libdir lib
${BUILD_DIR}/harfbuzz/src/external_harfbuzz-build
${BUILD_DIR}/harfbuzz/src/external_harfbuzz
BUILD_COMMAND ninja
INSTALL_COMMAND ninja install
INSTALL_DIR ${LIBDIR}/harfbuzz
)
add_dependencies(
external_harfbuzz
external_python
external_freetype
# Needed for `MESON`.
external_python_site_packages
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_harfbuzz after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/harfbuzz/include ${HARVEST_TARGET}/harfbuzz/include
# We do not use the subset API currently, so copying only the main library will suffice for now
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/harfbuzz/lib/libharfbuzz.a ${HARVEST_TARGET}/harfbuzz/lib/libharfbuzz.lib
DEPENDEES install
)
endif()

View File

@@ -1,30 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(HARU_EXTRA_ARGS
-DLIBHPDF_SHARED=OFF
-DLIBHPDF_STATIC=ON
-DLIBHPDF_EXAMPLES=OFF
-DLIBHPDF_ENABLE_EXCEPTIONS=ON
)
ExternalProject_Add(external_haru
URL file://${PACKAGE_DIR}/${HARU_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${HARU_HASH_TYPE}=${HARU_HASH}
PREFIX ${BUILD_DIR}/haru
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/haru/src/external_haru < ${PATCH_DIR}/haru.diff
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=${LIBDIR}/haru
${DEFAULT_CMAKE_FLAGS} ${HARU_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/haru
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_haru after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/haru/include ${HARVEST_TARGET}/haru/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/haru/lib/libhpdfs.lib ${HARVEST_TARGET}/haru/lib/libhpdfs.lib
DEPENDEES install
)
endif()
endif()

View File

@@ -1,7 +1,23 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
######################################################################## ########################################################################
# Copy all generated files to the proper structure as blender prefers # Copy all generated files to the proper strucure as blender prefers
######################################################################## ########################################################################
if(NOT DEFINED HARVEST_TARGET) if(NOT DEFINED HARVEST_TARGET)
@@ -10,302 +26,161 @@ endif()
message("HARVEST_TARGET = ${HARVEST_TARGET}") message("HARVEST_TARGET = ${HARVEST_TARGET}")
if(WIN32) if(WIN32)
if(BUILD_MODE STREQUAL Release)
add_custom_target(Harvest_Release_Results
COMMAND # jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
# freeglut-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
# glew-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
# tiff
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/
DEPENDS
)
endif()
if(BUILD_MODE STREQUAL Release) else(WIN32)
add_custom_target(Harvest_Release_Results
COMMAND # JPEG rename lib-file + copy include.
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpeg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# PNG.
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
# FREEGLUT -> OPENGL.
${CMAKE_COMMAND} -E copy ${LIBDIR}/freeglut/lib/freeglut_static.lib ${HARVEST_TARGET}/opengl/lib/freeglut_static.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/freeglut/include/ ${HARVEST_TARGET}/opengl/include/ &&
DEPENDS function(harvest from to)
) set(pattern "")
foreach(f ${ARGN})
set(pattern ${f})
endforeach()
if(pattern STREQUAL "")
get_filename_component(dirpath ${to} DIRECTORY)
get_filename_component(filename ${to} NAME)
install(
FILES ${LIBDIR}/${from}
DESTINATION ${HARVEST_TARGET}/${dirpath}
RENAME ${filename})
else()
install(
DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE)
endif() endif()
endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest(alembic/bin alembic/bin "*")
harvest(boost/include boost/include "*")
harvest(boost/lib boost/lib "*.a")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
harvest(fftw3/lib fftw3/lib "*.a")
harvest(flac/lib sndfile/lib "libFLAC.a")
harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(glew/include glew/include "*.h")
harvest(glew/lib glew/lib "*.a")
harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
harvest(clang/bin llvm/bin "clang-format")
harvest(clang/include llvm/include "*")
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
if(APPLE)
harvest(openmp/lib openmp/lib "*")
harvest(openmp/include openmp/include "*.h")
endif()
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)
harvest(openal/lib openal/lib "*.a")
harvest(blosc/include blosc/include "*.h")
harvest(blosc/lib blosc/lib "*.a")
harvest(zlib/include zlib/include "*.h")
harvest(zlib/lib zlib/lib "*.a")
harvest(xml2/include xml2/include "*.h")
harvest(xml2/lib xml2/lib "*.a")
else() else()
harvest(blosc/lib openvdb/lib "*.a")
function(harvest from to) harvest(xml2/lib opencollada/lib "*.a")
set(pattern "") endif()
foreach(f ${ARGN}) harvest(opencollada/include/opencollada opencollada/include "*.h")
set(pattern ${f}) harvest(opencollada/lib/opencollada opencollada/lib "*.a")
endforeach() harvest(opencolorio/include opencolorio/include "*.h")
harvest(opencolorio/lib opencolorio/lib "*.a")
if(pattern STREQUAL "") harvest(opencolorio/lib/static opencolorio/lib "*.a")
get_filename_component(dirpath ${to} DIRECTORY) harvest(openexr/include openexr/include "*.h")
get_filename_component(filename ${to} NAME) harvest(openexr/lib openexr/lib "*.a")
install( harvest(openimageio/bin openimageio/bin "idiff")
FILES ${LIBDIR}/${from} harvest(openimageio/bin openimageio/bin "maketx")
DESTINATION ${HARVEST_TARGET}/${dirpath} harvest(openimageio/bin openimageio/bin "oiiotool")
RENAME ${filename} harvest(openimageio/include openimageio/include "*")
) harvest(openimageio/lib openimageio/lib "*.a")
else() if((NOT APPLE) OR ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
install(
DIRECTORY ${LIBDIR}/${from}/
DESTINATION ${HARVEST_TARGET}/${to}
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE
PATTERN "meson*" EXCLUDE
)
endif()
endfunction()
# Set rpath on shared libraries to $ORIGIN since all will be installed in the same
# lib folder, and remove any absolute paths.
#
# Ideally this would be done as part of the Blender build since it makes assumptions
# about where the files will be installed. However it would add patchelf as a new
# dependency for building.
#
# Also removes versioned symlinks, which give errors with macOS notarization.
if(APPLE)
set(set_rpath_cmd python3 ${CMAKE_CURRENT_SOURCE_DIR}/darwin/set_rpath.py @loader_path)
else()
set(set_rpath_cmd patchelf --set-rpath $ORIGIN)
endif()
function(harvest_rpath_lib from to pattern)
harvest(${from} ${to} ${pattern})
install(CODE "\
cmake_policy(SET CMP0009 NEW)\n
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
foreach(f \${shared_libs}) \n
if(IS_SYMLINK \${f})\n
if(APPLE)\n
file(REMOVE_RECURSE \${f})
endif()\n
else()\n
execute_process(COMMAND ${set_rpath_cmd} \${f}) \n
endif()\n
endforeach()")
endfunction()
# Set rpath on utility binaries assuming they are run from their install location.
function(harvest_rpath_bin from to pattern)
harvest(${from} ${to} ${pattern})
install(CODE "\
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}) \n
foreach(f \${shared_libs}) \n
execute_process(COMMAND ${set_rpath_cmd}/../lib; \${f}) \n
endforeach()")
endfunction()
# Set rpath on Python module to point to the shared libraries folder in the Blender
# installation.
function(harvest_rpath_python from to pattern)
harvest(${from} ${to} ${pattern})
install(CODE "\
file(GLOB_RECURSE shared_libs ${HARVEST_TARGET}/${to}/${pattern}\.so*) \n
foreach(f \${shared_libs}) \n
if(IS_SYMLINK \${f})\n
if(APPLE)\n
file(REMOVE_RECURSE \${f})
endif()\n
else()\n
get_filename_component(f_dir \${f} DIRECTORY) \n
file(RELATIVE_PATH relative_dir \${f_dir} ${HARVEST_TARGET}) \n
execute_process(COMMAND ${set_rpath_cmd}/\${relative_dir}../lib \${f}) \n
endif()\n
endforeach()")
endfunction()
harvest(alembic/include alembic/include "*.h")
harvest(alembic/lib/libAlembic.a alembic/lib/libAlembic.a)
harvest_rpath_bin(alembic/bin alembic/bin "*")
harvest(brotli/include brotli/include "*.h")
harvest(brotli/lib brotli/lib "*.a")
harvest(boost/include boost/include "*")
harvest_rpath_lib(boost/lib boost/lib "*${SHAREDLIBEXT}*")
harvest(imath/include imath/include "*.h")
harvest_rpath_lib(imath/lib imath/lib "*${SHAREDLIBEXT}*")
harvest(ffmpeg/include ffmpeg/include "*.h")
harvest(ffmpeg/lib ffmpeg/lib "*.a")
harvest(fftw3/include fftw3/include "*.h")
harvest(fftw3/lib fftw3/lib "*.a")
harvest(flac/lib sndfile/lib "libFLAC.a")
harvest(freetype/include freetype/include "*.h")
harvest(freetype/lib/libfreetype2ST.a freetype/lib/libfreetype.a)
harvest(fribidi/include fribidi/include "*.h")
harvest(fribidi/lib fribidi/lib "*.a")
harvest(epoxy/include epoxy/include "*.h")
harvest(epoxy/lib epoxy/lib "*.a")
harvest(gmp/include gmp/include "*.h")
harvest(gmp/lib gmp/lib "*.a")
harvest(harfbuzz/include harfbuzz/include "*.h")
harvest(harfbuzz/lib harfbuzz/lib "*.a")
harvest(jemalloc/include jemalloc/include "*.h")
harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpeg/include jpeg/include "*.h")
harvest(jpeg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
if(NOT APPLE)
harvest(level-zero/include/level_zero level-zero/include/level_zero "*.h")
harvest(level-zero/lib level-zero/lib "*${SHAREDLIBEXT}*")
endif()
harvest(llvm/bin llvm/bin "clang-format")
if(BUILD_CLANG_TOOLS)
harvest(llvm/bin llvm/bin "clang-tidy")
harvest(llvm/share/clang llvm/share "run-clang-tidy.py")
endif()
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
harvest(llvm/lib llvm/lib "libclang*.a")
harvest(llvm/lib/clang llvm/lib/clang "*.h")
if(APPLE)
harvest(openmp/lib openmp/lib "libomp.dylib")
harvest(openmp/include openmp/include "*.h")
endif()
if(BLENDER_PLATFORM_ARM)
harvest(sse2neon sse2neon "*.h")
endif()
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)
harvest(openal/lib openal/lib "*.a")
harvest(zlib/include zlib/include "*.h")
harvest(zlib/lib zlib/lib "*.a")
harvest(xml2/include xml2/include "*.h")
harvest(xml2/lib xml2/lib "*.a")
harvest(
wayland-protocols/share/wayland-protocols
wayland-protocols/share/wayland-protocols/
"*.xml"
)
harvest(wayland/bin wayland/bin "wayland-scanner")
harvest(wayland/include wayland/include "*.h")
harvest(wayland_libdecor/include wayland_libdecor/include "*.h")
else()
harvest(blosc/lib openvdb/lib "*.a")
harvest(xml2/lib opencollada/lib "*.a")
endif()
harvest(opencollada/include/opencollada opencollada/include "*.h")
harvest(opencollada/lib/opencollada opencollada/lib "*.a")
harvest(opencolorio/include opencolorio/include "*.h")
harvest_rpath_lib(opencolorio/lib opencolorio/lib "*${SHAREDLIBEXT}*")
harvest_rpath_python(
opencolorio/lib/python${PYTHON_SHORT_VERSION}
python/lib/python${PYTHON_SHORT_VERSION}
"*"
)
harvest(openexr/include openexr/include "*.h")
harvest_rpath_lib(openexr/lib openexr/lib "*${SHAREDLIBEXT}*")
harvest_rpath_bin(openimageio/bin openimageio/bin "idiff")
harvest_rpath_bin(openimageio/bin openimageio/bin "maketx")
harvest_rpath_bin(openimageio/bin openimageio/bin "oiiotool")
harvest(openimageio/include openimageio/include "*")
harvest_rpath_lib(openimageio/lib openimageio/lib "*${SHAREDLIBEXT}*")
harvest_rpath_python(
openimageio/lib/python${PYTHON_SHORT_VERSION}
python/lib/python${PYTHON_SHORT_VERSION}
"*"
)
harvest(openimagedenoise/include openimagedenoise/include "*") harvest(openimagedenoise/include openimagedenoise/include "*")
harvest(openimagedenoise/lib openimagedenoise/lib "*.a") harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
harvest(embree/include embree/include "*.h") harvest(embree/include embree/include "*.h")
harvest(embree/lib embree/lib "*.a") harvest(embree/lib embree/lib "*.a")
harvest(openpgl/include openpgl/include "*.h") endif()
harvest(openpgl/lib openpgl/lib "*.a") harvest(openjpeg/include/openjpeg-2.3 openjpeg/include "*.h")
harvest(openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION} openpgl/lib/cmake/openpgl "*.cmake") harvest(openjpeg/lib openjpeg/lib "*.a")
harvest(openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} openjpeg/include "*.h") harvest(opensubdiv/include opensubdiv/include "*.h")
harvest(openjpeg/lib openjpeg/lib "*.a") harvest(opensubdiv/lib opensubdiv/lib "*.a")
harvest(opensubdiv/include opensubdiv/include "*.h") harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h")
harvest_rpath_lib(opensubdiv/lib opensubdiv/lib "*${SHAREDLIBEXT}*") harvest(openvdb/lib openvdb/lib "*.a")
harvest(openvdb/include/openvdb openvdb/include/openvdb "*.h") harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h")
harvest(openvdb/include/nanovdb openvdb/include/nanovdb "*.h") harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a")
harvest_rpath_lib(openvdb/lib openvdb/lib "*${SHAREDLIBEXT}*") harvest(osl/bin osl/bin "oslc")
harvest_rpath_python( harvest(osl/include osl/include "*.h")
openvdb/lib/python${PYTHON_SHORT_VERSION} harvest(osl/lib osl/lib "*.a")
python/lib/python${PYTHON_SHORT_VERSION} harvest(osl/shaders osl/shaders "*.h")
"*pyopenvdb*" harvest(png/include png/include "*.h")
) harvest(png/lib png/lib "*.a")
harvest(xr_openxr_sdk/include/openxr xr_openxr_sdk/include/openxr "*.h") harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}m")
harvest(xr_openxr_sdk/lib xr_openxr_sdk/lib "*.a") harvest(python/include python/include "*h")
harvest_rpath_bin(osl/bin osl/bin "oslc") harvest(python/lib python/lib "*")
harvest(osl/include osl/include "*.h") harvest(sdl/include/SDL2 sdl/include "*.h")
harvest(osl/lib osl/lib "*.a") harvest(sdl/lib sdl/lib "libSDL2.a")
harvest(osl/share/OSL/shaders osl/share/OSL/shaders "*.h") harvest(sndfile/include sndfile/include "*.h")
harvest(png/include png/include "*.h") harvest(sndfile/lib sndfile/lib "*.a")
harvest(png/lib png/lib "*.a") harvest(spnav/include spnav/include "*.h")
harvest(pugixml/include pugixml/include "*.hpp") harvest(spnav/lib spnav/lib "*.a")
harvest(pugixml/lib pugixml/lib "*.a") harvest(tbb/include tbb/include "*.h")
harvest(python/bin python/bin "python${PYTHON_SHORT_VERSION}") harvest(tbb/lib/libtbb_static.a tbb/lib/libtbb.a)
harvest(python/include python/include "*h") harvest(theora/lib ffmpeg/lib "*.a")
harvest(python/lib python/lib "*") harvest(tiff/include tiff/include "*.h")
harvest(sdl/include/SDL2 sdl/include "*.h") harvest(tiff/lib tiff/lib "*.a")
harvest(sdl/lib sdl/lib "libSDL2.a") harvest(vorbis/lib ffmpeg/lib "*.a")
harvest(sndfile/include sndfile/include "*.h") harvest(opus/lib ffmpeg/lib "*.a")
harvest(sndfile/lib sndfile/lib "*.a") harvest(vpx/lib ffmpeg/lib "*.a")
harvest(spnav/include spnav/include "*.h") harvest(webp/lib ffmpeg/lib "*.a")
harvest(spnav/lib spnav/lib "*.a") harvest(x264/lib ffmpeg/lib "*.a")
harvest(tbb/include tbb/include "*.h") harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest_rpath_lib(tbb/lib tbb/lib "libtbb${SHAREDLIBEXT}") harvest(usd/include usd/include "*.h")
harvest(theora/lib ffmpeg/lib "*.a") harvest(usd/lib/usd usd/lib/usd "*")
harvest(tiff/include tiff/include "*.h") harvest(usd/plugin usd/plugin "*")
harvest(tiff/lib tiff/lib "*.a")
harvest(vorbis/lib ffmpeg/lib "*.a") if(UNIX AND NOT APPLE)
harvest(opus/lib ffmpeg/lib "*.a") harvest(libglu/lib mesa/lib "*.so*")
harvest(vpx/lib ffmpeg/lib "*.a") harvest(mesa/lib mesa/lib "*.so*")
harvest(x264/lib ffmpeg/lib "*.a") endif()
harvest(xvidcore/lib ffmpeg/lib "*.a")
harvest(aom/lib ffmpeg/lib "*.a")
harvest(webp/lib webp/lib "*.a")
harvest(webp/include webp/include "*.h")
harvest(usd/include usd/include "*.h")
harvest_rpath_lib(usd/lib usd/lib "libusd_ms${SHAREDLIBEXT}")
harvest(usd/lib/usd usd/lib/usd "*")
harvest_rpath_python(
usd/lib/python/pxr
python/lib/python${PYTHON_SHORT_VERSION}/site-packages/pxr
"*"
)
harvest(usd/plugin usd/plugin "*")
harvest(materialx/include materialx/include "*.h")
harvest_rpath_lib(materialx/lib materialx/lib "*${SHAREDLIBEXT}*")
harvest(materialx/libraries materialx/libraries "*")
harvest(materialx/lib/cmake/MaterialX materialx/lib/cmake/MaterialX "*.cmake")
harvest_rpath_python(
materialx/python/MaterialX
python/lib/python${PYTHON_SHORT_VERSION}/site-packages/MaterialX
"*"
)
# We do not need anything from the resources folder, but the MaterialX config
# file will complain if the folder does not exist, so just copy the readme.md
# files to ensure the folder will exist.
harvest(materialx/resources materialx/resources "README.md")
harvest(potrace/include potrace/include "*.h")
harvest(potrace/lib potrace/lib "*.a")
harvest(haru/include haru/include "*.h")
harvest(haru/lib haru/lib "*.a")
harvest(zstd/include zstd/include "*.h")
harvest(zstd/lib zstd/lib "*.a")
harvest(shaderc shaderc "*")
harvest(vulkan_headers vulkan "*")
harvest_rpath_lib(vulkan_loader/lib vulkan/lib "*${SHAREDLIBEXT}*")
if(APPLE)
harvest(vulkan_loader/loader vulkan/loader "*")
endif()
if(UNIX AND NOT APPLE)
harvest(libglu/lib mesa/lib "*${SHAREDLIBEXT}*")
harvest(mesa/lib64 mesa/lib "*${SHAREDLIBEXT}*")
harvest(dpcpp dpcpp "*")
harvest(igc dpcpp/lib/igc "*")
harvest(ocloc dpcpp/lib/ocloc "*")
endif()
endif() endif()

View File

@@ -1,11 +1,27 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(ICONV_EXTRA_ARGS) set(ICONV_EXTRA_ARGS)
ExternalProject_Add(external_iconv ExternalProject_Add(external_iconv
URL file://${PACKAGE_DIR}/${ICONV_FILE} URL ${ICONV_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ICONV_HASH_TYPE}=${ICONV_HASH} URL_HASH MD5=${ICONV_HASH}
PREFIX ${BUILD_DIR}/iconv PREFIX ${BUILD_DIR}/iconv
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/iconv CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/iconv
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make -j${MAKE_THREADS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/iconv/src/external_iconv/ && make -j${MAKE_THREADS}

View File

@@ -1,126 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
unpack_only(igc_vcintrinsics)
unpack_only(igc_spirv_headers)
unpack_only(igc_spirv_tools)
#
# igc_opencl_clang contains patches that need to be applied
# to external_igc_llvm and igc_spirv_translator, we unpack
# igc_opencl_clang first, then have the patch stages of
# external_igc_llvm and igc_spirv_translator apply them.
#
ExternalProject_Add(external_igc_opencl_clang
URL file://${PACKAGE_DIR}/${IGC_OPENCL_CLANG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_OPENCL_CLANG_HASH_TYPE}=${IGC_OPENCL_CLANG_HASH}
PREFIX ${BUILD_DIR}/igc_opencl_clang
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/ < ${PATCH_DIR}/igc_opencl_clang.diff
)
set(IGC_OPENCL_CLANG_PATCH_DIR ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/patches)
set(IGC_LLVM_SOURCE_DIR ${BUILD_DIR}/igc_llvm/src/external_igc_llvm)
set(IGC_SPIRV_TRANSLATOR_SOURCE_DIR ${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator)
ExternalProject_Add(external_igc_llvm
URL file://${PACKAGE_DIR}/${IGC_LLVM_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_LLVM_HASH_TYPE}=${IGC_LLVM_HASH}
PREFIX ${BUILD_DIR}/igc_llvm
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0001-OpenCL-3.0-support.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0002-Remove-__IMAGE_SUPPORT__-macro-for-SPIR.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0003-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0004-OpenCL-support-cl_ext_float_atomics.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/clang/0005-OpenCL-Add-cl_khr_integer_dot_product.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0001-Memory-leak-fix-for-Managed-Static-Mutex.patch &&
${PATCH_CMD} -p 1 -d ${IGC_LLVM_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/llvm/0002-Remove-repo-name-in-LLVM-IR.patch
)
add_dependencies(
external_igc_llvm
external_igc_opencl_clang
)
ExternalProject_Add(external_igc_spirv_translator
URL file://${PACKAGE_DIR}/${IGC_SPIRV_TRANSLATOR_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_SPIRV_TRANSLATOR_HASH_TYPE}=${IGC_SPIRV_TRANSLATOR_HASH}
PREFIX ${BUILD_DIR}/igc_spirv_translator
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0001-update-SPIR-V-headers-for-SPV_INTEL_split_barrier.patch &&
${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0002-Add-support-for-split-barriers-extension-SPV_INTEL_s.patch &&
${PATCH_CMD} -p 1 -d ${IGC_SPIRV_TRANSLATOR_SOURCE_DIR} < ${IGC_OPENCL_CLANG_PATCH_DIR}/spirv/0003-Support-cl_bf16_conversions.patch
)
add_dependencies(
external_igc_spirv_translator
external_igc_opencl_clang
)
if(WIN32)
set(IGC_GENERATOR "Ninja")
set(IGC_TARGET Windows64)
else()
set(IGC_GENERATOR "Unix Makefiles")
set(IGC_TARGET Linux64)
endif()
set(IGC_EXTRA_ARGS
-DIGC_OPTION__ARCHITECTURE_TARGET=${IGC_TARGET}
-DIGC_OPTION__ARCHITECTURE_HOST=${IGC_TARGET}
)
if(UNIX AND NOT APPLE)
list(APPEND IGC_EXTRA_ARGS
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
-DFLEX_INCLUDE_DIR=${LIBDIR}/flex/include
)
endif()
ExternalProject_Add(external_igc
URL file://${PACKAGE_DIR}/${IGC_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IGC_HASH_TYPE}=${IGC_HASH}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/igc ${DEFAULT_CMAKE_FLAGS} ${IGC_EXTRA_ARGS}
# IGC is pretty set in its way where sub projects ought to live, for some it offers
# hooks to supply alternatives folders, other are just hardocded with no way to configure
# we symlink everything here, since it's less work than trying to convince the cmake
# scripts to accept alternative locations.
#
PATCH_COMMAND ${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_llvm/src/external_igc_llvm/ ${BUILD_DIR}/igc/src/llvm-project &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_opencl_clang/src/external_igc_opencl_clang/ ${BUILD_DIR}/igc/src/llvm-project/llvm/projects/opencl-clang &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_translator/src/external_igc_spirv_translator/ ${BUILD_DIR}/igc/src/llvm-project/llvm/projects/llvm-spirv &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_tools/src/external_igc_spirv_tools/ ${BUILD_DIR}/igc/src/SPIRV-Tools &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_spirv_headers/src/external_igc_spirv_headers/ ${BUILD_DIR}/igc/src/SPIRV-Headers &&
${CMAKE_COMMAND} -E create_symlink ${BUILD_DIR}/igc_vcintrinsics/src/external_igc_vcintrinsics/ ${BUILD_DIR}/igc/src/vc-intrinsics
PREFIX ${BUILD_DIR}/igc
INSTALL_DIR ${LIBDIR}/igc
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --strip
CMAKE_GENERATOR ${IGC_GENERATOR}
)
add_dependencies(
external_igc
external_igc_vcintrinsics
external_igc_llvm
external_igc_opencl_clang
external_igc_vcintrinsics
external_igc_spirv_headers
external_igc_spirv_tools
external_igc_spirv_translator
)
if(UNIX AND NOT APPLE)
add_dependencies(
external_igc
external_flex
)
endif()

View File

@@ -1,26 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(IMATH_EXTRA_ARGS
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=OFF
-DIMATH_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
)
ExternalProject_Add(external_imath
URL file://${PACKAGE_DIR}/${IMATH_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${IMATH_HASH_TYPE}=${IMATH_HASH}
PREFIX ${BUILD_DIR}/imath
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/imath ${DEFAULT_CMAKE_FLAGS} ${IMATH_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/imath
)
if(WIN32)
ExternalProject_Add_Step(external_imath after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/imath/lib ${HARVEST_TARGET}/imath/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/imath/include ${HARVEST_TARGET}/imath/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/imath/bin/imath${OPENEXR_VERSION_POSTFIX}.dll ${HARVEST_TARGET}/imath/bin/imath${OPENEXR_VERSION_POSTFIX}.dll
DEPENDEES install
)
endif()

View File

@@ -1,60 +1,60 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32) if(WIN32)
set(ISPC_EXTRA_ARGS_WIN set(ISPC_EXTRA_ARGS_WIN
-DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe
-DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe
-DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe -DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe
-DARM_ENABLED=Off
-DPython3_FIND_REGISTRY=NEVER
) )
elseif(APPLE) elseif(APPLE)
# Use bison and flex installed via Homebrew. # Use bison installed via Homebrew.
# The ones that come with Xcode toolset are too old. # The one which comes which Xcode toolset is too old.
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64") set(ISPC_EXTRA_ARGS_APPLE
set(ISPC_EXTRA_ARGS_APPLE -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
-DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison )
-DFLEX_EXECUTABLE=/opt/homebrew/opt/flex/bin/flex
-DARM_ENABLED=On
)
else()
set(ISPC_EXTRA_ARGS_APPLE
-DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison
-DFLEX_EXECUTABLE=/usr/local/opt/flex/bin/flex
-DARM_ENABLED=Off
)
endif()
elseif(UNIX) elseif(UNIX)
set(ISPC_EXTRA_ARGS_UNIX set(ISPC_EXTRA_ARGS_UNIX
-DCMAKE_C_COMPILER=${LIBDIR}/llvm/bin/clang -DCMAKE_C_COMPILER=${LIBDIR}/clang/bin/clang
-DCMAKE_CXX_COMPILER=${LIBDIR}/llvm/bin/clang++ -DCMAKE_CXX_COMPILER=${LIBDIR}/clang/bin/clang++
-DARM_ENABLED=${BLENDER_PLATFORM_ARM}
-DFLEX_EXECUTABLE=${LIBDIR}/flex/bin/flex
) )
endif() endif()
set(ISPC_EXTRA_ARGS set(ISPC_EXTRA_ARGS
-DISPC_NO_DUMPS=On -DARM_ENABLED=Off
-DISPC_INCLUDE_EXAMPLES=Off -DISPC_NO_DUMPS=On
-DISPC_INCLUDE_TESTS=Off -DISPC_INCLUDE_EXAMPLES=Off
-DLLVM_ROOT=${LIBDIR}/llvm/lib/cmake/llvm -DISPC_INCLUDE_TESTS=Off
-DLLVM_LIBRARY_DIR=${LIBDIR}/llvm/lib -DLLVM_ROOT=${LIBDIR}/llvm/lib/cmake/llvm
-DCLANG_EXECUTABLE=${LIBDIR}/llvm/bin/clang -DLLVM_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANGPP_EXECUTABLE=${LIBDIR}/llvm/bin/clang++ -DCLANG_EXECUTABLE=${LIBDIR}/clang/bin/clang
-DISPC_INCLUDE_TESTS=Off -DISPC_INCLUDE_TESTS=Off
-DCLANG_LIBRARY_DIR=${LIBDIR}/llvm/lib -DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/llvm/include -DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include
-DPython3_ROOT_DIR=${LIBDIR}/python/ ${ISPC_EXTRA_ARGS_WIN}
-DPython3_EXECUTABLE=${PYTHON_BINARY} ${ISPC_EXTRA_ARGS_APPLE}
${ISPC_EXTRA_ARGS_WIN} ${ISPC_EXTRA_ARGS_UNIX}
${ISPC_EXTRA_ARGS_APPLE}
${ISPC_EXTRA_ARGS_UNIX}
) )
ExternalProject_Add(external_ispc ExternalProject_Add(external_ispc
URL file://${PACKAGE_DIR}/${ISPC_FILE} URL ${ISPC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ISPC_HASH_TYPE}=${ISPC_HASH} URL_HASH MD5=${ISPC_HASH}
PREFIX ${BUILD_DIR}/ispc PREFIX ${BUILD_DIR}/ispc
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/ispc/src/external_ispc < ${PATCH_DIR}/ispc.diff PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/ispc/src/external_ispc < ${PATCH_DIR}/ispc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ispc -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ISPC_EXTRA_ARGS} ${BUILD_DIR}/ispc/src/external_ispc CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ispc -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ISPC_EXTRA_ARGS} ${BUILD_DIR}/ispc/src/external_ispc
@@ -64,7 +64,7 @@ ExternalProject_Add(external_ispc
add_dependencies( add_dependencies(
external_ispc external_ispc
ll ll
external_python external_clang
) )
if(WIN32) if(WIN32)
@@ -72,9 +72,4 @@ if(WIN32)
external_ispc external_ispc
external_flexbison external_flexbison
) )
elseif(UNIX AND NOT APPLE)
add_dependencies(
external_ispc
external_flex
)
endif() endif()

View File

@@ -1,9 +1,25 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_jemalloc ExternalProject_Add(external_jemalloc
URL file://${PACKAGE_DIR}/${JEMALLOC_FILE} URL ${JEMALLOC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${JEMALLOC_HASH_TYPE}=${JEMALLOC_HASH} URL_HASH MD5=${JEMALLOC_HASH}
PREFIX ${BUILD_DIR}/jemalloc PREFIX ${BUILD_DIR}/jemalloc
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jemalloc --disable-shared --enable-static --with-pic CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jemalloc --disable-shared --enable-static --with-pic
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && make -j${MAKE_THREADS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/jemalloc/src/external_jemalloc/ && make -j${MAKE_THREADS}

View File

@@ -1,54 +1,62 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32) if(WIN32)
# CMAKE for MS-Windows. # cmake for windows
set(JPEG_EXTRA_ARGS set(JPEG_EXTRA_ARGS -DNASM=${NASM_PATH} -DWITH_JPEG8=ON -DCMAKE_DEBUG_POSTFIX=d -DWITH_CRT_DLL=On)
-DNASM=${NASM_PATH}
-DWITH_JPEG8=ON
-DCMAKE_DEBUG_POSTFIX=d
-DWITH_CRT_DLL=On
-DENABLE_SHARED=OFF
-DENABLE_STATIC=ON
)
ExternalProject_Add(external_jpeg ExternalProject_Add(external_jpeg
URL file://${PACKAGE_DIR}/${JPEG_FILE} URL ${JPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH} URL_HASH MD5=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpeg PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpeg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpeg INSTALL_DIR ${LIBDIR}/jpg
) )
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_jpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpegd${LIBEXT} ${LIBDIR}/jpg/lib/jpeg${LIBEXT}
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
set(JPEG_LIBRARY jpeg-static${LIBEXT}) set(JPEG_LIBRARY jpeg-static${LIBEXT})
else() else()
set(JPEG_LIBRARY jpeg-staticd${LIBEXT}) set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
endif() endif()
else(WIN32)
if(BUILD_MODE STREQUAL Release) # cmake for unix
ExternalProject_Add_Step(external_jpeg after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpeg/lib/${JPEG_LIBRARY} ${LIBDIR}/jpeg/lib/jpeg${LIBEXT}
DEPENDEES install
)
endif()
else()
# CMAKE for UNIX.
set(JPEG_EXTRA_ARGS set(JPEG_EXTRA_ARGS
-DWITH_JPEG8=ON -DWITH_JPEG8=ON
-DENABLE_STATIC=ON -DENABLE_STATIC=ON
-DENABLE_SHARED=OFF -DENABLE_SHARED=OFF
-DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpeg/lib) -DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpg/lib)
ExternalProject_Add(external_jpeg ExternalProject_Add(external_jpeg
URL file://${PACKAGE_DIR}/${JPEG_FILE} URL ${JPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${JPEG_HASH_TYPE}=${JPEG_HASH} URL_HASH MD5=${JPEG_HASH}
PREFIX ${BUILD_DIR}/jpeg PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpeg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpeg INSTALL_DIR ${LIBDIR}/jpg
) )
set(JPEG_LIBRARY libjpeg${LIBEXT}) set(JPEG_LIBRARY libjpeg${LIBEXT})
endif() endif(WIN32)

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LAME_EXTRA_ARGS) set(LAME_EXTRA_ARGS)
if(MSVC) if(MSVC)
@@ -8,9 +24,9 @@ if(MSVC)
endif() endif()
ExternalProject_Add(external_lame ExternalProject_Add(external_lame
URL file://${PACKAGE_DIR}/${LAME_FILE} URL ${LAME_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LAME_HASH_TYPE}=${LAME_HASH} URL_HASH MD5=${LAME_HASH}
PREFIX ${BUILD_DIR}/lame PREFIX ${BUILD_DIR}/lame
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lame --disable-shared --enable-static ${LAME_EXTRA_ARGS} CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lame/src/external_lame/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lame --disable-shared --enable-static ${LAME_EXTRA_ARGS}
--enable-export=full --enable-export=full

View File

@@ -0,0 +1,31 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LCMS_EXTRA_ARGS
)
ExternalProject_Add(external_lcms
URL ${LCMS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${LCMS_HASH}
PREFIX ${BUILD_DIR}/lcms
# Patch taken from ocio.
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_lcms.txt ${BUILD_DIR}/lcms/src/external_lcms/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/lcms ${DEFAULT_CMAKE_FLAGS} ${LCMS_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/lcms
)

View File

@@ -1,21 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(LEVEL_ZERO_EXTRA_ARGS
)
ExternalProject_Add(external_level-zero
URL file://${PACKAGE_DIR}/${LEVEL_ZERO_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LEVEL_ZERO_HASH_TYPE}=${LEVEL_ZERO_HASH}
PREFIX ${BUILD_DIR}/level-zero
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/level-zero/src/external_level-zero < ${PATCH_DIR}/level-zero.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/level-zero ${DEFAULT_CMAKE_FLAGS} ${LEVEL_ZERO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/level-zero
)
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_level-zero after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/level-zero ${HARVEST_TARGET}/level-zero
DEPENDEES install
)
endif()

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LIBGLU_CFLAGS "-static-libgcc") set(LIBGLU_CFLAGS "-static-libgcc")
set(LIBGLU_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a") set(LIBGLU_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
@@ -11,9 +27,9 @@ set(LIBGLU_EXTRA_FLAGS
) )
ExternalProject_Add(external_libglu ExternalProject_Add(external_libglu
URL file://${PACKAGE_DIR}/${LIBGLU_FILE} URL ${LIBGLU_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LIBGLU_HASH_TYPE}=${LIBGLU_HASH} URL_HASH MD5=${LIBGLU_HASH}
PREFIX ${BUILD_DIR}/libglu PREFIX ${BUILD_DIR}/libglu
CONFIGURE_COMMAND ${CONFIGURE_ENV} && CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/libglu/src/external_libglu/ && cd ${BUILD_DIR}/libglu/src/external_libglu/ &&

View File

@@ -1,23 +1,27 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BLENDER_PLATFORM_ARM) if(APPLE AND "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64")
set(LLVM_TARGETS AArch64$<SEMICOLON>ARM) set(LLVM_TARGETS AArch64)
else() else()
set(LLVM_TARGETS X86) set(LLVM_TARGETS X86)
endif() endif()
if(APPLE)
set(LLVM_XML2_ARGS
-DLIBXML2_LIBRARY=${LIBDIR}/xml2/lib/libxml2.a
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
)
set(LLVM_BUILD_CLANG_TOOLS_EXTRA ^^clang-tools-extra)
set(BUILD_CLANG_TOOLS ON)
else()
# NVIDIA PTX for OSL on Windows and Linux.
set(LLVM_TARGETS ${LLVM_TARGETS}$<SEMICOLON>NVPTX)
endif()
set(LLVM_EXTRA_ARGS set(LLVM_EXTRA_ARGS
-DLLVM_USE_CRT_RELEASE=MD -DLLVM_USE_CRT_RELEASE=MD
-DLLVM_USE_CRT_DEBUG=MDd -DLLVM_USE_CRT_DEBUG=MDd
@@ -27,45 +31,29 @@ set(LLVM_EXTRA_ARGS
-DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_BUILD_LLVM_C_DYLIB=OFF -DLLVM_BUILD_LLVM_C_DYLIB=OFF
-DLLVM_ENABLE_UNWIND_TABLES=OFF -DLLVM_ENABLE_UNWIND_TABLES=OFF
-DLLVM_ENABLE_PROJECTS=clang${LLVM_BUILD_CLANG_TOOLS_EXTRA}
-DPython3_ROOT_DIR=${LIBDIR}/python/
-DPython3_EXECUTABLE=${PYTHON_BINARY}
${LLVM_XML2_ARGS}
) )
if(WIN32) if(WIN32)
set(LLVM_GENERATOR "Ninja") set(LLVM_GENERATOR "Ninja")
list(APPEND LLVM_EXTRA_ARGS -DPython3_FIND_REGISTRY=NEVER)
else() else()
set(LLVM_GENERATOR "Unix Makefiles") set(LLVM_GENERATOR "Unix Makefiles")
endif() endif()
# LLVM does not switch over to cpp17 until llvm 16 and building ealier versions with
# MSVC is leading to some crashes in ISPC. Switch back to their default on all platforms
# for now.
string(REPLACE "-DCMAKE_CXX_STANDARD=17" " " LLVM_CMAKE_FLAGS "${DEFAULT_CMAKE_FLAGS}")
# short project name due to long filename issues on windows # short project name due to long filename issues on windows
ExternalProject_Add(ll ExternalProject_Add(ll
URL file://${PACKAGE_DIR}/${LLVM_FILE} URL ${LLVM_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LLVM_HASH_TYPE}=${LLVM_HASH} URL_HASH MD5=${LLVM_HASH}
CMAKE_GENERATOR ${LLVM_GENERATOR} CMAKE_GENERATOR ${LLVM_GENERATOR}
LIST_SEPARATOR ^^
PREFIX ${BUILD_DIR}/ll PREFIX ${BUILD_DIR}/ll
SOURCE_SUBDIR llvm
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/ll/src/ll < ${PATCH_DIR}/llvm.diff PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/ll/src/ll < ${PATCH_DIR}/llvm.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/llvm ${LLVM_CMAKE_FLAGS} ${LLVM_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/llvm ${DEFAULT_CMAKE_FLAGS} ${LLVM_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/llvm INSTALL_DIR ${LIBDIR}/llvm
) )
if(MSVC) if(MSVC)
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
set(LLVM_HARVEST_COMMAND set(LLVM_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/ ${HARVEST_TARGET}/llvm/ )
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib ${HARVEST_TARGET}/llvm/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/include ${HARVEST_TARGET}/llvm/include &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/llvm/bin/clang-format.exe ${HARVEST_TARGET}/llvm/bin/clang-format.exe
)
else() else()
set(LLVM_HARVEST_COMMAND set(LLVM_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
@@ -77,16 +65,3 @@ if(MSVC)
DEPENDEES mkdir update patch download configure build install DEPENDEES mkdir update patch download configure build install
) )
endif() endif()
# We currently do not build libxml2 on Windows.
if(APPLE)
add_dependencies(
ll
external_xml2
)
endif()
add_dependencies(
ll
external_python
)

View File

@@ -1,11 +1,27 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(LZMA_PATCH_CMD echo .) set(LZMA_PATCH_CMD echo .)
ExternalProject_Add(external_lzma ExternalProject_Add(external_lzma
URL file://${PACKAGE_DIR}/${LZMA_FILE} URL ${LZMA_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${LZMA_HASH_TYPE}=${LZMA_HASH} URL_HASH SHA256=${LZMA_HASH}
PREFIX ${BUILD_DIR}/lzma PREFIX ${BUILD_DIR}/lzma
PATCH_COMMAND ${LZMA_PATCH_CMD} PATCH_COMMAND ${LZMA_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lzma/src/external_lzma/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lzma CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/lzma/src/external_lzma/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/lzma

View File

@@ -1,18 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# shorthand to only unpack a certain dependency
macro(unpack_only name)
string(TOUPPER ${name} UPPER_NAME)
set(TARGET_FILE ${${UPPER_NAME}_FILE})
set(TARGET_HASH_TYPE ${${UPPER_NAME}_HASH_TYPE})
set(TARGET_HASH ${${UPPER_NAME}_HASH})
ExternalProject_Add(external_${name}
URL file://${PACKAGE_DIR}/${TARGET_FILE}
URL_HASH ${TARGET_HASH_TYPE}=${TARGET_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/${name}
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
endmacro()

View File

@@ -1,57 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(MATERIALX_EXTRA_ARGS
-DMATERIALX_BUILD_PYTHON=ON
-DMATERIALX_BUILD_RENDER=OFF
-DMATERIALX_INSTALL_PYTHON=OFF
-DMATERIALX_PYTHON_EXECUTABLE=${PYTHON_BINARY}
-DMATERIALX_PYTHON_VERSION=${PYTHON_SHORT_VERSION}
-DMATERIALX_BUILD_SHARED_LIBS=ON
-DCMAKE_DEBUG_POSTFIX=_d
-Dpybind11_ROOT=${LIBDIR}/pybind11
-DPython_EXECUTABLE=${PYTHON_BINARY}
)
ExternalProject_Add(external_materialx
URL file://${PACKAGE_DIR}/${MATERIALX_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${MATERIALX_HASH_TYPE}=${MATERIALX_HASH}
PREFIX ${BUILD_DIR}/materialx
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/materialx/src/external_materialx < ${PATCH_DIR}/materialx.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/materialx ${DEFAULT_CMAKE_FLAGS} ${MATERIALX_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/materialx
)
if(WIN32)
set(MATERIALX_PYTHON_TARGET ${HARVEST_TARGET}/materialx/python/${BUILD_MODE})
string(REPLACE "/" "\\" MATERIALX_PYTHON_TARGET_DOS "${MATERIALX_PYTHON_TARGET}")
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_materialx after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/materialx/include ${HARVEST_TARGET}/materialx/include
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/materialx/libraries ${HARVEST_TARGET}/materialx/libraries
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/materialx/lib/ ${HARVEST_TARGET}/materialx/lib/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/materialx/bin/ ${HARVEST_TARGET}/materialx/bin/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/materialx/python/ ${MATERIALX_PYTHON_TARGET}
COMMAND del ${MATERIALX_PYTHON_TARGET_DOS}\\MaterialX\\*.lib
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_materialx after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/materialx/lib/ ${HARVEST_TARGET}/materialx/lib/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/materialx/bin/ ${HARVEST_TARGET}/materialx/bin/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/materialx/python/ ${MATERIALX_PYTHON_TARGET}
COMMAND del ${MATERIALX_PYTHON_TARGET_DOS}\\MaterialX\\*.lib
DEPENDEES install
)
endif()
unset(MATERIALX_PYTHON_TARGET)
unset(MATERIALX_PYTHON_TARGET_DOS)
endif()
add_dependencies(
external_materialx
external_python
external_pybind11
)

View File

@@ -1,62 +1,54 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(MESA_CFLAGS "-static-libgcc") set(MESA_CFLAGS "-static-libgcc")
set(MESA_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a") set(MESA_CXXFLAGS "-static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a")
set(MESA_LDFLAGS "-L${LIBDIR}/zlib/lib -pthread -static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a -l:libz_pic.a") set(MESA_LDFLAGS "-L${LIBDIR}/zlib/lib -pthread -static-libgcc -static-libstdc++ -Bstatic -lstdc++ -Bdynamic -l:libstdc++.a -l:libz_pic.a")
# The 'native-file', used for overrides with the meson build system.
# meson does not provide a way to do this using command line arguments.
#
# Note that we can't output to "${BUILD_DIR}/mesa/src/external_mesa" as
# it doesn't exist when CMake first executes.
file(WRITE ${BUILD_DIR}/mesa/tmp/native-file.ini "\
[binaries]
llvm-config = '${LIBDIR}/llvm/bin/llvm-config'"
)
set(MESA_EXTRA_FLAGS set(MESA_EXTRA_FLAGS
-Dbuildtype=release CFLAGS=${MESA_CFLAGS}
-Dc_args=${MESA_CFLAGS} CXXFLAGS=${MESA_CXXFLAGS}
-Dcpp_args=${MESA_CXXFLAGS} LDFLAGS=${MESA_LDFLAGS}
-Dc_link_args=${MESA_LDFLAGS} --enable-glx=gallium-xlib
-Dcpp_link_args=${MESA_LDFLAGS} --with-gallium-drivers=swrast
-Dglx=gallium-xlib --disable-dri
-Dgallium-drivers=swrast --disable-gbm
-Ddri-drivers= --disable-egl
-Dvulkan-drivers= --disable-gles1
-Dgbm=disabled --disable-gles2
-Degl=disabled --disable-llvm-shared-libs
-Dgles1=disabled --with-llvm-prefix=${LIBDIR}/llvm
-Dgles2=disabled
-Dshared-llvm=disabled
# Without this, the build fails when: `wayland-scanner` is not found.
# At some point we will likely want to support Wayland.
# Disable for now since it's not officially supported.
-Dplatforms=x11
# Needed to find the local expat.
--pkg-config-path=${LIBDIR}/expat/lib/pkgconfig
--native-file ${BUILD_DIR}/mesa/tmp/native-file.ini
) )
ExternalProject_Add(external_mesa ExternalProject_Add(external_mesa
URL file://${PACKAGE_DIR}/${MESA_FILE} URL ${MESA_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${MESA_HASH_TYPE}=${MESA_HASH} URL_HASH MD5=${MESA_HASH}
PREFIX ${BUILD_DIR}/mesa PREFIX ${BUILD_DIR}/mesa
CONFIGURE_COMMAND ${CONFIGURE_ENV} && CONFIGURE_COMMAND ${CONFIGURE_ENV} &&
cd ${BUILD_DIR}/mesa/src/external_mesa/ && cd ${BUILD_DIR}/mesa/src/external_mesa/ &&
${MESON} ${BUILD_DIR}/mesa/src/external_mesa-build --prefix=${LIBDIR}/mesa ${MESA_EXTRA_FLAGS} ${CONFIGURE_COMMAND_NO_TARGET} --prefix=${LIBDIR}/mesa ${MESA_EXTRA_FLAGS}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa-build && ninja -j${MAKE_THREADS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa-build && ninja install INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/mesa/src/external_mesa/ && make install
INSTALL_DIR ${LIBDIR}/mesa INSTALL_DIR ${LIBDIR}/mesa
) )
add_dependencies( add_dependencies(
external_mesa external_mesa
ll ll
external_zlib
# Run-time dependency.
external_expat
# Needed for `MESON`.
external_python_site_packages
) )

View File

@@ -1,33 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(MINIZIPNG_EXTRA_ARGS
-DMZ_FETCH_LIBS=OFF
-DMZ_LIBCOMP=OFF
-DMZ_PKCRYPT=OFF
-DMZ_WZAES=OFF
-DMZ_OPENSSL=OFF
-DMZ_SIGNING=OFF
-DMZ_LZMA=OFF
-DMZ_ZSTD=OFF
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DBZIP2_LIBRARY=${LIBDIR}/bzip2/lib/${LIBPREFIX}bz2${LIBEXT}
-DBZIP2_INCLUDE_DIR=${LIBDIR}/bzip2/include/
# Because OCIO hardcodes a non standard include path
-DCMAKE_INSTALL_INCLUDEDIR=${LIBDIR}/minizipng/include/minizip-ng
)
ExternalProject_Add(external_minizipng
URL file://${PACKAGE_DIR}/${MINIZIPNG_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${MINIZIPNG_HASH_TYPE}=${MINIZIPNG_HASH}
PREFIX ${BUILD_DIR}/minizipng
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/minizipng ${DEFAULT_CMAKE_FLAGS} ${MINIZIPNG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/minizipng
)
add_dependencies(
external_minizipng
external_zlib
)

View File

@@ -1,22 +1,29 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_nasm ExternalProject_Add(external_nasm
URL file://${PACKAGE_DIR}/${NASM_FILE} URL ${NASM_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${NASM_HASH_TYPE}=${NASM_HASH} URL_HASH SHA256=${NASM_HASH}
PREFIX ${BUILD_DIR}/nasm PREFIX ${BUILD_DIR}/nasm
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/nasm/src/external_nasm < ${PATCH_DIR}/nasm.diff PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/nasm/src/external_nasm < ${PATCH_DIR}/nasm.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && ./autogen.sh && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/nasm CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/nasm
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make -j${MAKE_THREADS} && make manpages BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make install INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/nasm/src/external_nasm/ && make install
INSTALL_DIR ${LIBDIR}/nasm INSTALL_DIR ${LIBDIR}/nasm
) )
if(UNIX)
# `touch nasm.1 ndisasm.1` helps to create the manual pages files, even when
# local `asciidoc` and `xmlto` packages are not installed.
ExternalProject_Add_Step(external_nasm after_configure
COMMAND ${CMAKE_COMMAND} -E touch ${BUILD_DIR}/nasm/src/external_nasm/nasm.1 ${BUILD_DIR}/nasm/src/external_nasm/ndisasm.1
DEPENDEES configure
)
endif()

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(MSVC) if(MSVC)
message("BIN >${PYTHON_BINARY}<") message("BIN >${PYTHON_BINARY}<")
@@ -16,12 +32,13 @@ endif()
set(NUMPY_POSTFIX) set(NUMPY_POSTFIX)
ExternalProject_Add(external_numpy ExternalProject_Add(external_numpy
URL file://${PACKAGE_DIR}/${NUMPY_FILE} URL ${NUMPY_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${NUMPY_HASH_TYPE}=${NUMPY_HASH} URL_HASH MD5=${NUMPY_HASH}
PREFIX ${BUILD_DIR}/numpy PREFIX ${BUILD_DIR}/numpy
PATCH_COMMAND ${NUMPY_PATCH} PATCH_COMMAND ${NUMPY_PATCH}
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/numpy/src/external_numpy < ${PATCH_DIR}/numpy.diff
LOG_BUILD 1 LOG_BUILD 1
BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable BUILD_COMMAND ${PYTHON_BINARY} ${BUILD_DIR}/numpy/src/external_numpy/setup.py build ${NUMPY_BUILD_OPTION} install --old-and-unmanageable
INSTALL_COMMAND "" INSTALL_COMMAND ""
@@ -30,5 +47,4 @@ ExternalProject_Add(external_numpy
add_dependencies( add_dependencies(
external_numpy external_numpy
external_python external_python
external_python_site_packages
) )

View File

@@ -1,24 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(OCLOC_EXTRA_ARGS
-DNEO_SKIP_UNIT_TESTS=1
-DNEO_BUILD_WITH_OCL=0
-DBUILD_WITH_L0=0
-DIGC_DIR=${LIBDIR}/igc
-DGMM_DIR=${LIBDIR}/gmmlib
)
ExternalProject_Add(external_ocloc
URL file://${PACKAGE_DIR}/${OCLOC_FILE}
URL_HASH ${OCLOC_HASH_TYPE}=${OCLOC_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/ocloc
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ocloc ${DEFAULT_CMAKE_FLAGS} ${OCLOC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/ocloc
)
add_dependencies(
external_ocloc
external_igc
external_gmmlib
)

View File

@@ -1,9 +1,25 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_ogg ExternalProject_Add(external_ogg
URL file://${PACKAGE_DIR}/${OGG_FILE} URL ${OGG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OGG_HASH_TYPE}=${OGG_HASH} URL_HASH SHA256=${OGG_HASH}
PREFIX ${BUILD_DIR}/ogg PREFIX ${BUILD_DIR}/ogg
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/ogg/src/external_ogg < ${PATCH_DIR}/ogg.diff PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/ogg/src/external_ogg < ${PATCH_DIR}/ogg.diff
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ogg/src/external_ogg/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/ogg --disable-shared --enable-static

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
set(OPENAL_EXTRA_ARGS set(OPENAL_EXTRA_ARGS
@@ -30,9 +46,9 @@ if(BUILD_MODE STREQUAL Release)
endif() endif()
ExternalProject_Add(external_openal ExternalProject_Add(external_openal
URL file://${PACKAGE_DIR}/${OPENAL_FILE} URL ${OPENAL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENAL_HASH_TYPE}=${OPENAL_HASH} URL_HASH MD5=${OPENAL_HASH}
PREFIX ${BUILD_DIR}/openal PREFIX ${BUILD_DIR}/openal
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openal INSTALL_DIR ${LIBDIR}/openal

View File

@@ -1,56 +1,43 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(UNIX) if(UNIX)
set(OPENCOLLADA_EXTRA_ARGS set(OPENCOLLADA_EXTRA_ARGS
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2 -DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
-DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2.a) -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2.a)
# WARNING: the patch contains mixed UNIX and DOS line endings
# as does the OPENCOLLADA package, if this can be corrected upstream that would be better.
# For now use `sed` to force UNIX line endings so the patch applies.
# Needed as neither ignoring white-space or applying as a binary resolve this problem.
if(APPLE)
set(_dos2unix dos2unix)
else()
set(_dos2unix sed -i "s/\\r//")
endif()
set(PATCH_MAYBE_DOS2UNIX_CMD
${_dos2unix}
${PATCH_DIR}/opencollada.diff
${BUILD_DIR}/opencollada/src/external_opencollada/CMakeLists.txt
${BUILD_DIR}/opencollada/src/external_opencollada/Externals/LibXML/CMakeLists.txt &&
)
else()
set(OPENCOLLADA_EXTRA_ARGS
-DCMAKE_DEBUG_POSTFIX=_d
-DLIBXML2_INCLUDE_DIR=${LIBDIR}/xml2/include/libxml2
)
if(BUILD_MODE STREQUAL Release)
list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2s.lib)
else()
list(APPEND OPENCOLLADA_EXTRA_ARGS -DLIBXML2_LIBRARIES=${LIBDIR}/xml2/lib/libxml2sd.lib)
endif()
set(PATCH_MAYBE_DOS2UNIX_CMD)
endif() endif()
ExternalProject_Add(external_opencollada ExternalProject_Add(external_opencollada
URL file://${PACKAGE_DIR}/${OPENCOLLADA_FILE} URL ${OPENCOLLADA_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENCOLLADA_HASH_TYPE}=${OPENCOLLADA_HASH} URL_HASH MD5=${OPENCOLLADA_HASH}
PREFIX ${BUILD_DIR}/opencollada PREFIX ${BUILD_DIR}/opencollada
PATCH_COMMAND PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
${PATCH_MAYBE_DOS2UNIX_CMD}
${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencollada/src/external_opencollada < ${PATCH_DIR}/opencollada.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencollada ${DEFAULT_CMAKE_FLAGS} ${OPENCOLLADA_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencollada ${DEFAULT_CMAKE_FLAGS} ${OPENCOLLADA_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opencollada INSTALL_DIR ${LIBDIR}/opencollada
) )
unset(PATCH_MAYBE_DOS2UNIX_CMD) if(UNIX)
add_dependencies(
add_dependencies( external_opencollada
external_opencollada external_xml2
external_xml2 )
) endif()
if(WIN32) if(WIN32)
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
@@ -61,7 +48,17 @@ if(WIN32)
endif() endif()
if(BUILD_MODE STREQUAL Debug) if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_opencollada after_install ExternalProject_Add_Step(external_opencollada after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencollada/lib ${HARVEST_TARGET}/opencollada/lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/buffer.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/buffer_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/ftoa.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/ftoa_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/GeneratedSaxParser.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/GeneratedSaxParser_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/MathMLSolver.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/MathMLSolver_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADABaseUtils.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADABaseUtils_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAFramework.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAFramework_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADASaxFrameworkLoader_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/OpenCOLLADAStreamWriter_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/pcre.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/pcre_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/UTF.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/UTF_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencollada/lib/opencollada/xml.lib ${HARVEST_TARGET}/opencollada/lib/opencollada/xml_d.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -1,114 +1,119 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(OPENCOLORIO_EXTRA_ARGS set(OPENCOLORIO_EXTRA_ARGS
-DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_APPS=OFF
-DOCIO_BUILD_PYTHON=ON -DOCIO_BUILD_PYGLUE=OFF
-DOCIO_BUILD_NUKE=OFF -DOCIO_BUILD_NUKE=OFF
-DOCIO_BUILD_JAVA=OFF -DOCIO_USE_BOOST_PTR=OFF
-DBUILD_SHARED_LIBS=ON -DOCIO_BUILD_STATIC=ON
-DOCIO_BUILD_SHARED=OFF
-DOCIO_BUILD_TRUELIGHT=OFF
-DOCIO_BUILD_DOCS=OFF -DOCIO_BUILD_DOCS=OFF
-DOCIO_BUILD_TESTS=OFF -DOCIO_BUILD_PYGLUE=OFF
-DOCIO_BUILD_GPU_TESTS=OFF -DOCIO_BUILD_JNIGLUE=OFF
-DOCIO_USE_SSE=ON -DOCIO_STATIC_JNIGLUE=OFF
-DOCIO_INSTALL_EXT_PACKAGES=NONE
-Dexpat_ROOT=${LIBDIR}/expat
-Dyaml-cpp_ROOT=${LIBDIR}/yamlcpp
-Dyaml-cpp_VERSION=${YAMLCPP_VERSION}
-Dpystring_ROOT=${LIBDIR}/pystring
-DImath_ROOT=${LIBDIR}/imath
-Dminizip-ng_ROOT=${LIBDIR}/minizipng
-Dminizip-ng_INCLUDE_DIR=${LIBDIR}/minizipng/include
-Dminizip-ng_LIBRARY=${LIBDIR}/minizipng/lib/libminizip${LIBEXT}
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DPython_EXECUTABLE=${PYTHON_BINARY}
-Dpybind11_ROOT=${LIBDIR}/pybind11
) )
if(APPLE) if(APPLE AND NOT("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64"))
set(OPENCOLORIO_EXTRA_ARGS set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS} ${OPENCOLORIO_EXTRA_ARGS}
"-DCMAKE_SHARED_LINKER_FLAGS=-liconv ${LIBDIR}/bzip2/lib/${LIBPREFIX}bz2${LIBEXT}" -DOCIO_USE_SSE=OFF
)
elseif(UNIX)
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
"-DCMAKE_SHARED_LINKER_FLAGS=${LIBDIR}/bzip2/lib/${LIBPREFIX}bz2${LIBEXT}"
)
endif()
if(BLENDER_PLATFORM_ARM)
set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS}
-DOCIO_USE_SSE=OFF
) )
endif() endif()
if(WIN32) if(WIN32)
set(OPENCOLORIO_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIMATH_DLL") set(OCIO_PATCH opencolorio_win.diff)
if(BUILD_MODE STREQUAL Debug)
set(OPENCOLORIO_CXX_FLAGS "${OPENCOLORIO_CXX_FLAGS} -DPy_DEBUG")
endif()
set(OPENCOLORIO_EXTRA_ARGS set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS} ${OPENCOLORIO_EXTRA_ARGS}
-DCMAKE_DEBUG_POSTFIX=_d -DOCIO_BUILD_TESTS=OFF
-Dexpat_LIBRARY=${LIBDIR}/expat/lib/libexpat$<$<STREQUAL:${BUILD_MODE},Debug>:d>MD${LIBEXT} -DOCIO_USE_SSE=ON
-DImath_LIBRARY=${LIBDIR}/imath/lib/imath${OPENEXR_VERSION_POSTFIX}${LIBEXT} -DOCIO_INLINES_HIDDEN=OFF
-DCMAKE_CXX_FLAGS=${OPENCOLORIO_CXX_FLAGS} -DOCIO_PYGLUE_LINK=OFF
-DOCIO_PYGLUE_RESPECT_ABI=OFF
-DOCIO_PYGLUE_SONAME=OFF
-DOCIO_PYGLUE_LIB_PREFIX=OFF
-DUSE_EXTERNAL_TINYXML=ON
-DTINYXML_INCLUDE_DIR=${LIBDIR}/tinyxml/include
-DTINYXML_LIBRARY=${LIBDIR}/tinyxml/lib/tinyxml${libext}
-DUSE_EXTERNAL_YAML=ON
-DYAML_CPP_FOUND=ON
-DYAML_CPP_VERSION=${YAMLCPP_VERSION}
-DUSE_EXTERNAL_LCMS=ON
-DINC_1=${LIBDIR}/tinyxml/include
-DINC_2=${LIBDIR}/yamlcpp/include
# Lie because ocio cmake is demanding boost even though it is not needed.
-DYAML_CPP_VERSION=0.5.0
) )
else() else()
set(OCIO_PATCH opencolorio.diff)
set(OPENCOLORIO_EXTRA_ARGS set(OPENCOLORIO_EXTRA_ARGS
${OPENCOLORIO_EXTRA_ARGS} ${OPENCOLORIO_EXTRA_ARGS}
) )
endif() endif()
ExternalProject_Add(external_opencolorio ExternalProject_Add(external_opencolorio
URL file://${PACKAGE_DIR}/${OPENCOLORIO_FILE} URL ${OPENCOLORIO_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENCOLORIO_HASH_TYPE}=${OPENCOLORIO_HASH} URL_HASH MD5=${OPENCOLORIO_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/opencolorio PREFIX ${BUILD_DIR}/opencolorio
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencolorio/src/external_opencolorio < ${PATCH_DIR}/opencolorio.diff PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/opencolorio/src/external_opencolorio < ${PATCH_DIR}/${OCIO_PATCH}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencolorio ${DEFAULT_CMAKE_FLAGS} ${OPENCOLORIO_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opencolorio ${DEFAULT_CMAKE_FLAGS} ${OPENCOLORIO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opencolorio INSTALL_DIR ${LIBDIR}/opencolorio
) )
if(NOT WIN32)
add_custom_command(
OUTPUT ${LIBDIR}/opencolorio/lib/libtinyxml.a
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libtinyxml.a ${LIBDIR}/opencolorio/lib/libtinyxml.a
COMMAND cp ${BUILD_DIR}/opencolorio/src/external_opencolorio-build/ext/dist/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/libyaml-cpp.a
)
add_custom_target(external_opencolorio_extra ALL DEPENDS external_opencolorio ${LIBDIR}/opencolorio/lib/libtinyxml.a)
endif()
add_dependencies( add_dependencies(
external_opencolorio external_opencolorio
external_yamlcpp external_boost
external_expat
external_imath
external_pystring
external_zlib
external_minizipng
external_python
external_pybind11
) )
if(WIN32) if(WIN32)
add_dependencies(
external_opencolorio
external_tinyxml
external_yamlcpp
)
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_opencolorio after_install ExternalProject_Add_Step(external_opencolorio after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/include ${HARVEST_TARGET}/opencolorio/include COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/include ${HARVEST_TARGET}/opencolorio/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/bin/OpenColorIO_2_2.dll ${HARVEST_TARGET}/opencolorio/bin/OpenColorIO_2_2.dll COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib/static ${HARVEST_TARGET}/opencolorio/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib ${HARVEST_TARGET}/opencolorio/lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()
if(BUILD_MODE STREQUAL Debug) if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_opencolorio after_install ExternalProject_Add_Step(external_opencolorio after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/bin/OpenColorIO_d_2_2.dll ${HARVEST_TARGET}/opencolorio/bin/OpenColorIO_d_2_2.dll COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/lib/static/Opencolorio.lib ${HARVEST_TARGET}/opencolorio/lib/OpencolorIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/opencolorio/lib/Opencolorio_d.lib ${HARVEST_TARGET}/opencolorio/lib/OpenColorIO_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/yamlcpp/lib/libyaml-cppmdd.lib ${HARVEST_TARGET}/opencolorio/lib/libyaml-cpp_d.lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/opencolorio/lib/site-packages ${HARVEST_TARGET}/opencolorio/lib/site-packages-debug COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tinyxml/lib/tinyxml.lib ${HARVEST_TARGET}/opencolorio/lib/tinyxml_d.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()
else()
ExternalProject_Add_Step(external_opencolorio after_install
COMMAND cp ${LIBDIR}/yamlcpp/lib/libyaml-cpp.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${LIBDIR}/expat/lib/libexpat.a ${LIBDIR}/opencolorio/lib/
COMMAND cp ${LIBDIR}/pystring/lib/libpystring.a ${LIBDIR}/opencolorio/lib/
DEPENDEES install
)
endif() endif()

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32) if(WIN32)
set(OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}") set(OPENEXR_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
@@ -16,18 +32,19 @@ set(OPENEXR_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
-DOPENEXR_BUILD_BOTH_STATIC_SHARED=OFF -DOPENEXR_BUILD_BOTH_STATIC_SHARED=OFF
-DBUILD_SHARED_LIBS=ON -DILMBASE_BUILD_BOTH_STATIC_SHARED=OFF
-DOPENEXR_INSTALL_TOOLS=OFF -DBUILD_SHARED_LIBS=OFF
-DOPENEXR_INSTALL_EXAMPLES=OFF -DOPENEXR_BUILD_UTILS=OFF
-DImath_DIR=${LIBDIR}/imath/lib/cmake/Imath -DPYILMBASE_ENABLE=OFF
-DOPENEXR_VIEWERS_ENABLE=OFF
-DILMBASE_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
-DOPENEXR_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX} -DOPENEXR_LIB_SUFFIX=${OPENEXR_VERSION_BUILD_POSTFIX}
) )
ExternalProject_Add(external_openexr ExternalProject_Add(external_openexr
URL file://${PACKAGE_DIR}/${OPENEXR_FILE} URL ${OPENEXR_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENEXR_HASH_TYPE}=${OPENEXR_HASH} URL_HASH MD5=${OPENEXR_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/openexr PREFIX ${BUILD_DIR}/openexr
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openexr ${DEFAULT_CMAKE_FLAGS} ${OPENEXR_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openexr ${DEFAULT_CMAKE_FLAGS} ${OPENEXR_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openexr INSTALL_DIR ${LIBDIR}/openexr
@@ -37,11 +54,6 @@ if(WIN32)
ExternalProject_Add_Step(external_openexr after_install ExternalProject_Add_Step(external_openexr after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/lib ${HARVEST_TARGET}/openexr/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openexr/include ${HARVEST_TARGET}/openexr/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/bin/Iex${OPENEXR_VERSION_POSTFIX}.dll ${HARVEST_TARGET}/openexr/bin/Iex${OPENEXR_VERSION_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/bin/IlmThread${OPENEXR_VERSION_POSTFIX}.dll ${HARVEST_TARGET}/openexr/bin/IlmThread${OPENEXR_VERSION_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/bin/OpenEXRCore${OPENEXR_VERSION_POSTFIX}.dll ${HARVEST_TARGET}/openexr/bin/OpenEXRCore${OPENEXR_VERSION_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/bin/OpenEXRUtil${OPENEXR_VERSION_POSTFIX}.dll ${HARVEST_TARGET}/openexr/bin/OpenEXRUtil${OPENEXR_VERSION_POSTFIX}.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openexr/bin/OpenEXR${OPENEXR_VERSION_POSTFIX}.dll ${HARVEST_TARGET}/openexr/bin/OpenEXR${OPENEXR_VERSION_POSTFIX}.dll
DEPENDEES install DEPENDEES install
) )
endif() endif()
@@ -49,5 +61,4 @@ endif()
add_dependencies( add_dependencies(
external_openexr external_openexr
external_zlib external_zlib
external_imath
) )

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(OIDN_EXTRA_ARGS set(OIDN_EXTRA_ARGS
@@ -8,8 +24,6 @@ set(OIDN_EXTRA_ARGS
-DOIDN_STATIC_LIB=ON -DOIDN_STATIC_LIB=ON
-DOIDN_STATIC_RUNTIME=OFF -DOIDN_STATIC_RUNTIME=OFF
-DISPC_EXECUTABLE=${LIBDIR}/ispc/bin/ispc -DISPC_EXECUTABLE=${LIBDIR}/ispc/bin/ispc
-DOIDN_FILTER_RTLIGHTMAP=OFF
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
) )
if(WIN32) if(WIN32)
@@ -27,9 +41,9 @@ else()
endif() endif()
ExternalProject_Add(external_openimagedenoise ExternalProject_Add(external_openimagedenoise
URL file://${PACKAGE_DIR}/${OIDN_FILE} URL ${OIDN_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OIDN_HASH_TYPE}=${OIDN_HASH} URL_HASH MD5=${OIDN_HASH}
PREFIX ${BUILD_DIR}/openimagedenoise PREFIX ${BUILD_DIR}/openimagedenoise
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimagedenoise ${DEFAULT_CMAKE_FLAGS} ${OIDN_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimagedenoise ${DEFAULT_CMAKE_FLAGS} ${OIDN_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openimagedenoise INSTALL_DIR ${LIBDIR}/openimagedenoise
@@ -39,7 +53,6 @@ add_dependencies(
external_openimagedenoise external_openimagedenoise
external_tbb external_tbb
external_ispc external_ispc
external_python
) )
if(WIN32) if(WIN32)

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
set(OIIO_TOOLS ON) set(OIIO_TOOLS ON)
@@ -15,36 +31,44 @@ else()
endif() endif()
if(WIN32) if(WIN32)
set(PNG_LIBNAME libpng16_static${LIBEXT})
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2) set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2)
set(OPENJPEG_POSTFIX _msvc) set(OPENJPEG_POSTFIX _msvc)
if(BUILD_MODE STREQUAL Debug)
set(TIFF_POSTFIX d)
set(PNG_POSTFIX d)
else()
set(TIFF_POSTFIX)
set(PNG_POSTFIX)
endif()
set(PNG_LIBNAME libpng16_static${PNG_POSTFIX}${LIBEXT})
else() else()
set(PNG_LIBNAME libpng${LIBEXT}) set(PNG_LIBNAME libpng${LIBEXT})
set(OIIO_SIMD_FLAGS) set(OIIO_SIMD_FLAGS)
set(TIFF_POSTFIX) endif()
if(WITH_WEBP)
set(WEBP_ARGS
-DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
-DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT}
)
set(WEBP_DEP external_webp)
endif() endif()
if(MSVC) if(MSVC)
set(OPENJPEG_FLAGS set(OPENJPEG_FLAGS
-DOpenJPEG_ROOT=${LIBDIR}/openjpeg_msvc -DOpenJpeg_ROOT=${LIBDIR}/openjpeg_msvc
) )
else() else()
set(OPENJPEG_FLAGS set(OPENJPEG_FLAGS
-DOpenJPEG_ROOT=${LIBDIR}/openjpeg -DOpenJpeg_ROOT=${LIBDIR}/openjpeg
) )
endif() endif()
set(OPENIMAGEIO_EXTRA_ARGS set(OPENIMAGEIO_EXTRA_ARGS
-DBUILD_SHARED_LIBS=ON -DBUILD_SHARED_LIBS=OFF
${OPENIMAGEIO_LINKSTATIC} ${OPENIMAGEIO_LINKSTATIC}
${DEFAULT_BOOST_FLAGS} -DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-OIIO_BUILD_CPP11=ON
-DUSE_LIBSQUISH=OFF -DUSE_LIBSQUISH=OFF
-DUSE_QT5=OFF -DUSE_QT5=OFF
-DUSE_NUKE=OFF -DUSE_NUKE=OFF
@@ -55,8 +79,9 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DUSE_LIBHEIF=OFF -DUSE_LIBHEIF=OFF
-DUSE_OPENGL=OFF -DUSE_OPENGL=OFF
-DUSE_TBB=OFF -DUSE_TBB=OFF
-DUSE_FIELD3D=OFF
-DUSE_QT=OFF -DUSE_QT=OFF
-DUSE_PYTHON=ON -DUSE_PYTHON=OFF
-DUSE_GIF=OFF -DUSE_GIF=OFF
-DUSE_OPENCV=OFF -DUSE_OPENCV=OFF
-DUSE_OPENJPEG=ON -DUSE_OPENJPEG=ON
@@ -65,7 +90,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DUSE_FREETYPE=OFF -DUSE_FREETYPE=OFF
-DUSE_LIBRAW=OFF -DUSE_LIBRAW=OFF
-DUSE_OPENCOLORIO=OFF -DUSE_OPENCOLORIO=OFF
-DUSE_WEBP=ON -DUSE_WEBP=${WITH_WEBP}
-DOIIO_BUILD_TOOLS=${OIIO_TOOLS} -DOIIO_BUILD_TOOLS=${OIIO_TOOLS}
-DOIIO_BUILD_TESTS=OFF -DOIIO_BUILD_TESTS=OFF
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
@@ -73,36 +98,28 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include
-DPNG_LIBRARY=${LIBDIR}/png/lib/${PNG_LIBNAME} -DPNG_LIBRARY=${LIBDIR}/png/lib/${PNG_LIBNAME}
-DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include -DPNG_PNG_INCLUDE_DIR=${LIBDIR}/png/include
-DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${TIFF_POSTFIX}${LIBEXT} -DTIFF_LIBRARY=${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT}
-DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include -DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
-DJPEG_LIBRARY=${LIBDIR}/jpeg/lib/${JPEG_LIBRARY} -DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpeg/include -DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
${OPENJPEG_FLAGS} ${OPENJPEG_FLAGS}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${SHAREDLIBEXT} -DOpenEXR_USE_STATIC_LIBS=On
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${SHAREDLIBEXT} -DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${SHAREDLIBEXT} -DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DSTOP_ON_WARNING=OFF -DSTOP_ON_WARNING=OFF
-DUSE_EXTERNAL_PUGIXML=ON ${WEBP_FLAGS}
-DPUGIXML_LIBRARY=${LIBDIR}/pugixml/lib/${LIBPREFIX}pugixml${LIBEXT}
-DPUGIXML_INCLUDE_DIR=${LIBDIR}/pugixml/include/
-Dpugixml_DIR=${LIBDIR}/pugixml/lib/cmake/pugixml
-DBUILD_MISSING_ROBINMAP=OFF
-DBUILD_MISSING_FMT=OFF
-DFMT_INCLUDE_DIR=${LIBDIR}/fmt/include/
-DRobinmap_ROOT=${LIBDIR}/robinmap
-DWebP_ROOT=${LIBDIR}/webp
${OIIO_SIMD_FLAGS} ${OIIO_SIMD_FLAGS}
-DOpenEXR_ROOT=${LIBDIR}/openexr
-DImath_ROOT=${LIBDIR}/imath
-Dpybind11_ROOT=${LIBDIR}/pybind11
-DPython_EXECUTABLE=${PYTHON_BINARY}
) )
ExternalProject_Add(external_openimageio ExternalProject_Add(external_openimageio
URL file://${PACKAGE_DIR}/${OPENIMAGEIO_FILE} URL ${OPENIMAGEIO_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENIMAGEIO_HASH_TYPE}=${OPENIMAGEIO_HASH} URL_HASH MD5=${OPENIMAGEIO_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/openimageio PREFIX ${BUILD_DIR}/openimageio
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio.diff PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
@@ -114,17 +131,11 @@ add_dependencies(
external_png external_png
external_zlib external_zlib
external_openexr external_openexr
external_imath
external_jpeg external_jpeg
external_boost external_boost
external_tiff external_tiff
external_pugixml
external_fmt
external_robinmap
external_openjpeg${OPENJPEG_POSTFIX} external_openjpeg${OPENJPEG_POSTFIX}
external_webp ${WEBP_DEP}
external_python
external_pybind11
) )
if(WIN32) if(WIN32)
@@ -133,18 +144,14 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/OpenImageIO.dll ${HARVEST_TARGET}/OpenImageIO/bin/OpenImageIO.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/OpenImageIO_Util.dll ${HARVEST_TARGET}/OpenImageIO/bin/OpenImageIO_Util.dll
DEPENDEES install DEPENDEES install
) )
endif() endif()
if(BUILD_MODE STREQUAL Debug) if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_openimageio after_install ExternalProject_Add_Step(external_openimageio after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_d.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util_d.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/OpenImageIO_d.dll ${HARVEST_TARGET}/OpenImageIO/bin/OpenImageIO_d.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/OpenImageIO_Util_d.dll ${HARVEST_TARGET}/OpenImageIO/bin/OpenImageIO_Util_d.dll
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib/python${PYTHON_SHORT_VERSION}/ ${HARVEST_TARGET}/OpenImageIO/lib/python${PYTHON_SHORT_VERSION}_debug/
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -1,26 +1,38 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
# Note the encoder/decoder may use png/tiff/lcms system libraries, but the # Note the encoder/decoder may use png/tiff/lcms system libraries, but the
# library itself does not depend on them, so should give no problems. # library itself does not depend on them, so should give no problems.
set(OPENJPEG_EXTRA_ARGS -DBUILD_SHARED_LIBS=OFF)
if(WIN32) if(WIN32)
set(OPENJPEG_EXTRA_ARGS -G "MSYS Makefiles" -DBUILD_PKGCONFIG_FILES=On) set(OPENJPEG_EXTRA_ARGS -G "MSYS Makefiles" -DBUILD_PKGCONFIG_FILES=On)
else() else()
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS}) set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
endif() endif()
set(OPENJPEG_EXTRA_ARGS
${OPENJPEG_EXTRA_ARGS}
-DBUILD_SHARED_LIBS=OFF
-DBUILD_CODEC=OFF
)
ExternalProject_Add(external_openjpeg ExternalProject_Add(external_openjpeg
URL file://${PACKAGE_DIR}/${OPENJPEG_FILE} URL ${OPENJPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENJPEG_HASH_TYPE}=${OPENJPEG_HASH} URL_HASH SHA256=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg PREFIX ${BUILD_DIR}/openjpeg
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg ${BUILD_DIR}/openjpeg/src/external_openjpeg CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build && ${CMAKE_COMMAND} ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF ${BUILD_DIR}/openjpeg/src/external_openjpeg
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make -j${MAKE_THREADS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make install INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/openjpeg/src/external_openjpeg-build/ && make install
INSTALL_DIR ${LIBDIR}/openjpeg INSTALL_DIR ${LIBDIR}/openjpeg
@@ -30,19 +42,17 @@ ExternalProject_Add(external_openjpeg
if(MSVC) if(MSVC)
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS}) set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
ExternalProject_Add(external_openjpeg_msvc ExternalProject_Add(external_openjpeg_msvc
URL file://${PACKAGE_DIR}/${OPENJPEG_FILE} URL ${OPENJPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENJPEG_HASH_TYPE}=${OPENJPEG_HASH} URL_HASH SHA256=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg_msvc PREFIX ${BUILD_DIR}/openjpeg_msvc
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
INSTALL_DIR ${LIBDIR}/openjpeg_msvc INSTALL_DIR ${LIBDIR}/openjpeg_msvc
) )
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_openjpeg_msvc after_install ExternalProject_Add_Step(external_openjpeg_msvc after_install
COMMAND COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/lib ${HARVEST_TARGET}/openjpeg/lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/lib ${HARVEST_TARGET}/openjpeg/lib && ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/include ${HARVEST_TARGET}/openjpeg/include
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openjpeg_msvc/include ${HARVEST_TARGET}/openjpeg/include
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -1,23 +1,34 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(APPLE)
set(OPENMP_PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openmp/src/external_openmp < ${PATCH_DIR}/openmp.diff)
else()
set(OPENMP_PATCH_COMMAND)
endif()
ExternalProject_Add(external_openmp ExternalProject_Add(external_openmp
URL file://${PACKAGE_DIR}/${OPENMP_FILE} URL ${OPENMP_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENMP_HASH_TYPE}=${OPENMP_HASH} URL_HASH MD5=${OPENMP_HASH}
PREFIX ${BUILD_DIR}/openmp PREFIX ${BUILD_DIR}/openmp
PATCH_COMMAND ${OPENMP_PATCH_COMMAND} PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openmp/src/external_openmp < ${PATCH_DIR}/openmp.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS}
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @rpath/libomp.dylib runtime/src/libomp.dylib && make install INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @executable_path/../Resources/lib/libomp.dylib runtime/src/libomp.dylib && make install
INSTALL_DIR ${LIBDIR}/openmp INSTALL_DIR ${LIBDIR}/openmp
) )
add_dependencies( add_dependencies(
external_openmp external_openmp
ll external_clang
) )

View File

@@ -1,47 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Note the utility apps may use png/tiff/gif system libraries, but the
# library itself does not depend on them, so should give no problems.
set(OPENPGL_EXTRA_ARGS
-DOPENPGL_BUILD_STATIC=ON
-DOPENPGL_TBB_ROOT=${LIBDIR}/tbb
-DTBB_ROOT=${LIBDIR}/tbb
-DCMAKE_DEBUG_POSTFIX=_d
)
if(TBB_STATIC_LIBRARY)
set(OPENPGL_EXTRA_ARGS
${OPENPGL_EXTRA_ARGS}
-DOPENPGL_TBB_COMPONENT=tbb_static
)
endif()
ExternalProject_Add(external_openpgl
URL file://${PACKAGE_DIR}/${OPENPGL_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENPGL_HASH_TYPE}=${OPENPGL_HASH}
PREFIX ${BUILD_DIR}/openpgl
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openpgl ${DEFAULT_CMAKE_FLAGS} ${OPENPGL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openpgl
)
add_dependencies(
external_openpgl
external_tbb
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_openpgl after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openpgl ${HARVEST_TARGET}/openpgl
DEPENDEES install
)
else()
ExternalProject_Add_Step(external_openpgl after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openpgl/lib/openpgl_d.lib ${HARVEST_TARGET}/openpgl/lib/openpgl_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION}/openpgl_Exports-debug.cmake ${HARVEST_TARGET}/openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION}/openpgl_Exports-debug.cmake
DEPENDEES install
)
endif()
endif()

View File

@@ -1,25 +1,35 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(OPENSUBDIV_EXTRA_ARGS set(OPENSUBDIV_EXTRA_ARGS
-DNO_LIB=OFF
-DNO_EXAMPLES=ON -DNO_EXAMPLES=ON
-DNO_TUTORIALS=ON
-DNO_REGRESSION=ON -DNO_REGRESSION=ON
-DNO_PYTHON=ON
-DNO_MAYA=ON
-DNO_PTEX=ON -DNO_PTEX=ON
-DNO_DOC=ON -DNO_DOC=ON
-DNO_OMP=ON -DNO_CLEW=OFF
-DNO_TBB=OFF -DNO_OPENCL=OFF
-DNO_CUDA=ON -DNO_TUTORIALS=ON
-DNO_OPENCL=ON -DGLEW_INCLUDE_DIR=${LIBDIR}/glew/include
-DNO_CLEW=ON -DGLEW_LIBRARY=${LIBDIR}/glew/lib/libGLEW${LIBEXT}
-DNO_OPENGL=OFF -DGLFW_INCLUDE_DIR=${LIBDIR}/glfw/include
-DNO_METAL=OFF -DGLFW_LIBRARIES=${LIBDIR}/glfw/lib/glfw3${LIBEXT}
-DNO_DX=ON
-DNO_TESTS=ON
-DNO_GLTESTS=ON
-DNO_GLEW=ON
-DNO_GLFW=ON
-DNO_GLFW_X11=ON
) )
if(WIN32) if(WIN32)
@@ -27,19 +37,37 @@ if(WIN32)
${OPENSUBDIV_EXTRA_ARGS} ${OPENSUBDIV_EXTRA_ARGS}
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include -DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb.lib -DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb.lib
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCUEW_LIBRARY=${LIBDIR}/cuew/lib/cuew${LIBEXT}
) )
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=OFF
)
else()
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DNO_CUDA=ON
)
endif()
else() else()
set(OPENSUBDIV_EXTRA_ARGS set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS} ${OPENSUBDIV_EXTRA_ARGS}
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include -DNO_CUDA=ON
-DTBB_tbb_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb${SHAREDLIBEXT} -DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/static/${LIBPREFIX}clew${LIBEXT}
) )
endif() endif()
ExternalProject_Add(external_opensubdiv ExternalProject_Add(external_opensubdiv
URL file://${PACKAGE_DIR}/${OPENSUBDIV_FILE} URL ${OPENSUBDIV_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENSUBDIV_HASH_TYPE}=${OPENSUBDIV_HASH} URL_HASH MD5=${OPENSUBDIV_HASH}
PREFIX ${BUILD_DIR}/opensubdiv PREFIX ${BUILD_DIR}/opensubdiv
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opensubdiv -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENSUBDIV_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opensubdiv -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENSUBDIV_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opensubdiv INSTALL_DIR ${LIBDIR}/opensubdiv
@@ -64,5 +92,9 @@ endif()
add_dependencies( add_dependencies(
external_opensubdiv external_opensubdiv
external_glew
external_glfw
external_clew
external_cuew
external_tbb external_tbb
) )

View File

@@ -1,54 +1,83 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(BUILD_MODE STREQUAL Debug) if(BUILD_MODE STREQUAL Debug)
set(BLOSC_POST _d) set(BLOSC_POST _d)
endif() endif()
if(WIN32)
set(OPENVDB_SHARED ON)
set(OPENVDB_STATIC OFF)
else()
set(OPENVDB_SHARED OFF)
set(OPENVDB_STATIC ON)
endif()
set(OPENVDB_EXTRA_ARGS set(OPENVDB_EXTRA_ARGS
${DEFAULT_BOOST_FLAGS} -DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DUSE_STATIC_DEPENDENCIES=OFF # This is the global toggle for static libs -DBoost_USE_MULTITHREADED=ON
# Once the above switch is off, you can set it -DBoost_USE_STATIC_LIBS=ON
# for each individual library below. -DBoost_USE_STATIC_RUNTIME=OFF
-DBLOSC_USE_STATIC_LIBS=ON -DBOOST_ROOT=${LIBDIR}/boost
-DTBB_USE_STATIC_LIBS=OFF -DBoost_NO_SYSTEM_PATHS=ON
-DBoost_USE_STATIC_LIBS=OFF -DBoost_NO_BOOST_CMAKE=ON
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY} -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DBlosc_INCLUDE_DIR=${LIBDIR}/blosc/include/ -DBlosc_INCLUDE_DIR=${LIBDIR}/blosc/include/
-DBlosc_LIBRARY=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT} -DBlosc_LIBRARY=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT}
-DBlosc_LIBRARY_RELEASE=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT} -DOPENVDB_ENABLE_3_ABI_COMPATIBLE=OFF
-DBlosc_LIBRARY_DEBUG=${LIBDIR}/blosc/lib/libblosc${BLOSC_POST}${LIBEXT} -DOPENVDB_BUILD_UNITTESTS=Off
-DOPENVDB_BUILD_UNITTESTS=OFF -DOPENVDB_BUILD_PYTHON_MODULE=Off
-DOPENVDB_BUILD_NANOVDB=ON
-DNANOVDB_BUILD_TOOLS=OFF
-DBlosc_ROOT=${LIBDIR}/blosc/ -DBlosc_ROOT=${LIBDIR}/blosc/
-DTBB_ROOT=${LIBDIR}/tbb/ -DTBB_ROOT=${LIBDIR}/tbb/
-DTbb_INCLUDE_DIR=${LIBDIR}/tbb/include -DOpenEXR_ROOT=${LIBDIR}/openexr
-DTbb_LEGACY_INCLUDE_DIR=${LIBDIR}/tbb/include -DIlmBase_ROOT=${LIBDIR}/openexr
-DOPENVDB_CORE_SHARED=ON -DOPENEXR_LIBRARYDIR=${LIBDIR}/openexr/lib
-DOPENVDB_CORE_STATIC=OFF # All libs live in openexr, even the ilmbase ones
-DOPENVDB_BUILD_BINARIES=OFF -DILMBASE_LIBRARYDIR=${LIBDIR}/openexr/lib
-DOPENVDB_CORE_SHARED=${OPENVDB_SHARED}
-DOPENVDB_CORE_STATIC=${OPENVDB_STATIC}
-DOPENVDB_BUILD_BINARIES=Off
-DCMAKE_DEBUG_POSTFIX=_d -DCMAKE_DEBUG_POSTFIX=_d
-DBLOSC_USE_STATIC_LIBS=ON
-DUSE_NANOVDB=ON
-DOPENVDB_BUILD_PYTHON_MODULE=ON
-DOPENVDB_PYTHON_WRAP_ALL_GRID_TYPES=ON
-DUSE_NUMPY=ON
-DPython_EXECUTABLE=${PYTHON_BINARY}
# OPENVDB_AX Disabled for now as it adds ~25MB distribution wise
# with no blender code depending on it, seems wasteful.
# -DOPENVDB_BUILD_AX=ON
# -DOPENVDB_AX_SHARED=ON
# -DOPENVDB_AX_STATIC=OFF
# -DLLVM_DIR=${LIBDIR}/llvm/lib/cmake/llvm
) )
if(WIN32)
# Namespaces seem to be buggy and cause linker errors due to things not
# being in the correct namespace
# needs to link pthreads due to it being a blosc dependency
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS}
-DCMAKE_CXX_STANDARD_LIBRARIES="${LIBDIR}/pthreads/lib/pthreadVC3.lib"
-DUSE_EXR=On
)
else()
# OpenVDB can't find the _static libraries automatically.
set(OPENVDB_EXTRA_ARGS ${OPENVDB_EXTRA_ARGS}
-DTbb_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DTbb_tbb_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DTbb_tbbmalloc_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbbmalloc_static${LIBEXT}
-DTbb_tbbmalloc_proxy_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbbmalloc_proxy_static${LIBEXT}
)
endif()
ExternalProject_Add(openvdb ExternalProject_Add(openvdb
URL file://${PACKAGE_DIR}/${OPENVDB_FILE} URL ${OPENVDB_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPENVDB_HASH_TYPE}=${OPENVDB_HASH} URL_HASH MD5=${OPENVDB_HASH}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
PREFIX ${BUILD_DIR}/openvdb PREFIX ${BUILD_DIR}/openvdb
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS}
@@ -59,10 +88,9 @@ add_dependencies(
openvdb openvdb
external_tbb external_tbb
external_boost external_boost
external_openexr
external_zlib external_zlib
external_blosc external_blosc
external_python
external_numpy
) )
if(WIN32) if(WIN32)
@@ -71,7 +99,6 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include ${HARVEST_TARGET}/openvdb/include COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openvdb/include ${HARVEST_TARGET}/openvdb/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb.lib ${HARVEST_TARGET}/openvdb/lib/openvdb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb.dll ${HARVEST_TARGET}/openvdb/bin/openvdb.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/python${PYTHON_SHORT_VERSION}/site-packages/pyopenvdb.pyd ${HARVEST_TARGET}openvdb/python/pyopenvdb.pyd
DEPENDEES install DEPENDEES install
) )
endif() endif()
@@ -79,7 +106,6 @@ if(WIN32)
ExternalProject_Add_Step(openvdb after_install ExternalProject_Add_Step(openvdb after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb_d.lib ${HARVEST_TARGET}/openvdb/lib/openvdb_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/openvdb_d.lib ${HARVEST_TARGET}/openvdb/lib/openvdb_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb_d.dll ${HARVEST_TARGET}/openvdb/bin/openvdb_d.dll COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/bin/openvdb_d.dll ${HARVEST_TARGET}/openvdb/bin/openvdb_d.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openvdb/lib/python${PYTHON_SHORT_VERSION}/site-packages/pyopenvdb_d.pyd ${HARVEST_TARGET}openvdb/python/pyopenvdb_d.pyd
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -1,12 +1,27 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32) if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/fftw3 by installing mingw64" ON) option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/fftw3 by installing mingw64" ON)
endif() endif()
option(FORCE_CHECK_HASH "Force a check of all hashses during CMake the configure phase" OFF) option(WITH_WEBP "Enable building of oiio with webp support" OFF)
option(WITH_BOOST_PYTHON "Enable building of boost with python support" OFF)
cmake_host_system_information(RESULT NUM_CORES QUERY NUMBER_OF_LOGICAL_CORES) set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
set(MAKE_THREADS ${NUM_CORES} CACHE STRING "Number of threads to run make with")
if(NOT BUILD_MODE) if(NOT BUILD_MODE)
set(BUILD_MODE "Release") set(BUILD_MODE "Release")
@@ -16,61 +31,49 @@ message("BuildMode = ${BUILD_MODE}")
if(BUILD_MODE STREQUAL "Debug") if(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug) set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug)
else() else(BUILD_MODE STREQUAL "Debug")
set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release) set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release)
endif() endif()
set(DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/downloads" CACHE STRING "Path for downloaded files") option(DOWNLOAD_DIR "Path for downloaded files" ${CMAKE_CURRENT_SOURCE_DIR}/downloads)
set(PACKAGE_DIR "${CMAKE_CURRENT_BINARY_DIR}/packages" CACHE PATH "default path for downloaded packages")
option(PACKAGE_USE_UPSTREAM_SOURCES "Use sources upstream to download the package sources, when OFF the blender mirror will be used" ON)
file(TO_CMAKE_PATH ${DOWNLOAD_DIR} DOWNLOAD_DIR) file(TO_CMAKE_PATH ${DOWNLOAD_DIR} DOWNLOAD_DIR)
file(TO_CMAKE_PATH ${PACKAGE_DIR} PACKAGE_DIR)
set(PATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patches) set(PATCH_DIR ${CMAKE_CURRENT_SOURCE_DIR}/patches)
set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/build) set(BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/build)
message("LIBDIR = ${LIBDIR}") message("LIBDIR = ${LIBDIR}")
message("DOWNLOAD_DIR = ${DOWNLOAD_DIR}") message("DOWNLOAD_DIR = ${DOWNLOAD_DIR}")
message("PACKAGE_DIR = ${PACKAGE_DIR}")
message("PATCH_DIR = ${PATCH_DIR}") message("PATCH_DIR = ${PATCH_DIR}")
message("BUILD_DIR = ${BUILD_DIR}") message("BUILD_DIR = ${BUILD_DIR}")
if(WIN32) if(WIN32)
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe) set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe)
set(LIBEXT ".lib") set(LIBEXT ".lib")
set(SHAREDLIBEXT ".lib")
set(LIBPREFIX "") set(LIBPREFIX "")
set(MESON ${LIBDIR}/python/Scripts/meson)
# For OIIO and OSL # For OIIO and OSL
set(COMMON_DEFINES /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS) set(COMMON_DEFINES /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS)
if(MSVC_VERSION GREATER 1909) if(MSVC_VERSION GREATER 1909)
set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings. set(COMMON_MSVC_FLAGS "/Wv:18") #some deps with warnings as error aren't quite ready for dealing with the new 2017 warnings.
endif() endif()
string(APPEND COMMON_MSVC_FLAGS " /bigobj") set(COMMON_MSVC_FLAGS "${COMMON_MSVC_FLAGS} /bigobj")
# To keep MSVC from oversubscribing the CPU, force it to single threaded mode if(WITH_OPTIMIZED_DEBUG)
# msbuild/ninja will queue as many compile units as there are cores, no need for set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
# msvc to be internally threading as well. else()
string(APPEND COMMON_MSVC_FLAGS " /cgthreads1 ") set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MD ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG) if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D_DEBUG /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS") set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
else() else()
set(BLENDER_CMAKE_C_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /D_DEBUG /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS") set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
endif() endif()
set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "/MD ${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS") set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MD /${COMMON_MSVC_FLAGS} /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /DNDEBUG /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS") set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS") set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=1 /DOIIO_STATIC_BUILD /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
if(WITH_OPTIMIZED_DEBUG)
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/MDd ${COMMON_MSVC_FLAGS} /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS /O2 /Ob2 /D_DEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS /DBOOST_DEBUG_PYTHON /DBOOST_ALL_NO_LIB")
else()
set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /D PLATFORM_WINDOWS /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS /MTd ${COMMON_MSVC_FLAGS} /Zi /Ob0 /Od /RTC1 /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS /DBOOST_DEBUG_PYTHON /DBOOST_ALL_NO_LIB")
endif()
set(BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL "/MD /${COMMON_MSVC_FLAGS} /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS /O1 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELEASE "/MD ${COMMON_MSVC_FLAGS} /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS /O2 /Ob2 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD ${COMMON_MSVC_FLAGS} /D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS /Zi /O2 /Ob1 /D NDEBUG /D PLATFORM_WINDOWS /DPSAPI_VERSION=2 /DTINYFORMAT_ALLOW_WCHAR_STRINGS")
set(PLATFORM_FLAGS) set(PLATFORM_FLAGS)
set(PLATFORM_CXX_FLAGS) set(PLATFORM_CXX_FLAGS)
@@ -81,18 +84,6 @@ if(WIN32)
set(PERL_SHELL ${DOWNLOAD_DIR}/perl/portableshell.bat) set(PERL_SHELL ${DOWNLOAD_DIR}/perl/portableshell.bat)
set(MINGW_HOST x86_64-w64-mingw32) set(MINGW_HOST x86_64-w64-mingw32)
# some build systems like meson will respect the *nix like environment vars
# like CFLAGS and LDFlags but will still build with the MSVC compiler, so for
# those we need to empty out the gcc style flags that are normally in there.
set(CONFIGURE_ENV_MSVC
cd ${MINGW_PATH} &&
call ${PERL_SHELL} &&
call ${MINGW_SHELL} &&
set path &&
set CFLAGS= &&
set LDFLAGS=
)
set(CONFIGURE_ENV set(CONFIGURE_ENV
cd ${MINGW_PATH} && cd ${MINGW_PATH} &&
call ${PERL_SHELL} && call ${PERL_SHELL} &&
@@ -116,20 +107,32 @@ else()
set(PATCH_CMD patch) set(PATCH_CMD patch)
set(LIBEXT ".a") set(LIBEXT ".a")
set(LIBPREFIX "lib") set(LIBPREFIX "lib")
set(MESON ${LIBDIR}/python/bin/meson)
if(APPLE) if(APPLE)
set(SHAREDLIBEXT ".dylib") # Let's get the current Xcode dir, to support xcode-select
execute_process(
COMMAND xcode-select --print-path
OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND xcodebuild -version -sdk macosx SDKVersion
OUTPUT_VARIABLE MACOSX_SDK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
# Use same Xcode detection as Blender itself. if(NOT CMAKE_OSX_ARCHITECTURES)
include(../cmake/platform/platform_apple_xcode.cmake) execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Detected native architecture ${ARCHITECTURE}.")
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64") set(CMAKE_OSX_ARCHITECTURES "${ARCHITECTURE}")
set(BLENDER_PLATFORM_ARM ON)
endif() endif()
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
set(OSX_DEPLOYMENT_TARGET 10.13)
else()
set(OSX_DEPLOYMENT_TARGET 11.00)
endif()
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)
set(PLATFORM_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}") set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_CXXFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -std=c++17 -stdlib=libc++ -arch ${CMAKE_OSX_ARCHITECTURES}") set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++ -arch ${CMAKE_OSX_ARCHITECTURES}")
set(PLATFORM_LDFLAGS "-isysroot ${CMAKE_OSX_SYSROOT} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}") set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -arch ${CMAKE_OSX_ARCHITECTURES}")
if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64") if("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin17.0.0) # OS X 10.13 set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin17.0.0) # OS X 10.13
else() else()
@@ -137,18 +140,12 @@ else()
endif() endif()
set(PLATFORM_CMAKE_FLAGS set(PLATFORM_CMAKE_FLAGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET}
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT} -DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT}
) )
else() else()
set(SHAREDLIBEXT ".so")
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
set(BLENDER_PLATFORM_ARM ON)
endif()
set(PLATFORM_CFLAGS "-fPIC") set(PLATFORM_CFLAGS "-fPIC")
set(PLATFORM_CXXFLAGS "-std=c++17 -fPIC") set(PLATFORM_CXXFLAGS "-std=c++11 -fPIC")
set(PLATFORM_LDFLAGS) set(PLATFORM_LDFLAGS)
set(PLATFORM_BUILD_TARGET) set(PLATFORM_BUILD_TARGET)
set(PLATFORM_CMAKE_FLAGS -DCMAKE_INSTALL_LIBDIR=lib) set(PLATFORM_CMAKE_FLAGS -DCMAKE_INSTALL_LIBDIR=lib)
@@ -174,8 +171,8 @@ else()
set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG ${PLATFORM_CXXFLAGS}") set(BLENDER_CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG ${PLATFORM_CXXFLAGS}")
set(CONFIGURE_ENV set(CONFIGURE_ENV
export MACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} && export MACOSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET} &&
export MACOSX_SDK_VERSION=${CMAKE_OSX_DEPLOYMENT_TARGET} && export MACOSX_SDK_VERSION=${OSX_DEPLOYMENT_TARGET} &&
export CFLAGS=${PLATFORM_CFLAGS} && export CFLAGS=${PLATFORM_CFLAGS} &&
export CXXFLAGS=${PLATFORM_CXXFLAGS} && export CXXFLAGS=${PLATFORM_CXXFLAGS} &&
export LDFLAGS=${PLATFORM_LDFLAGS} export LDFLAGS=${PLATFORM_LDFLAGS}
@@ -195,7 +192,6 @@ set(DEFAULT_CMAKE_FLAGS
-DCMAKE_CXX_FLAGS_MINSIZEREL=${BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL} -DCMAKE_CXX_FLAGS_MINSIZEREL=${BLENDER_CMAKE_CXX_FLAGS_MINSIZEREL}
-DCMAKE_CXX_FLAGS_RELEASE=${BLENDER_CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_RELEASE=${BLENDER_CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}
-DCMAKE_CXX_STANDARD=17
${PLATFORM_CMAKE_FLAGS} ${PLATFORM_CMAKE_FLAGS}
) )
@@ -214,11 +210,3 @@ if(MSVC)
endif() endif()
set(CMAKE_INSTALL_MESSAGE LAZY) set(CMAKE_INSTALL_MESSAGE LAZY)
# On windows we sometimes want to build with ninja, but not all projects quite
# yet, so for select project we pass PLATFORM_ALT_GENERATOR as the generator
if(WIN32)
set(PLATFORM_ALT_GENERATOR "Ninja")
else()
set(PLATFORM_ALT_GENERATOR "Unix Makefiles")
endif()

View File

@@ -1,15 +1,30 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_opus ExternalProject_Add(external_opus
URL file://${PACKAGE_DIR}/${OPUS_FILE} URL ${OPUS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${OPUS_HASH_TYPE}=${OPUS_HASH} URL_HASH SHA256=${OPUS_HASH}
PREFIX ${BUILD_DIR}/opus PREFIX ${BUILD_DIR}/opus
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/opus CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/opus
--disable-shared --disable-shared
--enable-static --enable-static
--with-pic --with-pic
--disable-maintainer-mode
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && make -j${MAKE_THREADS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && make install INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/opus/src/external_opus/ && make install
INSTALL_DIR ${LIBDIR}/opus INSTALL_DIR ${LIBDIR}/opus

View File

@@ -1,50 +1,104 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32) if(WIN32)
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}") set(OSL_CMAKE_CXX_STANDARD_LIBRARIES "kernel32${LIBEXT} user32${LIBEXT} gdi32${LIBEXT} winspool${LIBEXT} shell32${LIBEXT} ole32${LIBEXT} oleaut32${LIBEXT} uuid${LIBEXT} comdlg32${LIBEXT} advapi32${LIBEXT} psapi${LIBEXT}")
set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe) set(OSL_FLEX_BISON -DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe -DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/libpng16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=0)
else()
set(OSL_SIMD_FLAGS -DOIIO_NOSIMD=1 -DOIIO_SIMD=sse2)
endif()
SET(OSL_PLATFORM_FLAGS -DLINKSTATIC=ON)
else() else()
set(OSL_CMAKE_CXX_STANDARD_LIBRARIES) set(OSL_CMAKE_CXX_STANDARD_LIBRARIES)
set(OSL_FLEX_BISON) set(OSL_FLEX_BISON)
set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/OpenImageIO${SHAREDLIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpeg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/IlmImf${OPENEXR_VERSION_POSTFIX}${SHAREDLIBEXT}") set(OSL_OPENIMAGEIO_LIBRARY "${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO${LIBEXT};${LIBDIR}/openimageio/lib/${LIBPREFIX}OpenImageIO_Util${LIBEXT};${LIBDIR}/png/lib/${LIBPREFIX}png16${LIBEXT};${LIBDIR}/jpg/lib/${LIBPREFIX}jpeg${LIBEXT};${LIBDIR}/tiff/lib/${LIBPREFIX}tiff${LIBEXT};${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}")
SET(OSL_PLATFORM_FLAGS)
endif() endif()
set(OSL_ILMBASE_CUSTOM_LIBRARIES "${LIBDIR}/openexr/lib/Imath${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Half{OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/IlmThread${OPENEXR_VERSION_POSTFIX}.lib^^${LIBDIR}/openexr/lib/Iex${OPENEXR_VERSION_POSTFIX}.lib")
set(OSL_LLVM_LIBRARY "${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMAnalysis${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMAsmParser${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMAsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMBitReader${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMBitWriter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMCodeGen${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMCore${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMDebugInfo${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMExecutionEngine${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMInstCombine${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMInstrumentation${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMInterpreter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMJIT${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMLinker${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMC${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMCDisassembler${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMCJIT${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMMCParser${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMObject${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMRuntimeDyld${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMScalarOpts${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMSelectionDAG${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMSupport${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMTableGen${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMTarget${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMTransformUtils${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMVectorize${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86AsmParser${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86AsmPrinter${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86CodeGen${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Desc${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Disassembler${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Info${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMX86Utils${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMipa${LIBEXT};${LIBDIR}/llvm/lib/${LIBPREFIX}LLVMipo${LIBEXT}")
set(OSL_EXTRA_ARGS set(OSL_EXTRA_ARGS
${DEFAULT_BOOST_FLAGS} -DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DOpenEXR_ROOT=${LIBDIR}/openexr/ -DBoost_USE_MULTITHREADED=ON
-DOpenImageIO_ROOT=${LIBDIR}/openimageio/ -DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DLLVM_DIRECTORY=${LIBDIR}/llvm
-DLLVM_INCLUDES=${LIBDIR}/llvm/include
-DLLVM_LIB_DIR=${LIBDIR}/llvm/lib
-DLLVM_VERSION=3.4
-DLLVM_LIBRARY=${OSL_LLVM_LIBRARY}
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DILMBASE_HOME=${LIBDIR}/openexr/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOSL_BUILD_TESTS=OFF -DOSL_BUILD_TESTS=OFF
-DOSL_BUILD_MATERIALX=OFF -DOSL_BUILD_MATERIALX=OFF
-DPNG_ROOT=${LIBDIR}/png
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY} -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/ -DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DOPENIMAGEIOHOME=${LIBDIR}/openimageio/
-DOPENIMAGEIO_INCLUDE_DIR=${LIBDIR}/openimageio/include
-DOPENIMAGEIO_LIBRARY=${OSL_OPENIMAGEIO_LIBRARY}
${OSL_FLEX_BISON} ${OSL_FLEX_BISON}
-DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES} -DCMAKE_CXX_STANDARD_LIBRARIES=${OSL_CMAKE_CXX_STANDARD_LIBRARIES}
-DBUILD_SHARED_LIBS=OFF -DBUILDSTATIC=ON
-DLINKSTATIC=OFF ${OSL_PLATFORM_FLAGS}
-DOSL_BUILD_PLUGINS=OFF -DOSL_BUILD_PLUGINS=Off
-DSTOP_ON_WARNING=OFF -DSTOP_ON_WARNING=OFF
-DUSE_LLVM_BITCODE=OFF -DUSE_LLVM_BITCODE=OFF
-DLLVM_ROOT=${LIBDIR}/llvm/
-DLLVM_DIRECTORY=${LIBDIR}/llvm/
-DUSE_PARTIO=OFF -DUSE_PARTIO=OFF
-DUSE_QT=OFF -DUSE_QT=OFF
-DUSE_Qt5=OFF
-DINSTALL_DOCS=OFF -DINSTALL_DOCS=OFF
-Dpugixml_ROOT=${LIBDIR}/pugixml ${OSL_SIMD_FLAGS}
-DTIFF_ROOT=${LIBDIR}/tiff -DPARTIO_LIBRARIES=
-DJPEG_ROOT=${LIBDIR}/jpeg
-DUSE_PYTHON=OFF
-DImath_ROOT=${LIBDIR}/imath
-DUSE_OIIO_STATIC=OFF
) )
if(WIN32)
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DPUGIXML_HOME=${LIBDIR}/pugixml
)
elseif(APPLE)
# Make symbol hiding consistent with OIIO which defaults to OFF,
# avoids linker warnings on macOS
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DHIDE_SYMBOLS=OFF
)
endif()
ExternalProject_Add(external_osl ExternalProject_Add(external_osl
URL file://${PACKAGE_DIR}/${OSL_FILE} URL ${OSL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
LIST_SEPARATOR ^^ LIST_SEPARATOR ^^
URL_HASH ${OSL_HASH_TYPE}=${OSL_HASH} URL_HASH MD5=${OSL_HASH}
PREFIX ${BUILD_DIR}/osl PREFIX ${BUILD_DIR}/osl
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl.diff PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/osl -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${DEFAULT_CMAKE_FLAGS} ${OSL_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/osl -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${DEFAULT_CMAKE_FLAGS} ${OSL_EXTRA_ARGS}
@@ -55,20 +109,19 @@ add_dependencies(
external_osl external_osl
external_boost external_boost
ll ll
external_clang
external_openexr external_openexr
external_zlib external_zlib
external_flexbison
external_openimageio external_openimageio
external_pugixml
) )
if(WIN32)
if(UNIX)
# Rely on PugiXML compiled with OpenImageIO
else()
add_dependencies( add_dependencies(
external_osl external_osl
external_flexbison external_pugixml
)
elseif(UNIX AND NOT APPLE)
add_dependencies(
external_osl
external_flex
) )
endif() endif()
@@ -84,7 +137,6 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslcomp.lib ${HARVEST_TARGET}/osl/lib/oslcomp_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslcomp.lib ${HARVEST_TARGET}/osl/lib/oslcomp_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslexec.lib ${HARVEST_TARGET}/osl/lib/oslexec_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslexec.lib ${HARVEST_TARGET}/osl/lib/oslexec_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslquery.lib ${HARVEST_TARGET}/osl/lib/oslquery_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslquery.lib ${HARVEST_TARGET}/osl/lib/oslquery_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/osl/lib/oslnoise.lib ${HARVEST_TARGET}/osl/lib/oslnoise_d.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(MSVC) if(MSVC)
set(PYTARGET ${HARVEST_TARGET}/python/${PYTHON_SHORT_VERSION_NO_DOTS}) set(PYTARGET ${HARVEST_TARGET}/python/${PYTHON_SHORT_VERSION_NO_DOTS})
@@ -8,7 +24,7 @@ if(MSVC)
add_custom_command( add_custom_command(
OUTPUT ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe OUTPUT ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
COMMAND echo packaging python COMMAND echo packaging python
COMMAND echo this should output at ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe COMMAND echo this should ouput at ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTARGET}/libs COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTARGET}/libs
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib ${PYTARGET}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib ${PYTARGET}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python.exe ${PYTARGET}/bin/python.exe COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python.exe ${PYTARGET}/bin/python.exe
@@ -27,7 +43,7 @@ if(MSVC)
add_custom_command( add_custom_command(
OUTPUT ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe OUTPUT ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
COMMAND echo packaging python COMMAND echo packaging python
COMMAND echo this should output at ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe COMMAND echo this should ouput at ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTARGET}/libs COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTARGET}/libs
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${PYTARGET}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${PYTARGET}/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib
COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python${PYTHON_POSTFIX}.exe ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe COMMAND ${CMAKE_COMMAND} -E copy ${PYSRC}/python${PYTHON_POSTFIX}.exe ${PYTARGET}/bin/python${PYTHON_POSTFIX}.exe

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(PNG_EXTRA_ARGS set(PNG_EXTRA_ARGS
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY} -DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
@@ -6,14 +22,14 @@ set(PNG_EXTRA_ARGS
-DPNG_STATIC=ON -DPNG_STATIC=ON
) )
if(BLENDER_PLATFORM_ARM) if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
set(PNG_EXTRA_ARGS ${PNG_EXTRA_ARGS} -DPNG_HARDWARE_OPTIMIZATIONS=ON -DPNG_ARM_NEON=on -DCMAKE_SYSTEM_PROCESSOR="aarch64") set(PNG_EXTRA_ARGS ${PNG_EXTRA_ARGS} -DPNG_HARDWARE_OPTIMIZATIONS=ON -DPNG_ARM_NEON=on -DCMAKE_SYSTEM_PROCESSOR="aarch64")
endif() endif()
ExternalProject_Add(external_png ExternalProject_Add(external_png
URL file://${PACKAGE_DIR}/${PNG_FILE} URL ${PNG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PNG_HASH_TYPE}=${PNG_HASH} URL_HASH SHA256=${PNG_HASH}
PREFIX ${BUILD_DIR}/png PREFIX ${BUILD_DIR}/png
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/png ${DEFAULT_CMAKE_FLAGS} ${PNG_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/png ${DEFAULT_CMAKE_FLAGS} ${PNG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/png INSTALL_DIR ${LIBDIR}/png
@@ -24,14 +40,6 @@ add_dependencies(
external_zlib external_zlib
) )
if(WIN32 AND BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static${LIBEXT} ${HARVEST_TARGET}/png/lib/libpng${LIBEXT}
DEPENDEES install
)
endif()
if(WIN32 AND BUILD_MODE STREQUAL Debug) if(WIN32 AND BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_png after_install ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_staticd${LIBEXT} ${LIBDIR}/png/lib/libpng16${LIBEXT} COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_staticd${LIBEXT} ${LIBDIR}/png/lib/libpng16${LIBEXT}

View File

@@ -1,22 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(POTRACE_EXTRA_ARGS
)
if((WIN32 AND BUILD_MODE STREQUAL Release) OR UNIX)
ExternalProject_Add(external_potrace
URL file://${PACKAGE_DIR}/${POTRACE_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${POTRACE_HASH_TYPE}=${POTRACE_HASH}
PREFIX ${BUILD_DIR}/potrace
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_potrace.txt ${BUILD_DIR}/potrace/src/external_potrace/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/potrace ${DEFAULT_CMAKE_FLAGS} ${POTRACE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/potrace
)
if(WIN32)
ExternalProject_Add_Step(external_potrace after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/potrace ${HARVEST_TARGET}/potrace
DEPENDEES install
)
endif()
endif()

View File

@@ -1,37 +1,54 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32) if(WIN32)
if(MSVC14) # vs2015 has timespec if(MSVC14) # vs2015 has timespec
set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H /D_TIMESPEC_DEFINED ") set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H /D_TIMESPEC_DEFINED ")
else() # everything before doesn't else() # everything before doesn't
set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H ") set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H ")
endif() endif()
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC-static /e CPPFLAGS=${PTHREAD_CPPFLAGS}) set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC-static /e CPPFLAGS=${PTHREAD_CPPFLAGS})
ExternalProject_Add(external_pthreads ExternalProject_Add(external_pthreads
URL file://${PACKAGE_DIR}/${PTHREADS_FILE} URL ${PTHREADS_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PTHREADS_HASH_TYPE}=${PTHREADS_HASH} URL_HASH MD5=${PTHREADS_HASH}
PREFIX ${BUILD_DIR}/pthreads PREFIX ${BUILD_DIR}/pthreads
CONFIGURE_COMMAND echo . CONFIGURE_COMMAND echo .
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff
BUILD_COMMAND ${PTHREADS_BUILD} BUILD_COMMAND ${PTHREADS_BUILD}
INSTALL_COMMAND COMMAND INSTALL_COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/libpthreadVC3${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} && ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/libpthreadVC3${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h && ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h && ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h && ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/_ptw32.h ${LIBDIR}/pthreads/inc/_ptw32.h ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/_ptw32.h ${LIBDIR}/pthreads/inc/_ptw32.h
INSTALL_DIR ${LIBDIR}/pthreads INSTALL_DIR ${LIBDIR}/pthreads
)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_pthreads after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/inc/ ${HARVEST_TARGET}/pthreads/include/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/lib/ ${HARVEST_TARGET}/pthreads/lib
DEPENDEES install
) )
endif()
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_pthreads after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/inc/ ${HARVEST_TARGET}/pthreads/include/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pthreads/lib/ ${HARVEST_TARGET}/pthreads/lib
DEPENDEES install
)
endif()
endif() endif()

View File

@@ -1,12 +1,28 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(PUGIXML_EXTRA_ARGS set(PUGIXML_EXTRA_ARGS
) )
ExternalProject_Add(external_pugixml ExternalProject_Add(external_pugixml
URL file://${PACKAGE_DIR}/${PUGIXML_FILE} URL ${PUGIXML_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PUGIXML_HASH_TYPE}=${PUGIXML_HASH} URL_HASH MD5=${PUGIXML_HASH}
PREFIX ${BUILD_DIR}/pugixml PREFIX ${BUILD_DIR}/pugixml
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/pugixml ${DEFAULT_CMAKE_FLAGS} ${PUGIXML_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/pugixml ${DEFAULT_CMAKE_FLAGS} ${PUGIXML_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/pugixml INSTALL_DIR ${LIBDIR}/pugixml
@@ -14,14 +30,14 @@ ExternalProject_Add(external_pugixml
if(WIN32) if(WIN32)
if(BUILD_MODE STREQUAL Release) if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_pugixml after_install ExternalProject_Add_Step(external_pugixml after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pugixml ${HARVEST_TARGET}/pugixml COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()
if(BUILD_MODE STREQUAL Debug) if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_pugixml after_install ExternalProject_Add_Step(external_pugixml after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/pugixml/lib/pugixml_d.lib COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/pugixml/lib/pugixml.lib ${HARVEST_TARGET}/osl/lib/pugixml_d.lib
DEPENDEES install DEPENDEES install
) )
endif() endif()
endif() endif()

View File

@@ -1,21 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(PYBIND11_EXTRA_ARGS
-DPYBIND11_TEST=OFF
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
)
ExternalProject_Add(external_pybind11
URL file://${PACKAGE_DIR}/${PYBIND11_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PYBIND11_HASH_TYPE}=${PYBIND11_HASH}
PREFIX ${BUILD_DIR}/pybind11
CMAKE_GENERATOR ${PLATFORM_ALT_GENERATOR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/pybind11 ${DEFAULT_CMAKE_FLAGS} ${PYBIND11_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/pybind11
)
add_dependencies(
external_pybind11
external_python
)

View File

@@ -1,22 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(PYSTRING_EXTRA_ARGS
)
ExternalProject_Add(external_pystring
URL file://${PACKAGE_DIR}/${PYSTRING_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PYSTRING_HASH_TYPE}=${PYSTRING_HASH}
PREFIX ${BUILD_DIR}/pystring
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_pystring.txt ${BUILD_DIR}/pystring/src/external_pystring/CMakeLists.txt
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/pystring ${DEFAULT_CMAKE_FLAGS} ${PYSTRING_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/pystring
)
if(WIN32)
ExternalProject_Add_Step(external_pystring after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pystring/lib ${HARVEST_TARGET}/pystring/lib
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/pystring/include ${HARVEST_TARGET}/pystring/include
DEPENDEES install
)
endif()

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(PYTHON_POSTFIX) set(PYTHON_POSTFIX)
if(BUILD_MODE STREQUAL Debug) if(BUILD_MODE STREQUAL Debug)
@@ -15,37 +31,21 @@ if(WIN32)
endmacro() endmacro()
set(PYTHON_EXTERNALS_FOLDER ${BUILD_DIR}/python/src/external_python/externals) set(PYTHON_EXTERNALS_FOLDER ${BUILD_DIR}/python/src/external_python/externals)
set(ZLIB_SOURCE_FOLDER ${BUILD_DIR}/zlib/src/external_zlib)
set(SSL_SOURCE_FOLDER ${BUILD_DIR}/ssl/src/external_ssl)
set(DOWNLOADS_EXTERNALS_FOLDER ${DOWNLOAD_DIR}/externals) set(DOWNLOADS_EXTERNALS_FOLDER ${DOWNLOAD_DIR}/externals)
cmake_to_dos_path(${PYTHON_EXTERNALS_FOLDER} PYTHON_EXTERNALS_FOLDER_DOS) cmake_to_dos_path(${PYTHON_EXTERNALS_FOLDER} PYTHON_EXTERNALS_FOLDER_DOS)
cmake_to_dos_path(${ZLIB_SOURCE_FOLDER} ZLIB_SOURCE_FOLDER_DOS)
cmake_to_dos_path(${SSL_SOURCE_FOLDER} SSL_SOURCE_FOLDER_DOS)
cmake_to_dos_path(${DOWNLOADS_EXTERNALS_FOLDER} DOWNLOADS_EXTERNALS_FOLDER_DOS) cmake_to_dos_path(${DOWNLOADS_EXTERNALS_FOLDER} DOWNLOADS_EXTERNALS_FOLDER_DOS)
ExternalProject_Add(external_python ExternalProject_Add(external_python
URL file://${PACKAGE_DIR}/${PYTHON_FILE} URL ${PYTHON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PYTHON_HASH_TYPE}=${PYTHON_HASH} URL_HASH MD5=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python PREFIX ${BUILD_DIR}/python
# Python will download its own deps and there's very little we can do about CONFIGURE_COMMAND ""
# that beyond placing some code in their externals dir before it tries. BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p x64 -c ${BUILD_MODE}
# the foldernames *HAVE* to match the ones inside pythons get_externals.cmd. INSTALL_COMMAND ${PYTHON_BINARY_INTERNAL} ${PYTHON_SRC}/PC/layout/main.py -b ${PYTHON_SRC}/PCbuild/amd64 -s ${PYTHON_SRC} -t ${PYTHON_SRC}/tmp/ --include-underpth --include-stable --include-pip --include-dev --include-launchers --include-venv --include-symbols ${PYTHON_EXTRA_INSTLAL_FLAGS} --copy ${LIBDIR}/python
# regardless of the version actually in there.
PATCH_COMMAND mkdir ${PYTHON_EXTERNALS_FOLDER_DOS} &&
mklink /J ${PYTHON_EXTERNALS_FOLDER_DOS}\\zlib-1.2.13 ${ZLIB_SOURCE_FOLDER_DOS} &&
mklink /J ${PYTHON_EXTERNALS_FOLDER_DOS}\\openssl-1.1.1q ${SSL_SOURCE_FOLDER_DOS} &&
${CMAKE_COMMAND} -E copy ${ZLIB_SOURCE_FOLDER}/../external_zlib-build/zconf.h ${PYTHON_EXTERNALS_FOLDER}/zlib-1.2.13/zconf.h &&
${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_windows.diff
CONFIGURE_COMMAND echo "."
BUILD_COMMAND ${CONFIGURE_ENV_MSVC} && cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && set LDFLAGS=/DEBUG && call prepare_ssl.bat && call build.bat -e -p x64 -c ${BUILD_MODE}
INSTALL_COMMAND ${PYTHON_BINARY_INTERNAL} ${PYTHON_SRC}/PC/layout/main.py -b ${PYTHON_SRC}/PCbuild/amd64 -s ${PYTHON_SRC} -t ${PYTHON_SRC}/tmp/ --include-stable --include-pip --include-dev --include-launchers --include-venv --include-symbols ${PYTHON_EXTRA_INSTLAL_FLAGS} --copy ${LIBDIR}/python
)
add_dependencies(
external_python
external_zlib
) )
else() else()
if(APPLE) if(APPLE)
# Disable functions that can be in 10.13 sdk but aren't available on 10.9 target. # Disable functions that can be in 10.13 sdk but aren't available on 10.9 target.
@@ -73,15 +73,17 @@ else()
set(PYTHON_FUNC_CONFIGS ${PYTHON_FUNC_CONFIGS} && export PYTHON_DECIMAL_WITH_MACHINE=ansi64) set(PYTHON_FUNC_CONFIGS ${PYTHON_FUNC_CONFIGS} && export PYTHON_DECIMAL_WITH_MACHINE=ansi64)
endif() endif()
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && ${PYTHON_FUNC_CONFIGS}) set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV} && ${PYTHON_FUNC_CONFIGS})
set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python.exe)
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_macos.diff)
else() else()
set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV}) set(PYTHON_CONFIGURE_ENV ${CONFIGURE_ENV})
endif() set(PYTHON_BINARY ${BUILD_DIR}/python/src/external_python/python)
set(PYTHON_BINARY ${LIBDIR}/python/bin/python${PYTHON_SHORT_VERSION}) set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_linux.diff)
# Link against zlib statically (Unix). Avoid rpath issues (macOS). endif()
set(PYTHON_PATCH ${PATCH_CMD} --verbose -p1 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python_unix.diff)
set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl") set(PYTHON_CONFIGURE_EXTRA_ARGS "--with-openssl=${LIBDIR}/ssl")
set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include ${PLATFORM_CFLAGS}") set(PYTHON_CFLAGS "-I${LIBDIR}/sqlite/include -I${LIBDIR}/bzip2/include -I${LIBDIR}/lzma/include -I${LIBDIR}/zlib/include")
set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib ${PLATFORM_LDFLAGS}") set(PYTHON_LDFLAGS "-L${LIBDIR}/ffi/lib -L${LIBDIR}/sqlite/lib -L${LIBDIR}/bzip2/lib -L${LIBDIR}/lzma/lib -L${LIBDIR}/zlib/lib")
set(PYTHON_CONFIGURE_EXTRA_ENV set(PYTHON_CONFIGURE_EXTRA_ENV
export CFLAGS=${PYTHON_CFLAGS} && export CFLAGS=${PYTHON_CFLAGS} &&
export CPPFLAGS=${PYTHON_CFLAGS} && export CPPFLAGS=${PYTHON_CFLAGS} &&
@@ -89,9 +91,9 @@ else()
export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig) export PKG_CONFIG_PATH=${LIBDIR}/ffi/lib/pkgconfig)
ExternalProject_Add(external_python ExternalProject_Add(external_python
URL file://${PACKAGE_DIR}/${PYTHON_FILE} URL ${PYTHON_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${PYTHON_HASH_TYPE}=${PYTHON_HASH} URL_HASH MD5=${PYTHON_HASH}
PREFIX ${BUILD_DIR}/python PREFIX ${BUILD_DIR}/python
PATCH_COMMAND ${PYTHON_PATCH} PATCH_COMMAND ${PYTHON_PATCH}
CONFIGURE_COMMAND ${PYTHON_CONFIGURE_ENV} && ${PYTHON_CONFIGURE_EXTRA_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/python ${PYTHON_CONFIGURE_EXTRA_ARGS} CONFIGURE_COMMAND ${PYTHON_CONFIGURE_ENV} && ${PYTHON_CONFIGURE_EXTRA_ENV} && cd ${BUILD_DIR}/python/src/external_python/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/python ${PYTHON_CONFIGURE_EXTRA_ARGS}
@@ -100,31 +102,14 @@ else()
INSTALL_DIR ${LIBDIR}/python) INSTALL_DIR ${LIBDIR}/python)
endif() endif()
add_dependencies(
external_python
external_ssl
external_zlib
)
if(UNIX) if(UNIX)
add_dependencies( add_dependencies(
external_python external_python
external_bzip2 external_bzip2
external_ffi external_ffi
external_lzma external_lzma
external_ssl
external_sqlite external_sqlite
external_zlib
) )
endif() endif()
if(WIN32)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_python after_install
# Boost can't keep it self from linking release python
# in a debug configuration even if all options are set
# correctly to instruct it to use the debug version
# of python. So just copy the debug imports file over
# and call it a day...
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib
DEPENDEES install
)
endif()
endif()

View File

@@ -1,52 +1,29 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
if(WIN32 AND BUILD_MODE STREQUAL Debug) # This program is free software; you can redistribute it and/or
set(SITE_PACKAGES_EXTRA --global-option build --global-option --debug) # modify it under the terms of the GNU General Public License
# zstandard is determined to build and link release mode libs in a debug # as published by the Free Software Foundation; either version 2
# configuration, the only way to make it happy is to bend to its will # of the License, or (at your option) any later version.
# and give it a library to link with. #
set( # This program is distributed in the hope that it will be useful,
PIP_CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy # but WITHOUT ANY WARRANTY; without even the implied warranty of
${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.lib # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
${LIBDIR}/python/libs/python${PYTHON_SHORT_VERSION_NO_DOTS}.lib # GNU General Public License for more details.
) #
else() # You should have received a copy of the GNU General Public License
set(PIP_CONFIGURE_COMMAND echo ".") # along with this program; if not, write to the Free Software Foundation,
endif() # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
ExternalProject_Add(external_python_site_packages ExternalProject_Add(external_python_site_packages
DOWNLOAD_COMMAND "" DOWNLOAD_COMMAND ""
CONFIGURE_COMMAND ${PIP_CONFIGURE_COMMAND} CONFIGURE_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""
PREFIX ${BUILD_DIR}/site_packages PREFIX ${BUILD_DIR}/site_packages
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all:
# setuptools is downgraded to 63.2.0 (same as python 3.10.8) since numpy 1.23.x seemingly has
# issues building on windows with the newer versions that ships with python 3.10.9+
INSTALL_COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir ${SITE_PACKAGES_EXTRA}
setuptools==63.2.0
cython==${CYTHON_VERSION}
idna==${IDNA_VERSION}
charset-normalizer==${CHARSET_NORMALIZER_VERSION}
urllib3==${URLLIB3_VERSION}
certifi==${CERTIFI_VERSION}
requests==${REQUESTS_VERSION}
zstandard==${ZSTANDARD_VERSION}
autopep8==${AUTOPEP8_VERSION}
pycodestyle==${PYCODESTYLE_VERSION}
toml==${TOML_VERSION}
meson==${MESON_VERSION}
--no-binary :all:
) )
if(USE_PIP_NUMPY)
# Use only wheel (and not build from source) to stop NumPy from linking against buggy
# Accelerate framework backend on macOS. Official wheels are built with OpenBLAS.
ExternalProject_Add_Step(external_python_site_packages after_install
COMMAND ${PYTHON_BINARY} -m pip install --no-cache-dir numpy==${NUMPY_VERSION} --only-binary :all:
DEPENDEES install
)
endif()
add_dependencies( add_dependencies(
external_python_site_packages external_python_site_packages
external_python external_python

View File

@@ -1,13 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(ROBINMAP_EXTRA_ARGS
)
ExternalProject_Add(external_robinmap
URL file://${PACKAGE_DIR}/${ROBINMAP_FILE}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${ROBINMAP_HASH_TYPE}=${ROBINMAP_HASH}
PREFIX ${BUILD_DIR}/robinmap
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/robinmap ${DEFAULT_CMAKE_FLAGS} ${ROBINMAP_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/robinmap
)

View File

@@ -1,4 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32) if(WIN32)
set(SDL_EXTRA_ARGS set(SDL_EXTRA_ARGS
@@ -14,9 +30,9 @@ else()
endif() endif()
ExternalProject_Add(external_sdl ExternalProject_Add(external_sdl
URL file://${PACKAGE_DIR}/${SDL_FILE} URL ${SDL_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${SDL_HASH_TYPE}=${SDL_HASH} URL_HASH MD5=${SDL_HASH}
PREFIX ${BUILD_DIR}/sdl PREFIX ${BUILD_DIR}/sdl
PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/sdl/src/external_sdl < ${PATCH_DIR}/sdl.diff PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/sdl/src/external_sdl < ${PATCH_DIR}/sdl.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/sdl ${DEFAULT_CMAKE_FLAGS} ${SDL_EXTRA_ARGS} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/sdl ${DEFAULT_CMAKE_FLAGS} ${SDL_EXTRA_ARGS}

View File

@@ -1,10 +1,26 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
################################################################################################## ####################################################################################################################
# Mingw64 Builds # Mingw64 Builds
################################################################################################## ####################################################################################################################
# This installs mingw64+msys to compile ffmpeg/iconv/libsndfile/fftw3 # This installs mingw64+msys to compile ffmpeg/iconv/libsndfile/fftw3
################################################################################################## ####################################################################################################################
message("LIBDIR = ${LIBDIR}") message("LIBDIR = ${LIBDIR}")
macro(cmake_to_msys_path MsysPath ResultingPath) macro(cmake_to_msys_path MsysPath ResultingPath)

View File

@@ -1,47 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(SHADERC_EXTRA_ARGS
-DSHADERC_SKIP_TESTS=On
-DSHADERC_SPIRV_TOOLS_DIR=${BUILD_DIR}/shaderc_spirv_tools/src/external_shaderc_spirv_tools
-DSHADERC_SPIRV_HEADERS_DIR=${BUILD_DIR}/shaderc_spirv_headers/src/external_shaderc_spirv_headers
-DSHADERC_GLSLANG_DIR=${BUILD_DIR}/shaderc_glslang/src/external_shaderc_glslang
-DCMAKE_DEBUG_POSTFIX=_d
-DPYTHON_EXECUTABLE=${PYTHON_BINARY}
)
ExternalProject_Add(external_shaderc
URL file://${PACKAGE_DIR}/${SHADERC_FILE}
URL_HASH ${SHADERC_HASH_TYPE}=${SHADERC_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/shaderc
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/shaderc ${DEFAULT_CMAKE_FLAGS} ${SHADERC_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/shaderc
)
add_dependencies(
external_shaderc
external_shaderc_spirv_tools
external_shaderc_spirv_headers
external_shaderc_glslang
external_python
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_shaderc after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/shaderc/include ${HARVEST_TARGET}/shaderc/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/shaderc/bin/shaderc_shared.dll ${HARVEST_TARGET}/shaderc/bin/shaderc_shared.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/shaderc/lib/shaderc_shared.lib ${HARVEST_TARGET}/shaderc/lib/shaderc_shared.lib
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_shaderc after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/shaderc/bin/shaderc_shared_d.dll ${HARVEST_TARGET}/shaderc/bin/shaderc_shared_d.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/shaderc/lib/shaderc_shared_d.lib ${HARVEST_TARGET}/shaderc/lib/shaderc_shared_d.lib
DEPENDEES install
)
endif()
endif()

View File

@@ -1,34 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# These are build time requirements for shaderc. We only have to unpack these
# shaderc will build them.
ExternalProject_Add(external_shaderc_glslang
URL file://${PACKAGE_DIR}/${SHADERC_GLSLANG_FILE}
URL_HASH ${SHADERC_GLSLANG_HASH_TYPE}=${SHADERC_GLSLANG_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/shaderc_glslang
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
ExternalProject_Add(external_shaderc_spirv_headers
URL file://${PACKAGE_DIR}/${SHADERC_SPIRV_HEADERS_FILE}
URL_HASH ${SHADERC_SPIRV_HEADERS_HASH_TYPE}=${SHADERC_SPIRV_HEADERS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/shaderc_spirv_headers
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)
ExternalProject_Add(external_shaderc_spirv_tools
URL file://${PACKAGE_DIR}/${SHADERC_SPIRV_TOOLS_FILE}
URL_HASH ${SHADERC_SPIRV_TOOLS_HASH_TYPE}=${SHADERC_SPIRV_TOOLS_HASH}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
PREFIX ${BUILD_DIR}/shaderc_spirv_tools
CONFIGURE_COMMAND echo .
BUILD_COMMAND echo .
INSTALL_COMMAND echo .
)

View File

@@ -1,15 +1,25 @@
# SPDX-License-Identifier: GPL-2.0-or-later # ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(SNDFILE_EXTRA_ARGS) set(SNDFILE_EXTRA_ARGS)
set(SNDFILE_ENV) set(SNDFILE_ENV PKG_CONFIG_PATH=${mingw_LIBDIR}/ogg/lib/pkgconfig:${mingw_LIBDIR}/vorbis/lib/pkgconfig:${mingw_LIBDIR}/flac/lib/pkgconfig:${mingw_LIBDIR})
if(WIN32) if(WIN32)
set(SNDFILE_ENV "PKG_CONFIG_PATH=\
${mingw_LIBDIR}/ogg/lib/pkgconfig:\
${mingw_LIBDIR}/vorbis/lib/pkgconfig:\
${mingw_LIBDIR}/flac/lib/pkgconfig:\
${mingw_LIBDIR}/opus/lib/pkgconfig"
)
set(SNDFILE_ENV set ${SNDFILE_ENV} &&) set(SNDFILE_ENV set ${SNDFILE_ENV} &&)
# Shared for windows because static libs will drag in a libgcc dependency. # Shared for windows because static libs will drag in a libgcc dependency.
set(SNDFILE_OPTIONS --disable-static --enable-shared ) set(SNDFILE_OPTIONS --disable-static --enable-shared )
@@ -17,11 +27,18 @@ else()
set(SNDFILE_OPTIONS --enable-static --disable-shared ) set(SNDFILE_OPTIONS --enable-static --disable-shared )
endif() endif()
if(UNIX)
set(SNDFILE_PATCH_CMD ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/sndfile/src/external_sndfile < ${PATCH_DIR}/sndfile.diff)
else()
set(SNDFILE_PATCH_CMD)
endif()
ExternalProject_Add(external_sndfile ExternalProject_Add(external_sndfile
URL file://${PACKAGE_DIR}/${SNDFILE_FILE} URL ${SNDFILE_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR} DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH ${SNDFILE_HASH_TYPE}=${SNDFILE_HASH} URL_HASH MD5=${SNDFILE_HASH}
PREFIX ${BUILD_DIR}/sndfile PREFIX ${BUILD_DIR}/sndfile
PATCH_COMMAND ${SNDFILE_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && ${SNDFILE_ENV} ${CONFIGURE_COMMAND} ${SNDFILE_OPTIONS} --prefix=${mingw_LIBDIR}/sndfile CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && ${SNDFILE_ENV} ${CONFIGURE_COMMAND} ${SNDFILE_OPTIONS} --prefix=${mingw_LIBDIR}/sndfile
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make -j${MAKE_THREADS} BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make install INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/sndfile/src/external_sndfile/ && make install
@@ -36,7 +53,6 @@ add_dependencies(
external_sndfile external_sndfile
external_ogg external_ogg
external_vorbis external_vorbis
external_opus
) )
if(UNIX) if(UNIX)
add_dependencies( add_dependencies(
@@ -47,10 +63,10 @@ endif()
if(BUILD_MODE STREQUAL Release AND WIN32) if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_sndfile after_install ExternalProject_Add_Step(external_sndfile after_install
COMMAND lib /def:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.def /machine:x64 /out:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib COMMAND lib /def:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.def /machine:x64 /out:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h
DEPENDEES install DEPENDEES install
) )

Some files were not shown because too many files have changed in this diff Show More