Compare commits
458
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
963d07d531 | ||
|
|
ecbeda622f | ||
|
|
a6345e095e | ||
|
|
8e470c7616 | ||
|
|
d8810c5365 | ||
|
|
d631f92721 | ||
|
|
7f71282027 | ||
|
|
4f981ba3b7 | ||
|
|
d0a77b9f2f | ||
|
|
292b6ac1c1 | ||
|
|
f8969b894a | ||
|
|
871e88c857 | ||
|
|
dcf48e1f80 | ||
|
|
94be07fbce | ||
|
|
1d0e570a49 | ||
|
|
be2c4e3198 | ||
|
|
5ba33f3886 | ||
|
|
bfa4ba5f2e | ||
|
|
e8f1202f0f | ||
|
|
3082bd7f2a | ||
|
|
1253a034f0 | ||
|
|
14ee3c30e4 | ||
|
|
41fe60cf4c | ||
|
|
a20766cd17 | ||
|
|
129728f4e8 | ||
|
|
e35dc40e7a | ||
|
|
3d0be6561c | ||
|
|
6f15fb343d | ||
|
|
7eea02d2ba | ||
|
|
c47dbb566c | ||
|
|
ec1843512f | ||
|
|
4827c23775 | ||
|
|
276ff1656f | ||
|
|
46fdc7fc0b | ||
|
|
d7427ae376 | ||
|
|
eec0106ad3 | ||
|
|
73842b9968 | ||
|
|
a25c31af5b | ||
|
|
d351cf3b32 | ||
|
|
1dcee8487d | ||
|
|
363ed762b7 | ||
|
|
100897491e | ||
|
|
f0c3890eb5 | ||
|
|
63ee142750 | ||
|
|
3481ab058b | ||
|
|
f30f2b77bc | ||
|
|
2b6cfc76f9 | ||
|
|
7c26a62201 | ||
|
|
7e5b841a80 | ||
|
|
2ebf56fa47 | ||
|
|
198258fd7e | ||
|
|
489b443368 | ||
|
|
aa12d70274 | ||
|
|
e60789f6c0 | ||
|
|
ea2a846b70 | ||
|
|
830d55b76b | ||
|
|
4fc8ce3a29 | ||
|
|
7b602c1722 | ||
|
|
975ed71af5 | ||
|
|
7d3ba8fad2 | ||
|
|
42e4a0b842 | ||
|
|
fed34425be | ||
|
|
b9e6dc5a0c | ||
|
|
4e34d10ff4 | ||
|
|
ee07290c2f | ||
|
|
812b8d329b | ||
|
|
23092e6271 | ||
|
|
727c325420 | ||
|
|
5e2b5b64e4 | ||
|
|
6f69687c16 | ||
|
|
1b5a726656 | ||
|
|
9491e78bcc | ||
|
|
7364048e9e | ||
|
|
710a30ba3d | ||
|
|
012d3b45e4 | ||
|
|
1982eba11c | ||
|
|
f9c64a8a26 | ||
|
|
0d49080c10 | ||
|
|
30ce101ec1 | ||
|
|
d3ab6f631d | ||
|
|
a5dcf08dbc | ||
|
|
351f3979fd | ||
|
|
24dacc7bc6 | ||
|
|
5ac50bc72d | ||
|
|
052675f162 | ||
|
|
044c1bba59 | ||
|
|
6326c4d97b | ||
|
|
4de0652f20 | ||
|
|
5937c5a2eb | ||
|
|
f161d93001 | ||
|
|
c835a1a656 | ||
|
|
10d8f4058a | ||
|
|
2f0021a7d4 | ||
|
|
37828b8305 | ||
|
|
a04008c48b | ||
|
|
5cc51b5115 | ||
|
|
ee970e87e4 | ||
|
|
67a86bee32 | ||
|
|
d72e273ac5 | ||
|
|
cbd390aa2b | ||
|
|
64de894358 | ||
|
|
7b6e5ed388 | ||
|
|
9e911bddf2 | ||
|
|
a78e6f476a | ||
|
|
3ec69e283c | ||
|
|
61327af960 | ||
|
|
ca8ca129bb | ||
|
|
6cb51486db | ||
|
|
eefe022c3e | ||
|
|
30561b62f9 | ||
|
|
74066a6fad | ||
|
|
1f83602e82 | ||
|
|
50bb052794 | ||
|
|
74307605e2 | ||
|
|
b37b9dfe71 | ||
|
|
4ad6e013b2 | ||
|
|
82a5af185c | ||
|
|
1a105a6496 | ||
|
|
657f3963e7 | ||
|
|
1991e28b6c | ||
|
|
bc51675223 | ||
|
|
2c4c108988 | ||
|
|
362162e51d | ||
|
|
5043b5e457 | ||
|
|
caa0760727 | ||
|
|
b2b135284c | ||
|
|
547d88a21d | ||
|
|
531fdcfbd5 | ||
|
|
058a03ded3 | ||
|
|
6307f02457 | ||
|
|
f657b40dd7 | ||
|
|
706d9e9c56 | ||
|
|
cc72900b27 | ||
|
|
09818a4bac | ||
|
|
571c8dd95c | ||
|
|
c40c0d4ffe | ||
|
|
33b4b44c8b | ||
|
|
55138f5ee9 | ||
|
|
8af51a9f56 | ||
|
|
e81036b655 | ||
|
|
b2f0e40581 | ||
|
|
0762e96f7f | ||
|
|
0f9ed4c9eb | ||
|
|
26929e9619 | ||
|
|
5bcc3e1253 | ||
|
|
ba42dc3f30 | ||
|
|
c8ef50c6b3 | ||
|
|
9cc19c3b64 | ||
|
|
3418f1c97e | ||
|
|
cc53a0eceb | ||
|
|
ebac2614e6 | ||
|
|
91302311fb | ||
|
|
a9d251597a | ||
|
|
2deb8d9703 | ||
|
|
2c345ce943 | ||
|
|
041b374b4d | ||
|
|
1f1c0a69db | ||
|
|
52f2217ad6 | ||
|
|
636ea4eb5b | ||
|
|
8853dd0b01 | ||
|
|
85b4bb66c8 | ||
|
|
1d2edfc349 | ||
|
|
9ce868a956 | ||
|
|
20d26c535c | ||
|
|
5707b804d3 | ||
|
|
373f0c0119 | ||
|
|
5a796bbee8 | ||
|
|
e29043f038 | ||
|
|
f3225507c4 | ||
|
|
e20b956637 | ||
|
|
99886c1834 | ||
|
|
df630c0969 | ||
|
|
9acae4f13b | ||
|
|
d2d93e72c5 | ||
|
|
d5c3f5adac | ||
|
|
a81c0f17fe | ||
|
|
6ed73c00fa | ||
|
|
88feb65fc9 | ||
|
|
7e8d5b5339 | ||
|
|
b008da8bf5 | ||
|
|
0786f5e633 | ||
|
|
e7406560c8 | ||
|
|
bea16ced17 | ||
|
|
12c4a637c4 | ||
|
|
e999f405bf | ||
|
|
dbab9b55d3 | ||
|
|
99a751b857 | ||
|
|
e4da960d0a | ||
|
|
a2b5345c6a | ||
|
|
8cd5faf404 | ||
|
|
a02eb8fd82 | ||
|
|
12af87c8a8 | ||
|
|
42235001ee | ||
|
|
d0f865da2a | ||
|
|
38d4bfddf2 | ||
|
|
527591c4a7 | ||
|
|
092a48ce41 | ||
|
|
bf1a07162b | ||
|
|
2650c9562f | ||
|
|
ad31ad8ebf | ||
|
|
7fcf440112 | ||
|
|
8730b627b7 | ||
|
|
f21494e1fb | ||
|
|
72e6a63d77 | ||
|
|
605ff8035a | ||
|
|
20fecc1da4 | ||
|
|
a210d86984 | ||
|
|
3323577dbc | ||
|
|
e081016fad | ||
|
|
f0d7ef64d2 | ||
|
|
48306822ed | ||
|
|
4f220983e8 | ||
|
|
95ac64fbbe | ||
|
|
8f6423487b | ||
|
|
9542d3e3d3 | ||
|
|
5cb002d92e | ||
|
|
6a43b6ecde | ||
|
|
79ca384e70 | ||
|
|
ae331ae0f7 | ||
|
|
79a5652493 | ||
|
|
3e3b1d896f | ||
|
|
17f8b71fc4 | ||
|
|
c3c4c371dd | ||
|
|
af889045e4 | ||
|
|
b65466424a | ||
|
|
e3b92c8f76 | ||
|
|
5b8b48a070 | ||
|
|
0eacfc5178 | ||
|
|
9fedf96e50 | ||
|
|
0ea3b4eca6 | ||
|
|
b860e9f21f | ||
|
|
d50da75fbe | ||
|
|
adc3fa4e05 | ||
|
|
191726fb82 | ||
|
|
e5035f712f | ||
|
|
4bcce0fdb3 | ||
|
|
14a22f40a4 | ||
|
|
5b868c7fef | ||
|
|
d1f63a5382 | ||
|
|
bbd7675c8e | ||
|
|
2aae67f763 | ||
|
|
fcd3580cca | ||
|
|
7357ca1bdc | ||
|
|
adfa94d535 | ||
|
|
b350f5a88b | ||
|
|
e662096012 | ||
|
|
ae47110077 | ||
|
|
12dfb9a0ca | ||
|
|
ff662cb2ed | ||
|
|
78a53b9884 | ||
|
|
b3f6a6824d | ||
|
|
52d8934cae | ||
|
|
873b08b737 | ||
|
|
8a4d2f933c | ||
|
|
94174d27d8 | ||
|
|
ad7938902d | ||
|
|
6879040647 | ||
|
|
ce03e8ed99 | ||
|
|
5133a8785f | ||
|
|
5dcc332bf1 | ||
|
|
302d9cc65c | ||
|
|
2af3c4892f | ||
|
|
4c3a24f7e8 | ||
|
|
64bad0cc6f | ||
|
|
479805991c | ||
|
|
0eaa5f4810 | ||
|
|
caeb255bec | ||
|
|
47c16dea9f | ||
|
|
e19c47a979 | ||
|
|
7be26c2e22 | ||
|
|
3c8dccd9e6 | ||
|
|
7c48edb09e | ||
|
|
e70f97d3ac | ||
|
|
0ea0c7054c | ||
|
|
ecbc249e5a | ||
|
|
227ded4afe | ||
|
|
639daadc4f | ||
|
|
9e819babab | ||
|
|
e25d956ea2 | ||
|
|
cb4176ea49 | ||
|
|
d095f0da3a | ||
|
|
20e2430765 | ||
|
|
6a289dd7b9 | ||
|
|
2c6787881c | ||
|
|
3d06a4e356 | ||
|
|
e182f6d0b1 | ||
|
|
0841e14c2d | ||
|
|
f8807ad704 | ||
|
|
bf795758b0 | ||
|
|
11f845e671 | ||
|
|
299fb4103d | ||
|
|
c9a6e35269 | ||
|
|
5155f94c80 | ||
|
|
dcf2904888 | ||
|
|
f71328b113 | ||
|
|
e5657f7492 | ||
|
|
8f2c03f02d | ||
|
|
f9b45b96ec | ||
|
|
5f60237ea1 | ||
|
|
c728f433aa | ||
|
|
8e47157088 | ||
|
|
df8d37b632 | ||
|
|
d129c9a47c | ||
|
|
14e174c9b6 | ||
|
|
4cc4b6e8d5 | ||
|
|
e697e696b7 | ||
|
|
b09365187c | ||
|
|
4895dc0948 | ||
|
|
c8ec93d515 | ||
|
|
8fd114afef | ||
|
|
95cafb8725 | ||
|
|
c1849f659e | ||
|
|
fefafd5a86 | ||
|
|
ae7ea1ad71 | ||
|
|
a72bbc5eaf | ||
|
|
02df886a2a | ||
|
|
d733cb8d17 | ||
|
|
3c5b093d55 | ||
|
|
0bc7e2bbe3 | ||
|
|
d5b34df650 | ||
|
|
57e3cb968a | ||
|
|
8248dc4fad | ||
|
|
7a23ece04b | ||
|
|
eaf6f8f338 | ||
|
|
872b2a9a54 | ||
|
|
94d1f5a28c | ||
|
|
7418ab20b5 | ||
|
|
03ac38ea44 | ||
|
|
05cc7af9b7 | ||
|
|
23f0806dfe | ||
|
|
b6eee38318 | ||
|
|
00d8d7bee9 | ||
|
|
94db179011 | ||
|
|
ed46989e06 | ||
|
|
828cfec4b8 | ||
|
|
5c8e904583 | ||
|
|
d68ef4d258 | ||
|
|
ec21cf3cab | ||
|
|
d71ac830c9 | ||
|
|
f68e1a4fd1 | ||
|
|
0a7054e442 | ||
|
|
7e048b1bd8 | ||
|
|
e5e9e4f98d | ||
|
|
b140760ec6 | ||
|
|
45f3d1aabb | ||
|
|
ec05a3e78e | ||
|
|
781bc97c35 | ||
|
|
a1ed5a1baf | ||
|
|
99c137b203 | ||
|
|
39e3c32e39 | ||
|
|
18b8c2f9cf | ||
|
|
12ac121b45 | ||
|
|
da8aaa406a | ||
|
|
8c340892ad | ||
|
|
e548a12e21 | ||
|
|
2eafbec945 | ||
|
|
42edb976e4 | ||
|
|
33838037f0 | ||
|
|
ee9258db51 | ||
|
|
75ecdc4d86 | ||
|
|
bd87d90121 | ||
|
|
be0e6b96e5 | ||
|
|
226e9b2788 | ||
|
|
5ae8824c48 | ||
|
|
9ca612087b | ||
|
|
c18aa57283 | ||
|
|
46862d824d | ||
|
|
195b3e87aa | ||
|
|
d0c530901a | ||
|
|
9dd7a24c73 | ||
|
|
32d579501c | ||
|
|
f1ba6fd2aa | ||
|
|
74267420f9 | ||
|
|
a21db2a06a | ||
|
|
e93cedacd4 | ||
|
|
a902f2fb1a | ||
|
|
0d3aaa90d6 | ||
|
|
1ff2f4c21b | ||
|
|
0ced42ecf1 | ||
|
|
f5265cb2ec | ||
|
|
e695e43582 | ||
|
|
d201a95e77 | ||
|
|
04dc91f276 | ||
|
|
68994151e6 | ||
|
|
8563ac53f7 | ||
|
|
ec4b371de0 | ||
|
|
d8c20bffd4 | ||
|
|
5867a1c01f | ||
|
|
cbef74aa58 | ||
|
|
90d61babf4 | ||
|
|
9c0051e397 | ||
|
|
f91282bec7 | ||
|
|
88df5a70cc | ||
|
|
2f9f424b1f | ||
|
|
6e3199cea2 | ||
|
|
5b002d10a2 | ||
|
|
0c386b52f0 | ||
|
|
169ff7bce3 | ||
|
|
c4f7bbdedd | ||
|
|
bd78907ac7 | ||
|
|
8c24e346a3 | ||
|
|
b4e422c5d7 | ||
|
|
b5bb48746b | ||
|
|
702013f98e | ||
|
|
ad1ab61a56 | ||
|
|
e77e5c383d | ||
|
|
0bbd8a1982 | ||
|
|
717b1a7f85 | ||
|
|
46583ed4cb | ||
|
|
eead8fcc89 | ||
|
|
ff2264b929 | ||
|
|
41e887549a | ||
|
|
39e3414801 | ||
|
|
24a7c1218c | ||
|
|
b66073e9f6 | ||
|
|
7c31377882 | ||
|
|
20da072d71 | ||
|
|
afab413640 | ||
|
|
00921bea82 | ||
|
|
dfab328086 | ||
|
|
449c3cd5ee | ||
|
|
b3949156e6 | ||
|
|
156919b712 | ||
|
|
b5c4d96d8d | ||
|
|
8c56b85de4 | ||
|
|
2e3a61dfe2 | ||
|
|
88be2dfe45 | ||
|
|
abe06efa38 | ||
|
|
421d147844 | ||
|
|
9d49dd0e2c | ||
|
|
92bf8259fd | ||
|
|
91804df24f | ||
|
|
55ffef386a | ||
|
|
998b950ebd | ||
|
|
7348b3487b | ||
|
|
0b27ebc66e | ||
|
|
bb73df72bc | ||
|
|
830d4267b2 | ||
|
|
5799f247e0 | ||
|
|
11c03be811 | ||
|
|
5216ddefcb | ||
|
|
64c034049c | ||
|
|
7c050d7d59 | ||
|
|
483cff53b2 | ||
|
|
65748fdea5 | ||
|
|
b3f47645eb | ||
|
|
0f2da3fdb5 | ||
|
|
9dcde4e293 | ||
|
|
d25b9fa7f8 | ||
|
|
cbb04a6c4b | ||
|
|
c4d020da61 | ||
|
|
dd72c6bce2 | ||
|
|
2cdc53c21a | ||
|
|
3c67faad74 | ||
|
|
e8f1e6e105 | ||
|
|
2c52dbe20c | ||
|
|
44fb05c2a0 | ||
|
|
3c55571ae8 |
@@ -1,33 +0,0 @@
|
||||
version: 2
|
||||
jobs:
|
||||
avx2:
|
||||
docker:
|
||||
- image: debian:stretch
|
||||
environment:
|
||||
- USE_SIMD: avx2,fma,f16c
|
||||
steps:
|
||||
- checkout
|
||||
- run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/circleci-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
avx512:
|
||||
docker:
|
||||
- image: debian:stretch
|
||||
environment:
|
||||
- USE_SIMD: avx512f,avx512dq,avx512cd,avx512bw,avx512vl,fma,f16c
|
||||
steps:
|
||||
- checkout
|
||||
- run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/circleci-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
# Kick off parallel jobs for each build configuration.
|
||||
all:
|
||||
jobs:
|
||||
- avx2
|
||||
- avx512
|
||||
+86
-77
@@ -2,26 +2,30 @@ Language: Cpp
|
||||
BasedOnStyle: WebKit
|
||||
SpaceBeforeParens: ControlStatements
|
||||
|
||||
#AccessModifierOffset: -4
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: true
|
||||
#AlignConsecutiveDeclarations: false
|
||||
#AlignEscapedNewlines: Right
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllArgumentsOnNextLine: true
|
||||
AllowAllConstructorInitializersOnNextLine: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
#AllowShortFunctionsOnASingleLine: All
|
||||
#AllowShortIfStatementsOnASingleLine: false
|
||||
#AllowShortLoopsOnASingleLine: false
|
||||
#AlwaysBreakAfterDefinitionReturnType: None
|
||||
AllowShortFunctionsOnASingleLine: All
|
||||
AllowShortLambdasOnASingleLine: All
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: TopLevel
|
||||
#AlwaysBreakBeforeMultilineStrings: false
|
||||
#AlwaysBreakTemplateDeclarations: MultiLine
|
||||
#BinPackArguments: true
|
||||
#BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: MultiLine
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
@@ -37,83 +41,88 @@ BraceWrapping:
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: false
|
||||
SplitEmptyNamespace: false
|
||||
#BreakBeforeBinaryOperators: All
|
||||
#BreakBeforeBraces: WebKit
|
||||
#BreakBeforeInheritanceComma: false
|
||||
#BreakInheritanceList: BeforeColon
|
||||
#BreakBeforeTernaryOperators: true
|
||||
#BreakConstructorInitializersBeforeComma: false
|
||||
#BreakConstructorInitializers: BeforeComma
|
||||
#BreakAfterJavaFieldAnnotations: false
|
||||
BreakBeforeBinaryOperators: All
|
||||
BreakBeforeBraces: WebKit
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: false
|
||||
ColumnLimit: 80
|
||||
#CommentPragmas: '^ IWYU pragma:'
|
||||
#CompactNamespaces: false
|
||||
#ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
#ConstructorInitializerIndentWidth: 4
|
||||
#ContinuationIndentWidth: 4
|
||||
#Cpp11BracedListStyle: false
|
||||
#DerivePointerAlignment: true
|
||||
#DisableFormat: false
|
||||
#ExperimentalAutoDetectBinPacking: false
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: true
|
||||
#ForEachMacros:
|
||||
# - foreach
|
||||
# - Q_FOREACH
|
||||
# - BOOST_FOREACH
|
||||
#IncludeBlocks: Preserve
|
||||
#IncludeCategories:
|
||||
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
# Priority: 2
|
||||
# - Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
# Priority: 3
|
||||
# - Regex: '.*'
|
||||
# Priority: 1
|
||||
#IncludeIsMainRegex: '(Test)?$'
|
||||
#IndentCaseLabels: false
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IndentCaseLabels: false
|
||||
IndentPPDirectives: AfterHash
|
||||
#IndentWidth: 4
|
||||
#IndentWrappedFunctionNames: false
|
||||
#JavaScriptQuotes: Leave
|
||||
#JavaScriptWrapImports: true
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
#MacroBlockBegin: ''
|
||||
#MacroBlockEnd: ''
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 3
|
||||
#NamespaceIndentation: Inner
|
||||
#ObjCBinPackProtocolList: Auto
|
||||
#ObjCBlockIndentWidth: 4
|
||||
#ObjCSpaceAfterProperty: true
|
||||
#ObjCSpaceBeforeProtocolList: true
|
||||
NamespaceIndentation: Inner
|
||||
ObjCBinPackProtocolList: Auto
|
||||
ObjCBlockIndentWidth: 4
|
||||
ObjCSpaceAfterProperty: true
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 40
|
||||
PenaltyBreakBeforeFirstCallParameter: 100
|
||||
#PenaltyBreakComment: 300
|
||||
#PenaltyBreakFirstLessLess: 120
|
||||
#PenaltyBreakString: 1000
|
||||
#PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
PenaltyExcessCharacter: 75
|
||||
PenaltyReturnTypeOnItsOwnLine: 50
|
||||
#PointerAlignment: Left
|
||||
PointerAlignment: Left
|
||||
ReflowComments: false
|
||||
#SortIncludes: true
|
||||
#SortUsingDeclarations: true
|
||||
#SpaceAfterCStyleCast: false
|
||||
SortIncludes: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
#SpaceBeforeAssignmentOperators: true
|
||||
#SpaceBeforeCpp11BracedList: true
|
||||
#SpaceBeforeCtorInitializerColon: true
|
||||
#SpaceBeforeInheritanceColon: true
|
||||
#SpaceBeforeParens: ControlStatements
|
||||
#SpaceBeforeRangeBasedForLoopColon: true
|
||||
#SpaceInEmptyParentheses: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyBlock: false
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
#SpacesInAngles: false
|
||||
#SpacesInContainerLiterals: true
|
||||
#SpacesInCStyleCastParentheses: false
|
||||
#SpacesInParentheses: false
|
||||
#SpacesInSquareBrackets: false
|
||||
#Standard: Cpp11
|
||||
#TabWidth: 8
|
||||
#UseTab: Never
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
StatementMacros:
|
||||
- Q_UNUSED
|
||||
- QT_REQUIRE_VERSION
|
||||
TabWidth: 8
|
||||
UseTab: Never
|
||||
#...
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<!--
|
||||
Please ask questions ("how do I...?") on the [oiio-dev](http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org) mail list, not by filing issues.
|
||||
|
||||
Make concrete suggestions for fixing the code ("here is a patch") by filing
|
||||
a pull request, not an issue.
|
||||
-->
|
||||
|
||||
### Problem
|
||||
|
||||
<!-- Describe the problem or suggestion here.] -->
|
||||
|
||||
**Expected behavior:** <!-- What you expected to happen -->
|
||||
|
||||
**Actual behavior:** <!-- What actually happened -->
|
||||
|
||||
<!-- If your problem is a broken build, please create a -->
|
||||
<!-- [gist](https://gist.github.com) that contains the _full_ verbose -->
|
||||
<!-- build log, which you can create like this: -->
|
||||
<!-- ```make clean ; make VERBOSE=1 > build.log``` -->
|
||||
|
||||
<!-- If you are reporting a problem about a release branch, have you -->
|
||||
<!-- already tried the current head of `master` to see if the problem -->
|
||||
<!-- has been fixed? -->
|
||||
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
1. [First Step]
|
||||
2. [Second Step]
|
||||
3. [and so on...]
|
||||
|
||||
|
||||
### Versions
|
||||
|
||||
* OIIO branch/version:
|
||||
* OS:
|
||||
* C++ compiler:
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: I think I have identified a legit bug and can describe it.
|
||||
title: "[BUG]"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is. What happened, and
|
||||
what did you expect to happen instead.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Do this...
|
||||
2. Then this...
|
||||
3. Then THIS happens (reproduce the exact error message if you can)
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Evidence**
|
||||
Do you have error messages? (please quote exacty) Screenshots? Example
|
||||
command lines or scripts that reliably reproduce the error? If it only
|
||||
happens with certain image files, can you attach the smallest image you
|
||||
can make that reproduces the problem?
|
||||
|
||||
**Platform information:**
|
||||
- OIIO branch/version:
|
||||
- OS:
|
||||
- C++ compiler:
|
||||
- Any non-default build flags when you build OIIO:
|
||||
|
||||
|
||||
**IF YOU ALREADY HAVE A CODE FIX:** There is no need to file a separate issue,
|
||||
please just go straight to making a [pull request](https://github.com/OpenImageIO/oiio/pulls).
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
name: Build problems
|
||||
about: I'm having trouble building OIIO. Help!
|
||||
title: "[BUILD]"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**PLEASE DO NOT REPORT BUILD TROUBLES AS ISSUES**
|
||||
|
||||
The best way to get help with your build problems is to ask a question on the
|
||||
[oiio-dev developer mail list](http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org).
|
||||
|
||||
When you email about this, please attach one or both of the following:
|
||||
1. The full verbose build log, which you can create like this:
|
||||
```make clean ; make VERBOSE=1 > build.log```
|
||||
2. The `CMakeCache.txt` file from your build directory.
|
||||
|
||||
If you are pretty sure that you have identified a **BUG** in the OpenImageIO
|
||||
build scripts, please file a [bug report issue](https://github.com/OpenImageIO/oiio/issues/new?template=bug_report.md).
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: I have a concrete idea about how to improve OpenImageIO.
|
||||
title: "[FEATURE REQUEST]"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the feature request here.
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Question
|
||||
about: How do I... I need help with...
|
||||
title: "[HELP]"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**PLEASE DO NOT ASK USAGE QUESTIONS USING GITHUB "ISSUES"**
|
||||
|
||||
If you are pretty sure that you have identified a **BUG** in OpenImageIO,
|
||||
please file a [bug report issue](https://github.com/OpenImageIO/oiio/issues/new?template=bug_report.md).
|
||||
|
||||
But if you are just asking a question:
|
||||
* How do I...?
|
||||
* I need help with...
|
||||
* Am I doing something wrong?
|
||||
* I can't build OpenImageIO
|
||||
|
||||
For anything of this nature, the best way to get help using OpenImageIO is
|
||||
to ask a question on the [oiio-dev developer mail list](http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org).
|
||||
|
||||
The [documentation](https://openimageio.readthedocs.org)
|
||||
is pretty comprehensive, so please check there first; you may find the answer
|
||||
more quickly than you can get your question answered on the mail list.
|
||||
|
||||
@@ -0,0 +1,434 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
# Skip jobs when only documentation files are changed
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '**.rst'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- '**.rst'
|
||||
schedule:
|
||||
# Full nightly build
|
||||
- cron: "0 4 * * *"
|
||||
|
||||
|
||||
jobs:
|
||||
linux-gcc48:
|
||||
name: "Linux 2017-ish: gcc4.8/C++11 py2.7 boost-1.66 exr-2.3"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2019
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: /usr/bin/g++
|
||||
CC: /usr/bin/gcc
|
||||
CMAKE_CXX_STANDARD: 11
|
||||
MY_CMAKE_FLAGS: -DBUILD_FMT_VERSION=6.2.1
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps-centos.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
vfxplatform-2019:
|
||||
name: "Linux VFX Platform 2019: gcc6/C++14 py2.7 boost-1.66 exr-2.3"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2019
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
USE_SIMD: sse4.2
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps-centos.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
vfxplatform-2020:
|
||||
name: "Linux VFX Platform 2020: gcc6/C++14 py3.7 boost-1.70 exr-2.4"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2020
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
PYTHON_VERSION: 3.7
|
||||
USE_SIMD: avx
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps-centos.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
vfxplatform-2021:
|
||||
# Test what's anticipated to be VFX Platform 2021 -- mainly, that means
|
||||
# gcc9 and C++17.
|
||||
name: "Linux VFX Platform 2021: gcc9/C++17 py3.7 boost-1.70 exr-2.5"
|
||||
runs-on: ubuntu-18.04
|
||||
container:
|
||||
image: aswf/ci-osl:2021
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
PYTHON_VERSION: 3.7
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: v2.5.0
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps-centos.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
linux-gcc7-cpp14-debug:
|
||||
# Test against gcc7, and also at the same time, do a Debug build.
|
||||
name: "Linux debug gcc7/C++14, sse4.2, exr2.4"
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: g++-7
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
USE_SIMD: sse4.2
|
||||
DEBUG: 1
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
linux-gcc8:
|
||||
# Test against gcc8.
|
||||
name: "Linux gcc8: gcc8 C++17 avx exr2.5"
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: g++-8
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
USE_SIMD: avx
|
||||
OPENEXR_VERSION: v2.5.0
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
linux-latest-releases:
|
||||
# Test against latest supported releases of toolchain and dependencies.
|
||||
name: "Linux latest releases: gcc10 C++17 avx2 exr2.5"
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: g++-10
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: v2.5.0
|
||||
PYBIND11_VERSION: v2.5.0
|
||||
LIBRAW_BRANCH: 0.20.0
|
||||
MY_CMAKE_FLAGS: -DBUILD_FMT_VERSION=7.0.1
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
linux-bleeding-edge:
|
||||
# Test against development master for relevant dependencies, latest
|
||||
# supported releases of everything else.
|
||||
# We don't need to run this on every push or PR -- only run on nightly
|
||||
# test, or if the branch name contains certain substring: gh, release,
|
||||
# bleeding.
|
||||
name: "Linux bleeding edge: gcc10 C++17 avx2 OCIO/libtiff/exr master"
|
||||
runs-on: ubuntu-18.04
|
||||
if: github.event_name == 'schedule' || contains(github.ref, 'release') || contains(github.ref, 'gh') || contains(github.ref, 'bleeding') || contains(github.ref, 'RB') || contains(github.ref, 'master')
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: g++-10
|
||||
CMAKE_CXX_STANDARD: 17
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: master
|
||||
OCIO_BRANCH: master
|
||||
LIBTIFF_BRANCH: master
|
||||
PYBIND11_VERSION: master
|
||||
LIBRAW_BRANCH: master
|
||||
MY_CMAKE_FLAGS: -DBUILD_FMT_VERSION=master
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
linux-oldest:
|
||||
# Oldest versions of the dependencies that we can muster, and various
|
||||
# things disabled (no SSE, OCIO, or OpenCV, don't embed plugins).
|
||||
# We don't need to run this on every push or PR -- only run on nightly
|
||||
# test, or if the branch name contains certain substrings: gh, release,
|
||||
# old.
|
||||
name: "Linux oldest/hobbled: gcc4.8/C++11 py2.7 boost-1.66 exr-2.2 no-sse no-ocio"
|
||||
if: github.event_name == 'schedule' || contains(github.ref, 'release') || contains(github.ref, 'gh') || contains(github.ref, 'RB') || contains(github.ref, 'master')
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-osl:2019
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: /usr/bin/g++
|
||||
CC: /usr/bin/gcc
|
||||
CMAKE_CXX_STANDARD: 11
|
||||
USE_SIMD: 0
|
||||
USE_JPEGTURBO: 0
|
||||
USE_OPENCOLORIO: 0
|
||||
USE_OPENCV: 0
|
||||
EMBEDPLUGINS: 0
|
||||
OPENEXR_VERSION: v2.2.0
|
||||
MY_CMAKE_FLAGS: -DBUILD_FMT_VERSION=6.1.2
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps-centos.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
macos-py37:
|
||||
name: "Mac py38"
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: clang++
|
||||
PYTHON_VERSION: 3.8
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
ENABLE_FIELD3D: OFF
|
||||
ENABLE_WEBP: OFF
|
||||
# ^^ webp seems broken on GH CI Mac. Investigate later.
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/install_homebrew_deps.bash
|
||||
pip3.8 install numpy
|
||||
src/build-scripts/install_test_images.bash
|
||||
export PYTHONPATH=/usr/local/lib/python3.8/site-packages:$PYTHONPATH
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
windows-vs2019:
|
||||
name: "Windows VS2019"
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup Nuget.exe
|
||||
uses: warrenbuckley/Setup-Nuget@v1
|
||||
- name: all
|
||||
shell: bash
|
||||
env:
|
||||
PYTHON_VERSION: 3.6
|
||||
CMAKE_GENERATOR: "Visual Studio 16 2019"
|
||||
OPENEXR_VERSION: v2.4.1
|
||||
SKIP_TESTS: 1
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-win-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
windows-vs2017:
|
||||
name: "Windows VS2017"
|
||||
runs-on: windows-2016
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup Nuget.exe
|
||||
uses: warrenbuckley/Setup-Nuget@v1
|
||||
- name: all
|
||||
shell: bash
|
||||
env:
|
||||
PYTHON_VERSION: 3.6
|
||||
CMAKE_GENERATOR: "Visual Studio 15 2017 Win64"
|
||||
OPENEXR_VERSION: v2.4.1
|
||||
SKIP_TESTS: 1
|
||||
#MY_CMAKE_FLAGS: -DUSE_PYTHON=0
|
||||
USE_NINJA: 0
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-win-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
sanitizer:
|
||||
# Run sanitizers. These don't need to run on every push. Just PRs, nightly
|
||||
# builds, or if the branch name contains one of several tokens: san,
|
||||
# gh, RB, release, or master.
|
||||
name: "Sanitizers"
|
||||
runs-on: ubuntu-18.04
|
||||
if: github.event_name == 'pull_request' || github.event_name == 'schedule' || contains(github.ref, 'san') || contains(github.ref, 'RB') || contains(github.ref, 'release') || contains(github.ref, 'master') || contains(github.ref, 'gh')
|
||||
container:
|
||||
image: aswf/ci-osl:2020
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
PYTHON_VERSION: 3.7
|
||||
USE_PYTHON: 0
|
||||
SANITIZE: address
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps-centos.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
linux-clang9:
|
||||
# Test compiling with clang9 on Linux.
|
||||
name: "Linux clang: clang9 C++14 avx2 exr2.4"
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: clang++
|
||||
LLVM_VERSION: 9.0.0
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
USE_SIMD: avx2,f16c
|
||||
OPENEXR_VERSION: v2.4.1
|
||||
OCIO_BRANCH: 1c624651b7
|
||||
# Pick an OCIO commit that includes a warning fix we need for clang
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
linux-static:
|
||||
# Test building static libs. We don't need to run this on every push --
|
||||
# only run on PRs, nightly test, or if the branch name contains
|
||||
# "gh", "master", "release", or "static".
|
||||
name: "Linux static libs: gcc7 C++14 exr2.4"
|
||||
if: github.event_name == 'pull_request' || github.event_name == 'schedule' || contains(github.ref, 'static') || contains(github.ref, 'release') || contains(github.ref, 'RB') || contains(github.ref, 'master') || contains(github.ref, 'gh')
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
CXX: g++-7
|
||||
CMAKE_CXX_STANDARD: 14
|
||||
BUILD_SHARED_LIBS: OFF
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: build/*/testsuite/*/*.*
|
||||
|
||||
clang-format:
|
||||
# Test formatting. This test entry doesn't do a full build, it just runs
|
||||
# clang-format on everything, and passes if nothing is misformatted.
|
||||
# Upon failure, the build artifact will be the full source code with the
|
||||
# formatting fixed (diffs will also appear in the console output).
|
||||
name: "clang-format verification"
|
||||
runs-on: ubuntu-18.04
|
||||
container:
|
||||
image: aswf/ci-osl:2021
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: all
|
||||
env:
|
||||
BUILDTARGET: clang-format
|
||||
PYTHON_VERSION: 3.7
|
||||
SKIP_TESTS: 1
|
||||
run: |
|
||||
source src/build-scripts/ci-startup.bash
|
||||
source src/build-scripts/gh-installdeps-centos.bash
|
||||
source src/build-scripts/ci-build-and-test.bash
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: src/*/*.{cpp,h}
|
||||
+3
-1
@@ -2,7 +2,9 @@
|
||||
branches/
|
||||
build/
|
||||
dist/
|
||||
ext/
|
||||
testsuite/runtest.pyc
|
||||
src/doc/figures/
|
||||
.cproject
|
||||
.project
|
||||
.DS_Store
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# .readthedocs.yml
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
# Build documentation in the docs/ directory with Sphinx
|
||||
sphinx:
|
||||
configuration: src/doc/conf.py
|
||||
|
||||
# Optionally build your docs in additional formats such as PDF and ePub
|
||||
formats:
|
||||
- pdf
|
||||
|
||||
|
||||
# Optionally set the version of Python and requirements required to build your docs
|
||||
python:
|
||||
version: 3.7
|
||||
install:
|
||||
- requirements: src/doc/requirements.txt
|
||||
+94
-171
@@ -1,3 +1,7 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
# .travis.yml for OIIO
|
||||
|
||||
language: cpp
|
||||
@@ -13,18 +17,16 @@ addons:
|
||||
apt:
|
||||
sources: &add-sources
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'ppa:jonathonf/ffmpeg-3'
|
||||
packages: &common-packages
|
||||
- libilmbase-dev
|
||||
- libopenexr-dev
|
||||
- libopencolorio-dev
|
||||
- libgif-dev
|
||||
- libopenjpeg-dev
|
||||
- libwebp-dev
|
||||
- libfreetype6-dev
|
||||
- libjpeg-turbo8-dev
|
||||
- dcmtk
|
||||
- libavcodec-dev
|
||||
- libavformat-dev
|
||||
- libswscale-dev
|
||||
- libavutil-dev
|
||||
- locales
|
||||
- python-numpy
|
||||
- libraw-dev
|
||||
@@ -40,6 +42,12 @@ addons:
|
||||
- libboost-regex1.58
|
||||
- libboost-system1.58
|
||||
- libboost-thread1.58
|
||||
packages: &old-boost-packages
|
||||
- libboost1.55-dev
|
||||
- libboost-filesystem1.55
|
||||
- libboost-regex1.55
|
||||
- libboost-system1.55
|
||||
- libboost-thread1.55
|
||||
|
||||
cache:
|
||||
ccache: true
|
||||
@@ -55,18 +63,19 @@ before_install:
|
||||
- if [ "$CXX" == "g++" ]; then export CXX="g++-${WHICHGCC}" ; fi
|
||||
|
||||
install:
|
||||
- if [ $TRAVIS_OS_NAME == osx ] ; then
|
||||
source src/build-scripts/install_homebrew_deps.bash ;
|
||||
elif [ $TRAVIS_OS_NAME == linux ] ; then
|
||||
CXX="ccache $CXX" source src/build-scripts/build_openexr.bash ;
|
||||
CXX="ccache $CXX" source src/build-scripts/build_ocio.bash ;
|
||||
fi
|
||||
- if [[ $TRAVIS_OS_NAME == osx ]] ; then source src/build-scripts/install_homebrew_deps.bash ; fi
|
||||
- if [[ "$BUILD_CMAKE" == "1" ]] ; then source src/build-scripts/build_cmake.bash ; fi
|
||||
- if [[ "$OPENEXR_VERSION" || "$OPENEXR_BRANCH" ]] ; then CXX="ccache $CXX" source src/build-scripts/build_openexr.bash ; fi
|
||||
- if [[ "$OCIO_VERSION" || "$OCIO_BRANCH" ]] ; then CXX="ccache $CXX" source src/build-scripts/build_ocio.bash ; fi
|
||||
- if [[ $TRAVIS_OS_NAME == linux ]] ; then source src/build-scripts/build_pybind11.bash ; fi
|
||||
- src/build-scripts/install_test_images.bash
|
||||
|
||||
# before_script:
|
||||
|
||||
script:
|
||||
- src/build-scripts/ci-build-and-test.bash
|
||||
- export LD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$LD_LIBRARY_PATH
|
||||
- export DYLD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$DYLD_LIBRARY_PATH
|
||||
- source src/build-scripts/ci-build-and-test.bash
|
||||
|
||||
|
||||
|
||||
@@ -76,113 +85,37 @@ branches:
|
||||
- /RB-/
|
||||
- /lg-/
|
||||
|
||||
matrix:
|
||||
jobs:
|
||||
fast_finish: true
|
||||
exclude:
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
- os: linux
|
||||
compiler: clang
|
||||
|
||||
allow_failures:
|
||||
- name: "Linux ARM64"
|
||||
include:
|
||||
# test default compile: C++11, optimized, default compilers, SSE2
|
||||
- name: "VFX Platform 2017 (gcc48, py27, exr2.2)"
|
||||
os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
env: WHICHGCC=4.8 EXRBRANCH=v2.2.0
|
||||
addons:
|
||||
apt:
|
||||
sources: *add-sources
|
||||
packages:
|
||||
- *common-packages
|
||||
- g++-4.8
|
||||
- libboost1.55-dev
|
||||
- libboost-filesystem1.55
|
||||
- libboost-regex1.55
|
||||
- libboost-system1.55
|
||||
- libboost-thread1.55
|
||||
# - name: "VFX Platform 2017 (gcc48, py27, exr2.2)"
|
||||
# os: linux
|
||||
# dist: trusty
|
||||
# compiler: gcc
|
||||
# env: WHICHGCC=4.8 OPENEXR_BRANCH=v2.2.0 BUILD_CMAKE=1
|
||||
# addons:
|
||||
# apt:
|
||||
# sources: *add-sources
|
||||
# packages:
|
||||
# - *common-packages
|
||||
# - *old-boost-packages
|
||||
# - g++-4.8
|
||||
|
||||
- name: "Mac (latest clang, py37)"
|
||||
os: osx
|
||||
compiler: clang
|
||||
env: PYTHON_VERSION=3.7
|
||||
# - name: "Mac (latest clang, py37)"
|
||||
# os: osx
|
||||
# compiler: clang
|
||||
# env: PYTHON_VERSION=3.7
|
||||
# Make sure Python 2.7 still works on OSX, but only for PRs, master/RB
|
||||
# pushes, or if the branch name includes "python".
|
||||
- name: "Mac py27 (latest clang)"
|
||||
os: osx
|
||||
compiler: clang
|
||||
env: PYTHON_VERSION=2.7
|
||||
if: branch =~ /(master|RB|travis|python)/ OR type = pull_request
|
||||
# test debug build with default compiler
|
||||
- name: "Linux DEBUG"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
env: DEBUG=1 WHICHGCC=6 USE_CPP=14 USE_SIMD=sse4.2 EXRBRANCH=v2.2.0
|
||||
addons:
|
||||
apt:
|
||||
sources: *add-sources
|
||||
packages:
|
||||
- *common-packages
|
||||
- *common-boost-packages
|
||||
- g++-6
|
||||
# - os: osx
|
||||
# - name: "Mac py27 (latest clang)"
|
||||
# os: osx
|
||||
# compiler: clang
|
||||
# env: DEBUG=1
|
||||
# test with C++14, gcc 6, SSE 4.2
|
||||
- name: "VFX Platform 2018 (gcc6, cpp14, exr2.2), sse4.2"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
env: WHICHGCC=6 USE_CPP=14 USE_SIMD=sse4.2 EXRBRANCH=v2.2.0
|
||||
addons:
|
||||
apt:
|
||||
sources: *add-sources
|
||||
packages:
|
||||
- *common-packages
|
||||
- *common-boost-packages
|
||||
- g++-6
|
||||
# test with C++14, gcc 7, latest SIMD flags supported by TravisCI VMs
|
||||
- name: "gcc7, cpp14, avx, exr2.3"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
env: WHICHGCC=7 USE_CPP=14 USE_SIMD=avx,f16c
|
||||
addons:
|
||||
apt:
|
||||
sources: *add-sources
|
||||
packages:
|
||||
- *common-packages
|
||||
- *common-boost-packages
|
||||
- g++-7
|
||||
# Test LINKSTATIC on both platforms. This is incomplete and to make it
|
||||
# work we still need to disable a bunch of specific plugins.
|
||||
# FIXME: Don't have LINKSTATIC working on Travis for Linux, it's
|
||||
# complaining about PIC issues.
|
||||
# - os: linux
|
||||
# compiler: gcc
|
||||
# env: LINKSTATIC=1 USE_FFMPEG=0 USE_OCIO=0 USE_OPENCV=0 MY_CMAKE_FLAGS="-DUSE_fPIC=1"
|
||||
##### TEMPORARILY DISABLED -- Travis upgraded some packages and this
|
||||
## is having link errors. Look into fixing this later.
|
||||
## - os: osx
|
||||
## osx_image: xcode8.3
|
||||
## compiler: clang
|
||||
## env: LINKSTATIC=1 USE_FFMPEG=0 USE_OCIO=0 USE_OPENCV=0
|
||||
# Dynamic analysis: build with sanitizers and run most tests.
|
||||
# Because this test takes so long to run, only build for PRs, direct
|
||||
# pushes to master or RB branches, or if the branch name includes
|
||||
# "sanitize". Other ordinary work branch pushes don't need to run this
|
||||
# every time.
|
||||
- name: "Sanitizers"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
env: WHICHGCC=6 SANITIZE=address USE_PYTHON=0
|
||||
if: branch =~ /(master|RB|travis|san)/ OR type = pull_request
|
||||
addons:
|
||||
apt:
|
||||
sources: *add-sources
|
||||
packages:
|
||||
- *common-packages
|
||||
- *common-boost-packages
|
||||
- g++-6
|
||||
# env: PYTHON_VERSION=2.7
|
||||
# # if: branch =~ /(master|RB|travis|python)/ OR type = pull_request
|
||||
|
||||
# One more, just for the heck of it, turn all SIMD off, and also make
|
||||
# sure we're falling back on libjpeg, not jpeg-turbo, no OCIO support,
|
||||
# and don't embed the plugins (to make sure that doesn't rust away). I
|
||||
@@ -191,67 +124,57 @@ matrix:
|
||||
# Only build this case for PRs, direct pushes to master or RB branches,
|
||||
# or if the branch name includes "simd". Other ordinary work branch
|
||||
# pushes don't need to run this.
|
||||
- name: "Oldest everything: gcc4.8, boost 1.55, no simd, no jpegturbo, no OCIO, dso plugins, exr2.2"
|
||||
os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
env: WHICHGCC=4.8 USE_SIMD=0 USE_JPEGTURBO=0 USE_OCIO=0 EMBEDPLUGINS=0 EXRBRANCH=v2.2.0
|
||||
if: branch =~ /(master|RB|travis|simd)/ OR type = pull_request
|
||||
addons:
|
||||
apt:
|
||||
sources: *add-sources
|
||||
packages:
|
||||
- *common-packages
|
||||
- g++-4.8
|
||||
- libboost1.55-dev
|
||||
- libboost-filesystem1.55
|
||||
- libboost-regex1.55
|
||||
- libboost-system1.55
|
||||
- libboost-thread1.55
|
||||
# test with C++14, gcc 8, latest SIMD flags supported by TravisCI VMs
|
||||
# Since VFXPlatform doesn't bless gcc8 yet, only build this
|
||||
# case for PRs, direct pushes to master or RB branches, or if the branch
|
||||
# name includes "gcc". Other ordinary work branch pushes don't
|
||||
# need to run this.
|
||||
- name: "Linux gcc8 cpp14 avx"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
env: WHICHGCC=8 USE_CPP=14 USE_SIMD=avx,f16c
|
||||
addons:
|
||||
apt:
|
||||
sources: *add-sources
|
||||
packages:
|
||||
- *common-packages
|
||||
- *common-boost-packages
|
||||
- g++-8
|
||||
if: branch =~ /(master|RB|travis|gcc)/ OR type = pull_request
|
||||
# test with C++17, gcc 8, latest SIMD flags supported by TravisCI VMs.
|
||||
# Since VFXPlatform doesn't bless C++17 or gcc8 yet, only build this
|
||||
# case for PRs, direct pushes to master or RB branches, or if the branch
|
||||
# name includes "17" or "gcc". Other ordinary work branch pushes don't
|
||||
# need to run this.
|
||||
- name: "Linux most advanced (gcc9, cpp17, avx/f16c)"
|
||||
os: linux
|
||||
compiler: gcc
|
||||
sudo: required
|
||||
env: WHICHGCC=9 USE_CPP=17 USE_SIMD=avx,f16c
|
||||
addons:
|
||||
apt:
|
||||
sources: *add-sources
|
||||
packages:
|
||||
- *common-packages
|
||||
- *common-boost-packages
|
||||
- g++-9
|
||||
if: branch =~ /(master|RB|travis|gcc|17)/ OR type = pull_request
|
||||
# - name: "Oldest everything: gcc4.8, boost 1.55, no simd, no jpegturbo, no OCIO, dso plugins, exr2.2"
|
||||
# os: linux
|
||||
# dist: trusty
|
||||
# compiler: gcc
|
||||
# env: WHICHGCC=4.8 USE_SIMD=0 USE_JPEGTURBO=0 USE_OPENCOLORIO=0 EMBEDPLUGINS=0 OPENEXR_BRANCH=v2.2.0 BUILD_CMAKE=1
|
||||
# # if: branch =~ /(master|RB|travis|simd)/ OR type = pull_request
|
||||
# addons:
|
||||
# apt:
|
||||
# sources: *add-sources
|
||||
# packages:
|
||||
# - *common-packages
|
||||
# - *old-boost-packages
|
||||
# - g++-4.8
|
||||
|
||||
# Note: builds for AVX2, AVX512 happen on CircleCI
|
||||
# test ARM64 architecture
|
||||
- name: "Linux ARM64"
|
||||
os: linux
|
||||
arch: arm64
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
env: WHICHGCC=7 BUILD_CMAKE=1
|
||||
addons:
|
||||
apt:
|
||||
#sources: *add-sources
|
||||
packages:
|
||||
- libuv1
|
||||
- rhash
|
||||
- libstdc++6
|
||||
- libboost-all-dev
|
||||
- libtiff-dev
|
||||
- libilmbase-dev
|
||||
- libopenexr-dev
|
||||
- libjpeg-turbo8-dev
|
||||
- libgif-dev
|
||||
- libopencolorio-dev
|
||||
#- libopenjpeg-dev
|
||||
- libwebp-dev
|
||||
- libheif-dev
|
||||
#- libfreetype6-dev
|
||||
#- libjpeg-turbo8-dev
|
||||
- libdcmtk-dev
|
||||
#- locales
|
||||
#- python-numpy
|
||||
- libraw-dev
|
||||
- ninja-build
|
||||
- python3
|
||||
- libpython3-dev
|
||||
- libopenvdb-dev
|
||||
- libsquish-dev
|
||||
- qt5-default
|
||||
|
||||
# Just run clang-format, this test only checks formatting rule conformance
|
||||
- name: "clang-format format verification"
|
||||
os: osx
|
||||
compiler: clang
|
||||
env: BUILDTARGET=clang-format SKIP_TESTS=1 BUILD_MISSING_DEPS=0
|
||||
#if: branch =~ /(master|RB|travis|simd)/ OR type = pull_request
|
||||
# Static analysis: build with clang-tidy.
|
||||
# Disabled -- this takes so long to run, it can't complete in Travis's
|
||||
# 50 minute time limit. Left here just to show how it should work.
|
||||
|
||||
+961
-33
File diff suppressed because it is too large
Load Diff
+237
-207
@@ -1,47 +1,54 @@
|
||||
cmake_minimum_required (VERSION 3.2.2)
|
||||
cmake_policy (SET CMP0048 NEW) # Allow VERSION specifier in project()
|
||||
project (OpenImageIO
|
||||
VERSION 2.1.2
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
cmake_minimum_required (VERSION 3.12)
|
||||
project (OpenImageIO VERSION 2.2.5.0
|
||||
HOMEPAGE_URL "https://openimageio.org"
|
||||
LANGUAGES CXX C)
|
||||
set (PROJ_NAME OIIO) # short name, caps
|
||||
string (TOLOWER ${PROJ_NAME} PROJ_NAME_LOWER) # short name lower case
|
||||
set (PROJECT_VERSION_RELEASE_TYPE "dev") # "dev", "betaX", "RCY", ""
|
||||
string (TOUPPER ${PROJ_NAME} PROJ_NAME_UPPER) # short name upper case
|
||||
set (PROJECT_VERSION_RELEASE_TYPE "beta2") # "dev", "betaX", "RCY", ""
|
||||
set (${PROJECT_NAME}_VERSION_RELEASE_TYPE ${PROJECT_VERSION_RELEASE_TYPE})
|
||||
set (PROJECT_AUTHORS "Contributors to the OpenImageIO project")
|
||||
set (PROJECT_URL "http://openimageio.org")
|
||||
set (${PROJECT_NAME}_SUPPORTED_RELEASE 1) # Change to 1 after release branch
|
||||
|
||||
# If the user wants to use Conan to build dependencies, they will have done
|
||||
# this prior to the cmake config:
|
||||
# cd <build area>
|
||||
# conan install <source area>
|
||||
# and that will leave a conanbuildinfo.cmake in the build area for us.
|
||||
if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
include (${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
message (STATUS "Using Conan for dependencies")
|
||||
conan_basic_setup()
|
||||
endif()
|
||||
|
||||
message (STATUS "Building ${PROJECT_NAME} ${PROJECT_VERSION}")
|
||||
message (STATUS "CMake version is ${CMAKE_VERSION}")
|
||||
cmake_policy (SET CMP0017 NEW) # Prefer files from the CMake module directory when including from there.
|
||||
cmake_policy (SET CMP0025 NEW) # Detect AppleClang for new CMake
|
||||
cmake_policy (SET CMP0046 OLD) # Don't error on non-existent dependency in add_dependencies.
|
||||
set (CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
||||
|
||||
# Alternate names
|
||||
set (OIIO_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
||||
set (OIIO_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
||||
set (OIIO_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
||||
set (OIIO_VERSION_RELEASE_TYPE ${PROJECT_VERSION_RELEASE_TYPE})
|
||||
|
||||
# N.B./FIXME - after CMake 3.0 is our minimum, we should change many of the
|
||||
# add_definitions to add_compile_options. In newer cmake versions, the
|
||||
# former is designated for definitions (-Dblah) and the latter is for
|
||||
# compile flags (-Wno-foo).
|
||||
|
||||
if (VERBOSE)
|
||||
message (STATUS "Project source dir = ${PROJECT_SOURCE_DIR}")
|
||||
endif ()
|
||||
message (STATUS "Project build dir = ${CMAKE_BINARY_DIR}")
|
||||
message (STATUS "Project install dir = ${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
message (FATAL_ERROR "Not allowed to run in-source build!")
|
||||
endif ()
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set (CMAKE_BUILD_TYPE "Release")
|
||||
endif ()
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set (DEBUGMODE ON)
|
||||
|
||||
message (STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}")
|
||||
message (STATUS "CMake ${CMAKE_VERSION}")
|
||||
message (STATUS "CMake system = ${CMAKE_SYSTEM}")
|
||||
message (STATUS "CMake system name = ${CMAKE_SYSTEM_NAME}")
|
||||
message (STATUS "Project source dir = ${PROJECT_SOURCE_DIR}")
|
||||
message (STATUS "Project build dir = ${CMAKE_BINARY_DIR}")
|
||||
message (STATUS "Project install prefix = ${CMAKE_INSTALL_PREFIX}")
|
||||
message (STATUS "Configuration types = ${CMAKE_CONFIGURATION_TYPES}")
|
||||
message (STATUS "Build type = ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
# Make the build area layout look a bit more like the final dist layout
|
||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||
message (FATAL_ERROR "Not allowed to run in-source build!")
|
||||
endif ()
|
||||
|
||||
option (CMAKE_USE_FOLDERS "Use the FOLDER target property to organize targets into folders." ON)
|
||||
@@ -50,64 +57,10 @@ if (CMAKE_USE_FOLDERS)
|
||||
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
endif ()
|
||||
|
||||
include (GNUInstallDirs)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH
|
||||
"${PROJECT_SOURCE_DIR}/src/cmake/modules"
|
||||
"${PROJECT_SOURCE_DIR}/src/cmake")
|
||||
|
||||
include (oiio_macros)
|
||||
include (platform)
|
||||
include (compiler) # All the C++ and compiler related options live here
|
||||
|
||||
|
||||
option (VERBOSE "Print lots of messages while compiling" OFF)
|
||||
set (${PROJ_NAME}_NAMESPACE ${PROJECT_NAME} CACHE STRING
|
||||
"Customized outer namespace base name (version will be added)")
|
||||
option (EMBEDPLUGINS "Embed format plugins in libOpenImageIO" ON)
|
||||
option (OIIO_BUILD_TOOLS "Build the command-line tools" ON)
|
||||
option (OIIO_BUILD_TESTS "Build the unit tests" ON)
|
||||
option (USE_OPENGL "Include OpenGL support" ON)
|
||||
option (USE_QT "Include Qt support" ON)
|
||||
option (USE_PYTHON "Build the Python bindings" ON)
|
||||
if (NOT "$ENV{OIIO_PYTHON_VERSION}" STREQUAL "")
|
||||
set (PYTHON_VERSION "$ENV{OIIO_PYTHON_VERSION}" CACHE STRING "Target version of python to find")
|
||||
else()
|
||||
set (PYTHON_VERSION "2.7" CACHE STRING "Target version of python to find")
|
||||
endif()
|
||||
option (PYLIB_INCLUDE_SONAME "If ON, soname/soversion will be set for Python module library" OFF)
|
||||
option (PYLIB_LIB_PREFIX "If ON, prefix the Python module with 'lib'" OFF)
|
||||
set (PYMODULE_SUFFIX "" CACHE STRING "Suffix to add to Python module init namespace")
|
||||
option (USE_FIELD3D "Use Field3D if found" ON)
|
||||
option (USE_OPENVDB "Use OpenVDB if found" ON)
|
||||
set (OPENVDB_ROOT_DIR "" CACHE STRING "Custom OpenVDB path")
|
||||
option (USE_TBB "Use Intel TBB if found" ON)
|
||||
set (TBB_ROOT_DIR "" CACHE STRING "Custom Intel TBB path")
|
||||
option (USE_FFMPEG "Use FFmpeg if found" ON)
|
||||
set (JPEG_PATH "" CACHE STRING "Custom JPEG path")
|
||||
option (USE_JPEGTURBO "Use JPEG-Turbo if found" ON)
|
||||
set (JPEGTURBO_PATH "" CACHE STRING "Custom JPEG-Turbo path")
|
||||
option (USE_OPENJPEG "Use OpenJpeg if found" ON)
|
||||
option (USE_OCIO "Use OpenColorIO for color management if found" ON)
|
||||
option (USE_OPENCV "Use OpenCV if found" ON)
|
||||
option (USE_FREETYPE "Use Freetype if found" ON)
|
||||
option (USE_GIF "Use GIF if found" ON)
|
||||
option (USE_PTEX "Use PTex if found" ON)
|
||||
option (USE_WEBP "Use WebP if found" ON)
|
||||
option (USE_LIBRAW "Use LibRaw if found" ON)
|
||||
set (LIBRAW_PATH "" CACHE STRING "Custom LibRaw path")
|
||||
option (OIIO_THREAD_ALLOW_DCLP "OIIO threads may use DCLP for speed" ON)
|
||||
option (USE_NUKE "Build Nuke plugins, if Nuke is found" ON)
|
||||
set (Nuke_ROOT "" CACHE STRING "Where to find Nuke installation")
|
||||
set (NUKE_VERSION 7.0)
|
||||
set (USE_EXTERNAL_PUGIXML OFF CACHE BOOL
|
||||
"Use an externally built shared library version of the pugixml library")
|
||||
set (PUGIXML_HOME "" CACHE STRING "Hint about where to find external PugiXML library")
|
||||
option (USE_DICOM "Use DICOM if DCMTK is found" ON)
|
||||
option (USE_HEIF "Support HEIC/HEIF files, if libheif is found)" ON)
|
||||
set (TEX_BATCH_SIZE "" CACHE STRING "Force TextureSystem SIMD batch size (e.g. 16)")
|
||||
set (SOVERSION ${OIIO_VERSION_MAJOR}.${OIIO_VERSION_MINOR}
|
||||
CACHE STRING "Set the SO version in the SO name of the output library")
|
||||
option (${PROJ_NAME}_BUILD_TOOLS "Build the command-line tools" ON)
|
||||
option (${PROJ_NAME}_BUILD_TESTS "Build the unit tests" ON)
|
||||
set (OIIO_LIBNAME_SUFFIX "" CACHE STRING
|
||||
"Optional name appended to ${PROJECT_NAME} libraries that are built")
|
||||
option (BUILD_OIIOUTIL_ONLY "If ON, will build *only* libOpenImageIO_Util" OFF)
|
||||
@@ -115,42 +68,68 @@ option (BUILD_DOCS "If ON, build documentation and man pages." ON)
|
||||
option (INSTALL_DOCS "If ON, install documentation and man pages." ON)
|
||||
option (INSTALL_FONTS "If ON, install default fonts" ON)
|
||||
option (INSTALL_CMAKE_HELPER "If On, install FindOpenImageIO.cmake" ON)
|
||||
option (EMBEDPLUGINS "Embed format plugins in libOpenImageIO" ON)
|
||||
set (PLUGIN_SEARCH_PATH "" CACHE STRING "Default plugin search path")
|
||||
file (TO_NATIVE_PATH "${PLUGIN_SEARCH_PATH}" PLUGIN_SEARCH_PATH_NATIVE)
|
||||
set (CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library naming postfix for Debug builds (e.g., '_debug')")
|
||||
|
||||
set(OIIO_TESTSUITE_IMAGEDIR "${PROJECT_SOURCE_DIR}/.." CACHE STRING
|
||||
set(OIIO_TESTSUITE_IMAGEDIR "${PROJECT_SOURCE_DIR}/.." CACHE PATH
|
||||
"Location of oiio-images, openexr-images, libtiffpic, etc.." )
|
||||
|
||||
option (OIIO_THREAD_ALLOW_DCLP "OIIO threads may use DCLP for speed" ON)
|
||||
if (NOT OIIO_THREAD_ALLOW_DCLP)
|
||||
add_definitions ("-DOIIO_THREAD_ALLOW_DCLP=0")
|
||||
endif ()
|
||||
|
||||
set (TEX_BATCH_SIZE "" CACHE STRING "Force TextureSystem SIMD batch size (e.g. 16)")
|
||||
if (TEX_BATCH_SIZE)
|
||||
add_definitions ("-DOIIO_TEXTURE_SIMD_BATCH_WIDTH=${TEX_BATCH_SIZE}")
|
||||
endif ()
|
||||
|
||||
# Set the default namespace
|
||||
set (${PROJ_NAME}_NAMESPACE ${PROJECT_NAME} CACHE STRING
|
||||
"Customized outer namespace base name (version will be added)")
|
||||
option (${PROJ_NAME}_NAMESPACE_INCLUDE_PATCH "Should the inner namespace include the patch number" OFF)
|
||||
set (PROJ_NAMESPACE "${${PROJ_NAME}_NAMESPACE}")
|
||||
set (PROJ_NAMESPACE_V "${PROJ_NAMESPACE}_v${PROJECT_VERSION_MAJOR}_${PROJECT_VERSION_MINOR}")
|
||||
if (OIIO_NAMESPACE_INCLUDE_PATCH)
|
||||
set (PROJ_NAMESPACE_V "${PROJ_NAMESPACE_V}_${PROJECT_VERSION_PATCH}")
|
||||
endif ()
|
||||
message(STATUS "Setting Namespace to: ${PROJ_NAMESPACE_V}")
|
||||
|
||||
|
||||
list (APPEND CMAKE_MODULE_PATH
|
||||
"${PROJECT_SOURCE_DIR}/src/cmake/modules"
|
||||
"${PROJECT_SOURCE_DIR}/src/cmake")
|
||||
|
||||
include (GNUInstallDirs)
|
||||
|
||||
include (colors)
|
||||
include (check_is_enabled)
|
||||
|
||||
# All the C++ and compiler related options and adjustments live here
|
||||
include (compiler)
|
||||
|
||||
include (oiio_macros)
|
||||
|
||||
# All the dependency finding and options are here
|
||||
include (externalpackages)
|
||||
include (install)
|
||||
|
||||
# Utilities related to finding python and making python bindings
|
||||
include (pythonutils)
|
||||
|
||||
# We want CTest for testing, so this must be added before all the calls to
|
||||
# add_subdirectory, or their add_test commands will not register.
|
||||
include (CTest)
|
||||
|
||||
|
||||
include_directories (
|
||||
BEFORE
|
||||
"${CMAKE_SOURCE_DIR}/src/include"
|
||||
"${CMAKE_BINARY_DIR}/src/include"
|
||||
"${CMAKE_BINARY_DIR}/include"
|
||||
)
|
||||
|
||||
|
||||
|
||||
# We want CTest for testing
|
||||
# N.B. This needs to be added before any of the subdirectories, or
|
||||
# their add_test commands will not register.
|
||||
include (CTest)
|
||||
|
||||
|
||||
# Tell CMake to process the sub-directories
|
||||
add_subdirectory (src/libutil)
|
||||
|
||||
@@ -185,14 +164,14 @@ if (NOT BUILD_OIIOUTIL_ONLY)
|
||||
endif ()
|
||||
|
||||
if (OIIO_BUILD_TOOLS AND NOT BUILD_OIIOUTIL_ONLY)
|
||||
add_subdirectory (src/iconvert)
|
||||
add_subdirectory (src/idiff)
|
||||
add_subdirectory (src/igrep)
|
||||
add_subdirectory (src/iinfo)
|
||||
add_subdirectory (src/maketx)
|
||||
add_subdirectory (src/oiiotool)
|
||||
add_subdirectory (src/testtex)
|
||||
add_subdirectory (src/iv)
|
||||
add_subdirectory (src/iconvert)
|
||||
add_subdirectory (src/idiff)
|
||||
add_subdirectory (src/igrep)
|
||||
add_subdirectory (src/iinfo)
|
||||
add_subdirectory (src/maketx)
|
||||
add_subdirectory (src/oiiotool)
|
||||
add_subdirectory (src/testtex)
|
||||
add_subdirectory (src/iv)
|
||||
endif ()
|
||||
|
||||
# Add IO plugin directories -- if we are not embedding plugins, we need to
|
||||
@@ -205,7 +184,6 @@ if (NOT EMBEDPLUGINS AND NOT BUILD_OIIOUTIL_ONLY)
|
||||
endif ()
|
||||
|
||||
if (USE_PYTHON AND NOT BUILD_OIIOUTIL_ONLY)
|
||||
find_or_download_pybind11 ()
|
||||
add_subdirectory (src/python)
|
||||
endif ()
|
||||
|
||||
@@ -214,11 +192,20 @@ if (BUILD_DOCS)
|
||||
add_subdirectory (src/doc)
|
||||
endif ()
|
||||
add_subdirectory (src/fonts)
|
||||
add_subdirectory (src/nuke)
|
||||
|
||||
if (NUKE_FOUND)
|
||||
add_subdirectory (src/nuke/txReader)
|
||||
add_subdirectory (src/nuke/txWriter)
|
||||
endif ()
|
||||
|
||||
# Last minute site-specific instructions, if they exist
|
||||
if (OIIO_SITE AND EXISTS "${PROJECT_SOURCE_DIR}/site/${OIIO_SITE}/cmake/sitecustom.cmake")
|
||||
include ("${PROJECT_SOURCE_DIR}/site/${OIIO_SITE}/cmake/sitecustom.cmake")
|
||||
endif ()
|
||||
|
||||
# install pkgconfig file
|
||||
IF ( NOT WIN32 )
|
||||
configure_file(src/build-scripts/OpenImageIO.pc.in "${CMAKE_BINARY_DIR}/OpenImageIO.pc" @ONLY)
|
||||
IF ( NOT MSVC )
|
||||
configure_file(src/build-scripts/OpenImageIO.pc.in "${CMAKE_BINARY_DIR}/OpenImageIO.pc" @ONLY)
|
||||
install (FILES "${CMAKE_BINARY_DIR}/OpenImageIO.pc"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||
COMPONENT developer)
|
||||
@@ -229,6 +216,44 @@ install (FILES src/cmake/modules/FindOpenImageIO.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/Modules
|
||||
COMPONENT cmake)
|
||||
|
||||
# Export the configuration files. There are also library-specific config
|
||||
# exports in the CMakeLists.txt of libOpenImageIO.
|
||||
include (CMakePackageConfigHelpers)
|
||||
|
||||
# the file containing the exported targets
|
||||
set (OIIO_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets.cmake")
|
||||
# the version file
|
||||
set (OIIO_VERSION_CONFIG "${CMAKE_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
|
||||
# the config file that is actually looked for by find_package
|
||||
set (OIIO_PROJECT_CONFIG "${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
|
||||
# where all these files will be installed
|
||||
set (OIIO_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
|
||||
|
||||
# first generate the version file in the binary dir
|
||||
write_basic_package_version_file (
|
||||
${OIIO_VERSION_CONFIG}
|
||||
VERSION ${PROJECT_VERSION}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
# generate the Targets file in the binary dir using the targets collected in
|
||||
# OIIO_EXPORTED_TARGETS each target is added to OIIO_EXPORTED_TARGETS
|
||||
# through the macro install_target().
|
||||
export (EXPORT OIIO_EXPORTED_TARGETS FILE "${CMAKE_BINARY_DIR}/${OIIO_TARGETS_EXPORT_NAME}")
|
||||
|
||||
# generate the config file from the template in the binary dir
|
||||
configure_package_config_file ("${PROJECT_SOURCE_DIR}/src/cmake/Config.cmake.in"
|
||||
"${OIIO_PROJECT_CONFIG}"
|
||||
INSTALL_DESTINATION "${OIIO_CONFIG_INSTALL_DIR}")
|
||||
|
||||
# generate the config file from the template in the binary dir
|
||||
install (FILES "${OIIO_PROJECT_CONFIG}" "${OIIO_VERSION_CONFIG}"
|
||||
DESTINATION "${OIIO_CONFIG_INSTALL_DIR}")
|
||||
|
||||
# install targets files
|
||||
install (EXPORT OIIO_EXPORTED_TARGETS
|
||||
DESTINATION ${OIIO_CONFIG_INSTALL_DIR}
|
||||
FILE ${OIIO_TARGETS_EXPORT_NAME}
|
||||
NAMESPACE ${PROJECT_NAME}::)
|
||||
|
||||
|
||||
#########################################################################
|
||||
@@ -252,23 +277,24 @@ install (FILES src/cmake/modules/FindOpenImageIO.cmake
|
||||
|
||||
# Make a build/platform/testsuite directory, and copy the master runtest.py
|
||||
# there. The rest is up to the tests themselves.
|
||||
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testsuite")
|
||||
add_custom_command (OUTPUT "${CMAKE_BINARY_DIR}/testsuite/runtest.py"
|
||||
file (MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/testsuite")
|
||||
file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/testsuite/common"
|
||||
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/testsuite")
|
||||
add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/testsuite/runtest.py"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMAKE_SOURCE_DIR}/testsuite/runtest.py"
|
||||
"${CMAKE_BINARY_DIR}/testsuite/runtest.py"
|
||||
MAIN_DEPENDENCY "${CMAKE_SOURCE_DIR}/testsuite/runtest.py")
|
||||
add_custom_target ( CopyFiles ALL DEPENDS "${CMAKE_BINARY_DIR}/testsuite/runtest.py" )
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/testsuite/runtest.py"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/testsuite/runtest.py"
|
||||
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/testsuite/runtest.py")
|
||||
add_custom_target ( CopyFiles ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/testsuite/runtest.py" )
|
||||
|
||||
# Basic tests that apply even to continuous integration tests:
|
||||
# Tests that require oiio-images:
|
||||
oiio_add_tests (gpsread
|
||||
oiiotool oiiotool-attribs oiiotool-readerror oiiotool-xform
|
||||
oiiotool oiiotool-attribs oiiotool-copy
|
||||
oiiotool-readerror oiiotool-xform
|
||||
oiiotool-fixnan ## maketx & oiiotool-maketx depend on this
|
||||
maketx oiiotool-maketx
|
||||
misnamed-file
|
||||
missingcolor
|
||||
dpx ico iff png psd rla sgi zfile
|
||||
texture-interp-bicubic
|
||||
texture-blurtube
|
||||
texture-crop texture-cropover
|
||||
@@ -281,25 +307,20 @@ oiio_add_tests (gpsread
|
||||
texture-fat texture-skinny texture-wrapfill
|
||||
texture-missing texture-res texture-maxres
|
||||
texture-udim texture-udim2
|
||||
IMAGEDIR oiio-images
|
||||
)
|
||||
|
||||
# Tests that require openexr-images:
|
||||
oiio_add_tests (oiiotool-deep
|
||||
IMAGEDIR openexr-images
|
||||
)
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images"
|
||||
)
|
||||
|
||||
# Remaining freestanding tests:
|
||||
oiio_add_tests (nonwhole-tiles
|
||||
oiiotool-composite oiiotool-copy
|
||||
oiiotool-composite
|
||||
oiiotool-pattern
|
||||
oiiotool-subimage oiiotool-text
|
||||
diff
|
||||
dither dup-channels
|
||||
jpeg-corrupt
|
||||
null psd-colormodes
|
||||
null
|
||||
rational
|
||||
)
|
||||
)
|
||||
|
||||
# Travis + old libjpeg seems to not catch an error in this test, skip it
|
||||
# for that case.
|
||||
@@ -315,96 +336,105 @@ endif()
|
||||
# We also exclude these tests if this is a sanitizer build on Linux,
|
||||
# because the Python interpreter itself won't be linked with the right asan
|
||||
# libraries to run correctly.
|
||||
if (USE_PYTHON AND NOT BUILD_OIIOUTIL_ONLY)
|
||||
if (NOT SANITIZE_ON_LINUX)
|
||||
oiio_add_tests (
|
||||
python-typedesc python-paramlist
|
||||
python-imagespec python-roi python-deep python-colorconfig
|
||||
python-imageinput python-imageoutput
|
||||
python-imagebuf python-imagebufalgo
|
||||
IMAGEDIR oiio-images
|
||||
if (USE_PYTHON AND NOT BUILD_OIIOUTIL_ONLY AND NOT SANITIZE_ON_LINUX)
|
||||
oiio_add_tests (
|
||||
python-typedesc python-paramlist
|
||||
python-imagespec python-roi python-deep python-colorconfig
|
||||
python-imageinput python-imageoutput
|
||||
python-imagebuf python-imagebufalgo
|
||||
IMAGEDIR oiio-images
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Add tests that require OCIO
|
||||
if (USE_OCIO AND OCIO_FOUND)
|
||||
oiio_add_tests (oiiotool-color)
|
||||
endif ()
|
||||
oiio_add_tests (oiiotool-color
|
||||
FOUNDVAR OPENCOLORIO_FOUND)
|
||||
|
||||
# Advanced tests that are done by hand and for releases:
|
||||
# FIXME -- at some point, try to fix these or provide new ref images
|
||||
if (NOT DEFINED ENV{TRAVIS})
|
||||
oiio_add_tests (
|
||||
texture-half texture-uint16
|
||||
texture-interp-bilinear
|
||||
texture-interp-closest
|
||||
texture-mip-onelevel
|
||||
)
|
||||
oiio_add_tests (
|
||||
texture-half texture-uint16
|
||||
texture-interp-bilinear
|
||||
texture-interp-closest
|
||||
texture-mip-onelevel
|
||||
)
|
||||
endif ()
|
||||
if (NOT DEFINED ENV{TRAVIS} AND NOT DEFINED ENV{CIRCLECI})
|
||||
oiio_add_tests (texture-icwrite )
|
||||
if (NOT DEFINED ENV{TRAVIS} AND NOT DEFINED ENV{CIRCLECI} AND NOT DEFINED ENV{GITHUB_ACTIONS})
|
||||
oiio_add_tests (texture-icwrite)
|
||||
endif ()
|
||||
|
||||
# List testsuites which need special external reference images from the web
|
||||
# here:
|
||||
# List testsuites for specific formats or features which might be not found
|
||||
# or be intentionally disabled, or which need special external reference
|
||||
# images from the web that if not found, should skip the tests:
|
||||
|
||||
oiio_add_tests (bmp
|
||||
IMAGEDIR bmpsuite
|
||||
URL http://entropymine.com/jason/bmpsuite/bmpsuite.zip)
|
||||
|
||||
oiio_add_tests (tiff-suite tiff-depths tiff-misc
|
||||
IMAGEDIR libtiffpic
|
||||
URL http://www.simplesystems.org/libtiff/images.html)
|
||||
|
||||
oiio_add_tests (openexr-suite openexr-multires openexr-chroma openexr-v2 perchannel
|
||||
IMAGEDIR openexr-images
|
||||
URL http://www.openexr.com/downloads.html)
|
||||
|
||||
oiio_add_tests (gif
|
||||
FOUNDVAR GIF_FOUND
|
||||
IMAGEDIR oiio-images
|
||||
URL "Recent checkout of oiio-images")
|
||||
|
||||
oiio_add_tests (jpeg2000
|
||||
FOUNDVAR OPENJPEG_FOUND
|
||||
IMAGEDIR j2kp4files_v1_5
|
||||
URL http://www.itu.int/net/ITU-T/sigdb/speimage/ImageForm-s.aspx?val=10100803)
|
||||
|
||||
oiio_add_tests (pnm
|
||||
IMAGEDIR oiio-images/pnm
|
||||
URL "Recent checkout of oiio-images")
|
||||
|
||||
oiio_add_tests (raw
|
||||
FOUNDVAR LIBRAW_FOUND
|
||||
IMAGEDIR oiio-images/raw
|
||||
URL "Recent checkout of oiio-images")
|
||||
|
||||
oiio_add_tests (targa-tgautils
|
||||
IMAGEDIR TGAUTILS
|
||||
URL http://tgautils.inequation.org/)
|
||||
|
||||
ENABLEVAR ENABLE_BMP
|
||||
IMAGEDIR bmpsuite
|
||||
URL http://entropymine.com/jason/bmpsuite/bmpsuite.zip)
|
||||
oiio_add_tests (dpx
|
||||
ENABLEVAR ENABLE_DPX
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (field3d texture-field3d
|
||||
FOUNDVAR Field3D_FOUND ENABLEVAR ENABLE_FIELD3D)
|
||||
oiio_add_tests (fits
|
||||
IMAGEDIR fits-images
|
||||
URL http://www.cv.nrao.edu/fits/data/tests/)
|
||||
|
||||
ENABLEVAR ENABLE_FITS
|
||||
IMAGEDIR fits-images
|
||||
URL http://www.cv.nrao.edu/fits/data/tests/)
|
||||
oiio_add_tests (gif
|
||||
FOUNDVAR GIF_FOUND ENABLEVAR ENABLE_GIF
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (heif
|
||||
FOUNDVAR LIBHEIF_FOUND
|
||||
URL https://github.com/nokiatech/heif/tree/gh-pages/content)
|
||||
|
||||
oiio_add_tests (webp
|
||||
FOUNDVAR WEBP_FOUND
|
||||
IMAGEDIR oiio-images/webp
|
||||
URL "Recent checkout of oiio-images")
|
||||
|
||||
oiio_add_tests (ptex
|
||||
FOUNDVAR PTEX_FOUND)
|
||||
|
||||
oiio_add_tests (texture-field3d field3d
|
||||
FOUNDVAR FIELD3D_FOUND)
|
||||
|
||||
|
||||
FOUNDVAR Libheif_FOUND ENABLEVAR ENABLE_Libheif
|
||||
URL https://github.com/nokiatech/heif/tree/gh-pages/content)
|
||||
oiio_add_tests (ico
|
||||
ENABLEVAR ENABLE_ICO
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (iff
|
||||
ENABLEVAR ENABLE_IFF
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (jpeg2000
|
||||
FOUNDVAR OPENJPEG_FOUND
|
||||
IMAGEDIR j2kp4files_v1_5
|
||||
URL http://www.itu.int/net/ITU-T/sigdb/speimage/ImageForm-s.aspx?val=10100803)
|
||||
oiio_add_tests (openexr-suite openexr-multires openexr-chroma
|
||||
openexr-v2 openexr-window openexr-damaged perchannel
|
||||
oiiotool-deep
|
||||
IMAGEDIR openexr-images
|
||||
URL http://www.openexr.com/downloads.html)
|
||||
oiio_add_tests (openvdb
|
||||
FOUNDVAR OPENVDB_FOUND)
|
||||
FOUNDVAR OpenVDB_FOUND ENABLEVAR ENABLE_OpenVDB)
|
||||
oiio_add_tests (png
|
||||
ENABLEVAR ENABLE_PNG
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (pnm
|
||||
ENABLEVAR ENABLE_PNM
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (psd psd-colormodes
|
||||
ENABLEVAR ENABLE_PSD
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (ptex
|
||||
FOUNDVAR PTEX_FOUND ENABLEVAR ENABLE_PTEX)
|
||||
oiio_add_tests (raw
|
||||
FOUNDVAR LIBRAW_FOUND ENABLEVAR ENABLE_LIBRAW
|
||||
IMAGEDIR oiio-images/raw
|
||||
URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (rla
|
||||
ENABLEVAR ENABLE_RLA
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (sgi
|
||||
ENABLEVAR ENABLE_SGI
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (targa-tgautils
|
||||
ENABLEVAR ENABLE_TARGA
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (tiff-suite tiff-depths tiff-misc
|
||||
IMAGEDIR libtiffpic
|
||||
URL http://www.simplesystems.org/libtiff/images.html)
|
||||
oiio_add_tests (webp
|
||||
FOUNDVAR Webp_FOUND ENABLEVAR ENABLE_Webp
|
||||
IMAGEDIR oiio-images/webp URL "Recent checkout of oiio-images")
|
||||
oiio_add_tests (zfile ENABLEVAR ENABLE_ZFILE
|
||||
IMAGEDIR oiio-images URL "Recent checkout of oiio-images")
|
||||
|
||||
if (SPI_TESTS)
|
||||
oiio_add_tests (oiiotool-spi
|
||||
@@ -425,7 +455,7 @@ set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
||||
set (CPACK_PACKAGE_VENDOR ${PROJECT_AUTHORS})
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenImageIO is an open source library for reading and writing image file formats, a nice format-agnostic image viewer, and other image-related classes and utilities.")
|
||||
set (CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/src/doc/Description.txt")
|
||||
set (CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-${platform})
|
||||
set (CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
||||
#SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_SOURCE_DIR}")
|
||||
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/cpack")
|
||||
file (COPY "${PROJECT_SOURCE_DIR}/LICENSE.md" DESTINATION "${CMAKE_BINARY_DIR}/cpack")
|
||||
|
||||
+13
-8
@@ -23,16 +23,22 @@ For announcements about major OIIO releases or other important news.
|
||||
You can sign up for these mail lists on your own using the links above.
|
||||
|
||||
|
||||
How to Ask for Help
|
||||
-------------------
|
||||
|
||||
If you have trouble installing, building, or using OpenImageIO, but there's
|
||||
not yet reason to suspect you've encountered a genuine bug, start by posting
|
||||
a question to the
|
||||
[oiio-dev](http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org)
|
||||
mailing list. This is the place for question such has "How do I...".
|
||||
|
||||
|
||||
Bug Reports and Issue Tracking
|
||||
------------------------------
|
||||
|
||||
We use GitHub's issue tracking system for bugs and enhancements:
|
||||
https://github.com/OpenImageIO/oiio/issues
|
||||
|
||||
**If you are merely asking a question ("how do I...")**, please do not file
|
||||
an issue, but instead ask the question on the
|
||||
[OIIO developer mail list](http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org).
|
||||
|
||||
If you are submitting a bug report, please be sure to note which version of
|
||||
OIIO you are using, on what platform (OS/version, which compiler you used,
|
||||
and any special build flags or other unusual environmental issues). Please
|
||||
@@ -42,7 +48,9 @@ give a specific an account of
|
||||
* what happened
|
||||
* what you expected to happen instead
|
||||
|
||||
with enough detail that others can reproduce the problem.
|
||||
with enough detail that others can reproduce the problem. Please quote the
|
||||
exact error message you received. If you are having trouble building, please
|
||||
post the full cmake output of a fresh VERBOSE=1 build.
|
||||
|
||||
Suspected security vulnerabilities should be reported by the same process.
|
||||
|
||||
@@ -234,9 +242,6 @@ For public APIs we tend to use Doxygen-style comments (start with `///`).
|
||||
They looks like this:
|
||||
|
||||
/// Explanation of a class. Note THREE slashes!
|
||||
/// Also, you need at least two lines like this. If you don't have enough
|
||||
/// for two lines, make one line blank like this:
|
||||
///
|
||||
class myclass {
|
||||
....
|
||||
float foo; ///< Doxygen comments on same line look like this
|
||||
|
||||
+15
-1
@@ -7,18 +7,22 @@ lg@openimageio.org
|
||||
* Akihiro Yamasaki
|
||||
* Alan Jones
|
||||
* Alejandro Conty
|
||||
* Alex Hughes
|
||||
* Alex Schworer
|
||||
* Alexander Kuleshov
|
||||
* Alexander Murashko
|
||||
* Alexandre Gauthier
|
||||
* Alexis Oblet
|
||||
* Alexy Pawlow
|
||||
* Aman Shah
|
||||
* Ananth Garre
|
||||
* Arkady Shapkin
|
||||
* Basileios Anastasatos
|
||||
* Bastien Montagne
|
||||
* Ben De Luca
|
||||
* Biswapriyo Nath
|
||||
* Blair Tennessy
|
||||
* Blazej Floch
|
||||
* Brecht Van Lommel
|
||||
* Brent Davis
|
||||
* Brian Hall
|
||||
@@ -43,11 +47,14 @@ lg@openimageio.org
|
||||
* Dinko Galetik
|
||||
* Dominik Bartkiewicz
|
||||
* Duncan Chan
|
||||
* Dustin Rodrigues
|
||||
* Edgar Velazquez-Armendariz
|
||||
* Eloi Du Bois
|
||||
* Elvic Liang
|
||||
* Fabien Castan
|
||||
* Fabien Servant
|
||||
* Frédéric Devernay
|
||||
* Fredrik Averpil
|
||||
* Ghislain Antony Vaillant
|
||||
* Gonzalo Garramuño
|
||||
* Grégoire De Lillo
|
||||
@@ -56,17 +63,21 @@ lg@openimageio.org
|
||||
* Hanspeter Niederstrasser
|
||||
* Heiko Becker
|
||||
* Henri Fousse
|
||||
* Harry Mallon
|
||||
* Hugh Macdonald
|
||||
* Imarz
|
||||
* Irena Damsky
|
||||
* Ismael Cortes
|
||||
* Jep Hill
|
||||
* Jeph Alapat
|
||||
* Jens Lindgren
|
||||
* Jeremy Rose
|
||||
* Jeremy Selan
|
||||
* Joesph Goldstone
|
||||
* Jim Hourihan
|
||||
* John Burnett
|
||||
* John Haddon
|
||||
* Jonathan Scruggs
|
||||
* Joseph Goldstone
|
||||
* Julien Enche
|
||||
* Justin Israel
|
||||
* Justina Mikonyte
|
||||
@@ -102,6 +113,7 @@ lg@openimageio.org
|
||||
* Nandan Dubey
|
||||
* Nathan Rusch
|
||||
* Nicholas Yue
|
||||
* Nick Black
|
||||
* Nicolas Burtnyk
|
||||
* Nixon Kwok
|
||||
* Nuno Cardoso
|
||||
@@ -114,6 +126,7 @@ lg@openimageio.org
|
||||
* Philip Nemec
|
||||
* Pino Toscano
|
||||
* Puneet Jain
|
||||
* Radu Arjocu
|
||||
* Ramon Montoya
|
||||
* Ray Molenkamp
|
||||
* Richard Shaw
|
||||
@@ -137,6 +150,7 @@ lg@openimageio.org
|
||||
* Thiago Ize
|
||||
* Thomas Dinges
|
||||
* Thomas Mansencal
|
||||
* Till Dechent
|
||||
* Tim D. Smith
|
||||
* Tim Grant
|
||||
* Troy James Sobotka
|
||||
|
||||
+145
-48
@@ -1,10 +1,66 @@
|
||||
Installation instructions for OpenImageIO
|
||||
=========================================
|
||||
|
||||
For the most up-to-date build instructions (and in any case somewhat
|
||||
more detailed than here), please see our wiki:
|
||||
# Table of Contents
|
||||
1. [OpenImageIO's Dependences](#dependencies)
|
||||
2. [Installing binaries from package managers](#installingfrompackagemanagers)
|
||||
3. [Building OIIO from source](#buildingfromsource)
|
||||
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
|
||||
|
||||
### Required dependencies -- OIIO will not build at all without these
|
||||
|
||||
* C++11 (also builds with C++14 and C++17)
|
||||
* Compilers: gcc 4.8.2 - 10.2, clang 3.3 - 10.0, MSVS 2015 - 2019,
|
||||
icc version 13 or higher
|
||||
* CMake >= 3.12 (tested through 3.18)
|
||||
* OpenEXR >= 2.0 (recommended: 2.2 or higher; tested through 2.5)
|
||||
* libTIFF >= 3.9 (recommended: 4.0+; tested through 4.1.0)
|
||||
|
||||
### Optional dependencies -- features may be disabled if not found
|
||||
* If you are building the `iv` viewer (which will be disabled if any of
|
||||
these are not found):
|
||||
* Qt >= 5.6 (tested through 5.15)
|
||||
* OpenGL
|
||||
* If you are building the Python bindings or running the testsuite:
|
||||
* Python >= 2.7 (tested against 2.7, 3.6, 3.7, 3.8)
|
||||
* pybind11 >= 2.4.2 (Tested through 2.5.)
|
||||
* NumPy
|
||||
* If you want support for camera "RAW" formats:
|
||||
* LibRaw >= 0.15 (tested 0.15 - 0.20; LibRaw >= 0.18 is necessary for
|
||||
ACES support and much better recognition of camera metadata)
|
||||
* If you want support for a wide variety of video formats:
|
||||
* ffmpeg >= 2.6 (tested through 4.3)
|
||||
* If you want support for jpeg 2000 images:
|
||||
* **OpenJpeg >= 2.0** (tested through 2.3)
|
||||
* If you want support for Field3D files:
|
||||
* Field3D
|
||||
* If you want support for OpenVDB files:
|
||||
* OpenVDB >= 5.0 (tested through 7.0) and Intel TBB >= 2018 (tested
|
||||
through 2020_U1)
|
||||
* If you want support for converting to and from OpenCV data structures,
|
||||
or for capturing images from a camera:
|
||||
* OpenCV 2.x, 3.x, or 4.x (tested through 4.3)
|
||||
* If you want support for GIF images:
|
||||
* giflib >= 4.1 (tested through 5.2; 5.0+ is strongly recommended for
|
||||
stability and thread safety)
|
||||
* If you want support for HEIF/HEIC images:
|
||||
* libheif >= 1.3 (tested through 1.6; older versions may also work, we
|
||||
haven't tested)
|
||||
* If you want support for DDS files:
|
||||
* libsquish >= 1.13 (tested through 1.15)
|
||||
* But... if not found on the system, an embedded version will be used.
|
||||
* If you want support for DICOM medical image files:
|
||||
* DCMTK >= 3.6.1 (tested through 3.6.5)
|
||||
* If you want support for OpenColorIO color transformations:
|
||||
* OpenColorIO >= 1.1 (also tested against the current master that will
|
||||
become OCIO 2.0).
|
||||
|
||||
|
||||
https://sites.google.com/site/openimageio/checking-out-and-building-openimageio
|
||||
|
||||
Supported platforms at present include Linux (32 and 64 bit),
|
||||
Mac OS X, and Windows.
|
||||
@@ -18,54 +74,90 @@ to the 'lib' directory where OpenImageIO is installed, or else it will
|
||||
not be able to find the plugins.
|
||||
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
Installing from package managers
|
||||
================================
|
||||
|
||||
NEW or CHANGED MINIMUM dependencies since the last major release are **bold**.
|
||||
If all you want to do is install the OIIO libraries, headers, and command
|
||||
line tools as quickly as possible (don't need OIIO source or any custom
|
||||
build options), maybe one of these packages managers will do it for you:
|
||||
|
||||
### Required dependencies -- OIIO will not build at all without these
|
||||
* vckpg (https://github.com/Microsoft/vcpkg)
|
||||
* https://github.com/Microsoft/vcpkg/tree/master/ports/openimageio
|
||||
* `.\vcpkg install openimageio [tools]`
|
||||
* For a full list of supported build features: `.\vcpkg search openimageio`
|
||||
* homebrew (https://github.com/Homebrew/brew)
|
||||
* https://formulae.brew.sh/formula/openimageio
|
||||
* `brew install openimageio`
|
||||
* macports (https://github.com/macports/macports-ports)
|
||||
* https://www.macports.org/ports.php?by=name&substr=openimageio
|
||||
* `port install openimageio`
|
||||
* fink (https://github.com/fink/fink)
|
||||
* http://pdb.finkproject.org/pdb/package.php/libopenimageio2.1-shlibs
|
||||
* `fink install openimageio`
|
||||
* conan (https://github.com/conan-io/conan)
|
||||
|
||||
* C++11 (also builds with C++14 and C++17)
|
||||
* Compilers: gcc 4.8.2 - 9.1, clang 3.3 - 8.0, **MSVS 2015 - 2019**,
|
||||
icc version 13 or higher
|
||||
* Boost >= 1.53 (tested up through 1.70)
|
||||
* CMake >= 3.2.2 (tested up through 3.14)
|
||||
* OpenEXR >= 2.0 (recommended: 2.2 or 2.3)
|
||||
* libTIFF >= 3.9 (recommended: 4.0+)
|
||||
If these work for you and it's all you need, bingo! You are done.
|
||||
|
||||
|
||||
|
||||
Building from source
|
||||
====================
|
||||
|
||||
|
||||
Dependency control and disabling components
|
||||
-------------------------------------------
|
||||
|
||||
**Hints for finding dependencies**
|
||||
|
||||
For each external dependency PkgName, our CMake build system will recognize
|
||||
the following optional variable:
|
||||
|
||||
PkgName_ROOT=...
|
||||
|
||||
to specify a hint about where the package is installed. It can either be
|
||||
a CMake variable (set by `-DPkgName_ROOT=...` on the CMake command line),
|
||||
or an environment variable of the same name, or a variable setting on the
|
||||
Make wrapper (`make PkgName_ROOT=...`).
|
||||
|
||||
**Disabling optional dependencies and individual components**
|
||||
|
||||
`USE_PYTHON=0` : Omits building the Python bindings.
|
||||
|
||||
`OIIO_BUILD_TESTS=0` : Omits building tests (you probably don't need them
|
||||
unless you are a developer of OIIO or want to verify that your build
|
||||
passes all tests).
|
||||
|
||||
`OIIO_BUILD_TOOLS=0` : Disables building all the command line tools (such
|
||||
as iinfo, oiiotool, maketx, etc.).
|
||||
|
||||
`ENABLE_toolname=0` : Disables building the named command line tool (iinfo,
|
||||
oiiotool, etc.). This works both as a CMake variable and also as an
|
||||
environment variable.
|
||||
|
||||
`ENABLE_formatname=0` : Disables building support for the particular named
|
||||
file format (jpeg, fits, png, etc.). This works both as a CMake variable and
|
||||
also as an environment variable.
|
||||
|
||||
`ENABLE_PkgName=0` : Disables use of an *optional* dependency (such as
|
||||
FFmpeg, Field3D, Webp, etc.) -- even if the dependency is found on the
|
||||
system. This will obviously disable any functionality that requires the
|
||||
dependency. This works both as a CMake variable and
|
||||
also as an environment variable.
|
||||
|
||||
### Optional dependencies -- features may be disabled if not found
|
||||
* If you are building the `iv` viewer (which will be disabled if any of
|
||||
these are not found):
|
||||
* Qt >= 5.6
|
||||
* OpenGL
|
||||
* If you are building the Python bindings or running the testsuite:
|
||||
* Python >= 2.7 (tested against 2.7, 3.6, 3.7)
|
||||
* **NumPy**
|
||||
* **pybind11 >= 2.2.0** (but OIIO will auto-download it if not found)
|
||||
* If you want support for camera "RAW" formats:
|
||||
* libRaw >= 0.15 (tested 0.15 - 0.19; libRaw >= 0.18 is necessary for
|
||||
ACES support and much better recognition of camera metadata)
|
||||
* If you want support for a wide variety of video formats:
|
||||
* ffmpeg >= 2.6 (tested through 4.1)
|
||||
* If you want support for jpeg 2000 images:
|
||||
* OpenJpeg >= 1.5 (tested through 2.3; version 2.0+ is strongly recommended)
|
||||
* If you want support for Field3D files:
|
||||
* Field3D
|
||||
* If you want support for OpenVDB files:
|
||||
* OpenVDB >= 5.0 and Intel TBB >= 2018
|
||||
* If you want support for converting to and from OpenCV data structures,
|
||||
or for capturing images from a camera:
|
||||
* OpenCV 2.x, 3.x, or 4.x
|
||||
* If you want support for HEIF/HEIC images:
|
||||
* libheic >= 1.3 (older versions may work, we haven't tested)
|
||||
|
||||
|
||||
Building OpenImageIO on Linux or OS X
|
||||
-------------------------------------
|
||||
|
||||
The following dependencies must be installed to build the core of
|
||||
OpenImageIO: Boost, libjpeg, libtiff, libpng and OpenEXR. These can be
|
||||
installed using the standard package managers on your system.
|
||||
OpenImageIO:
|
||||
* Boost
|
||||
* libjpeg
|
||||
* libtiff
|
||||
* libpng
|
||||
* OpenEXR.
|
||||
|
||||
These can be installed using the standard package managers on your system.
|
||||
Optionally, to build the image viewing tools, you will need Qt and OpenGL.
|
||||
|
||||
On OS X, these dependencies can be installed using Fink, MacPorts or
|
||||
@@ -87,9 +179,9 @@ directories must notify the CMake system using environment variables.
|
||||
For example, set QTDIR to point at the root of the Qt library location
|
||||
so that CMake can find it (see CMake configuration output).
|
||||
|
||||
On Linux and OS X, you can build from source from the top-level
|
||||
**On Linux and OS X, you can build from source from the top-level
|
||||
directory by just typing 'make'. (Yes, we have a 'make' wrapper around
|
||||
our CMake build, it simplifies things.)
|
||||
our CMake build, it simplifies things.)**
|
||||
|
||||
During the make, various temporary files (object files, etc.) will
|
||||
be put in build/PLATFORM, where 'PLATFORM' will be the name of the
|
||||
@@ -108,7 +200,6 @@ Make targets you should know about:
|
||||
| make realclean | Get rid of both build/PLATFORM and dist/PLATFORM |
|
||||
| make nuke | Get rid of all build/ and dist/, for all platforms |
|
||||
| make profile | Build a profilable version dist/PLATFORM.profile |
|
||||
| make doxygen | Build the Doxygen docs |
|
||||
| make help | Print all the make options |
|
||||
|
||||
Additionally, a few helpful modifiers alter some build-time options:
|
||||
@@ -122,7 +213,7 @@ Additionally, a few helpful modifiers alter some build-time options:
|
||||
| make USE_QT=0 ... | Skip anything that needs Qt |
|
||||
| make MYCC=xx MYCXX=yy ... | Use custom compilers |
|
||||
| make USE_PYTHON=0 ... | Don't build the Python binding |
|
||||
| make BUILDSTATIC=1 ... | Build static library instead of shared |
|
||||
| make BUILD_SHARED_LIBS=0 | Build static library instead of shared |
|
||||
| make LINKSTATIC=1 ... | Link with static external libraries when possible |
|
||||
| make SOVERSION=nn ... | Include the specifed major version number in the shared object metadata |
|
||||
| make NAMESPACE=name | Wrap everything in another namespace |
|
||||
@@ -136,7 +227,7 @@ CMake directly:
|
||||
cd build
|
||||
cmake ..
|
||||
|
||||
If the compile stops because of warnings, try again with
|
||||
If the compile stops because of warnings, try again with
|
||||
|
||||
make nuke
|
||||
make STOP_ON_WARNING=0
|
||||
@@ -152,8 +243,7 @@ or, if you are using CMake directly,
|
||||
Building on Windows
|
||||
-------------------
|
||||
|
||||
See the latest Windows build docs on our web site:
|
||||
https://sites.google.com/site/openimageio/building-oiio-on-windows
|
||||
**Method 1 - Default**
|
||||
|
||||
1. Check out the trunk or a branch of your choice. The remainder of
|
||||
these instructions assume that you checked out the trunk to the
|
||||
@@ -239,6 +329,13 @@ D:\OIIO\external\dist\windows\zlib-1.2.3 directory. If it can't find
|
||||
ZLIB and PNG, add
|
||||
D:\OIIO\external\dist\windows\zlib-1.2.3;D:\OIIO\external\dist\windows\libpng-1.2.3.
|
||||
|
||||
**Method 2 - Using vcpkg**
|
||||
|
||||
1. Visit Microsoft's vcpkg GitHub page: https://github.com/Microsoft/vcpkg. Also note that the openimageio package is located here: https://github.com/Microsoft/vcpkg/tree/master/ports/openimageio
|
||||
|
||||
2. Follow vcpkg installation instructions and complete the install. Please note vcpkg has its own list of prerequisites listed on their page.
|
||||
|
||||
3. Execute the PowerShell command from where vcpkg is located in directory. ``.\vcpkg install openimageio``
|
||||
|
||||
Test Images
|
||||
-----------
|
||||
|
||||
+206
-421
@@ -9,40 +9,179 @@ In no particular order:
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
The initial (version 0.1) code found in imageio.h, fmath.h, filter.h,
|
||||
argparse, and the JPEG reader/writer had elements derived from BSD-licensed
|
||||
example code from NVIDIA's Gelato Renderer.
|
||||
BSD 3-Clause License
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
It's not clear that any of that original code still survives in the modern
|
||||
OIIO, but since some elements are derive works from that, we still reproduce
|
||||
the original copyright here:
|
||||
* Gelato, Copyright (c) 2004 by NVIDIA Corp.
|
||||
|
||||
Copyright (c) 2004 by NVIDIA Corp.
|
||||
The initial (version 0.1) code found in imageio.h, fmath.h, filter.h,
|
||||
argparse, and the JPEG reader/writer had elements derived from
|
||||
BSD-licensed example code and headers from NVIDIA's Gelato Renderer. It's
|
||||
not clear that any of that original code still survives in the modern
|
||||
OIIO, but since some elements are derived from that, we still acknowledge
|
||||
the original copyright here.
|
||||
|
||||
Standard 3-clause BSD license: https://opensource.org/licenses/BSD-3-Clause
|
||||
* Open Shading Language. Copyright Sony Pictures Imageworks Inc.
|
||||
|
||||
A few parts here and there, notably parts of fmath.h and many of the CMake
|
||||
files, contain code that was originally developed for Open Shading
|
||||
Language but subsequently moved to OIIO.
|
||||
|
||||
* DPX reader/writer (c) Copyright 2009 Patrick A. Palmer.
|
||||
https://github.com/patrickpalmer/dpx
|
||||
|
||||
* KissFFT (c) Copyright 2003-2010 Mark Borgerding
|
||||
https://github.com/mborgerding/kissfft
|
||||
|
||||
* FindOpenVDB.cmake (c) Copyright 2015 Blender Foundation, BSD license.
|
||||
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
A few parts here and there, notably parts of fmath.h and many of the
|
||||
CMake files, contain code that was originally developed for Open Shading
|
||||
Language but subsequently moved to OIIO. Those portions are
|
||||
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
Copyright (c) 2009-2014 Sony Pictures Imageworks Inc.
|
||||
* xxHash - Fast Hash algorithm
|
||||
Copyright (C) 2012-2014, Yann Collet.
|
||||
You can contact the author at :
|
||||
- xxHash source repository : https://github.com/Cyan4973/xxHash
|
||||
- public discussion board : https://groups.google.com/forum/#!forum/lz4c
|
||||
|
||||
Standard 3-clause BSD license: https://opensource.org/licenses/BSD-3-Clause
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
The SHA-1 implemenation we use is public domain by Dominik Reichl.
|
||||
http://www.dominik-reichl.de/
|
||||
MIT License
|
||||
SPDX-License-Identifier: MIT
|
||||
|
||||
* Squish
|
||||
Copyright 2006 Simon Brown si@sjbrown.co.uk
|
||||
http://sjbrown.co.uk/?code=squish
|
||||
|
||||
* PugiXML http://pugixml.org/ https://github.com/zeux/pugixml
|
||||
Copyright (c) 2006-2018 Arseny Kapoulkine
|
||||
|
||||
* FarmHash, by Geoff Pike https://github.com/google/farmhash
|
||||
(c) Copyright 2014 Google, Inc., MIT license.
|
||||
|
||||
* FindTBB.cmake. Copyright (c) 2015 Justus Calvin
|
||||
|
||||
* {fmt} library - https://github.com/fmtlib/fmt
|
||||
Copyright (c) 2012 - present, Victor Zverovich
|
||||
|
||||
* UTF-8 decoder function from http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
|
||||
Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
|
||||
|
||||
* fasthash
|
||||
Copyright (C) 2012 Zilong Tan (eric.zltan@gmail.com)
|
||||
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Some math functions in fmath.h are derived from the
|
||||
[Sleef library](https://sleef.org), which uses the Boost license.
|
||||
Apache 2.0 License.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
Copyright Naoki Shibata and contributors 2010 - 2017.
|
||||
https://github.com/shibatch/sleef/blob/master/LICENSE.txt
|
||||
* CTPL thread pool https://github.com/vit-vit/CTPL
|
||||
Copyright 2014 Vitaliy Vitsentiy.
|
||||
|
||||
* Droid fonts from the Android SDK. http://www.droidfonts.com
|
||||
Copyright Google, Inc.
|
||||
|
||||
* function_view.h contains code derived from LLVM. https://llvm.org
|
||||
Copyright (c) 2003-2018 University of Illinois at Urbana-Champaign.
|
||||
This is licensed under the Apache 2.0 license with LLVM Exceptions.
|
||||
https://llvm.org/docs/DeveloperPolicy.html#open-source-licensing-terms
|
||||
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Boost Software License - Version 1.0
|
||||
SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
* Some math functions in fmath.h are derived from the
|
||||
[Sleef library](https://sleef.org)
|
||||
|
||||
Copyright Naoki Shibata and contributors 2010 - 2017.
|
||||
https://github.com/shibatch/sleef/blob/master/LICENSE.txt
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -70,410 +209,12 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Squish Copyright 2006 Simon Brown, MIT license.
|
||||
http://sjbrown.co.uk/?code=squish
|
||||
|
||||
Copyright (c) 2006 Simon Brown, si@sjbrown.co.uk
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
PugiXML http://pugixml.org/ https://github.com/zeux/pugixml
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2006-2018 Arseny Kapoulkine
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
DPX reader/writer (c) Copyright 2009 Patrick A. Palmer, BSD 3-clause license.
|
||||
|
||||
https://github.com/patrickpalmer/dpx
|
||||
|
||||
Copyright (c) 2009, Patrick A. Palmer.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Patrick A. Palmer nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
tinyformat.h http://github.com/c42f/tinyformat
|
||||
|
||||
Copyright (C) 2011, Chris Foster
|
||||
|
||||
Boost Software License - Version 1.0
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
lookup3 code by Bob Jenkins, Public Domain.
|
||||
|
||||
http://burtleburtle.net/bob/c/lookup3.c
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
xxHash - Fast Hash algorithm
|
||||
|
||||
Copyright (C) 2012-2014, Yann Collet.
|
||||
|
||||
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following disclaimer
|
||||
in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
You can contact the author at :
|
||||
- xxHash source repository : https://github.com/Cyan4973/xxHash
|
||||
- public discussion board : https://groups.google.com/forum/#!forum/lz4c
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
farmhash (c) Copyright 2014 Google, Inc., MIT license.
|
||||
https://github.com/google/farmhash
|
||||
|
||||
Copyright (c) 2014 Google, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
FarmHash, by Geoff Pike
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
KissFFT (c) Copyright 2003-2010 Mark Borgerding, 3-clause BSD license.
|
||||
|
||||
https://github.com/mborgerding/kissfft
|
||||
|
||||
Copyright (c) 2003-2010 Mark Borgerding
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the author nor the names of any contributors may be used to
|
||||
endorse or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
CTPL thread pool https://github.com/vit-vit/CTPL
|
||||
|
||||
Copyright 2014 Vitaliy Vitsentiy.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Droid fonts from the Android SDK. http://www.droidfonts.com
|
||||
|
||||
Copyright Google, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
function_view.h contains code derived from LLVM. https://llvm.org
|
||||
|
||||
University of Illinois/NCSA Open Source License
|
||||
|
||||
Copyright (c) 2003-2018 University of Illinois at Urbana-Champaign.
|
||||
All rights reserved.
|
||||
|
||||
Developed by:
|
||||
|
||||
LLVM Team
|
||||
|
||||
University of Illinois at Urbana-Champaign
|
||||
|
||||
http://llvm.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal with the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimers.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimers in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the names of the LLVM Team, University of Illinois at
|
||||
Urbana-Champaign, nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this Software without specific
|
||||
prior written permission.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
WITH THE SOFTWARE.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
FindOpenVDB.cmake (c) Copyright 2015 Blender Foundation, BSD license.
|
||||
|
||||
Copyright 2015 Blender Foundation.
|
||||
|
||||
Distributed under the OSI-approved BSD License (the "License");
|
||||
see accompanying file Copyright.txt for details.
|
||||
|
||||
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the License for more information.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
FindTBB.cmake
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Justus Calvin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
{fmt} library - https://github.com/fmtlib/fmt
|
||||
|
||||
Copyright (c) 2012 - 2016, Victor Zverovich
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
UTF-8 decoder function from http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
|
||||
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to
|
||||
deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Base-64 encoder from http://www.adp-gmbh.ch/cpp/common/base64.html
|
||||
https://github.com/ReneNyffenegger/cpp-base64
|
||||
|
||||
Zlib license
|
||||
SPDX-License-Identifier: Zlib
|
||||
|
||||
* Base-64 encoder from http://www.adp-gmbh.ch/cpp/common/base64.html
|
||||
Copyright (C) 2004-2008 René Nyffenegger
|
||||
|
||||
Copyright (C) 2004-2008 René Nyffenegger
|
||||
|
||||
This source code is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the author be held liable for any damages
|
||||
@@ -495,5 +236,49 @@ René Nyffenegger rene.nyffenegger@adp-gmbh.ch
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Unlicense
|
||||
SPDX-License-Identifier: Unlicense
|
||||
|
||||
* gif.h by Charlie Tangora. Public domain / Unlicense.
|
||||
https://github.com/ginsweater/gif-h
|
||||
|
||||
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <http://unlicense.org>
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Public domain
|
||||
|
||||
* lookup3 code by Bob Jenkins, Public Domain.
|
||||
http://burtleburtle.net/bob/c/lookup3.c
|
||||
|
||||
* The SHA-1 implemenation we use is public domain by Dominik Reichl.
|
||||
http://www.dominik-reichl.de
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
If we have left anything out, it is unintentional. Please let us know.
|
||||
|
||||
|
||||
+18
-19
@@ -1,30 +1,29 @@
|
||||
Copyright 2008-present by Contributors to the OpenImageIO project.
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2008-present by Contributors to the OpenImageIO project.
|
||||
All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
See [LICENSE-THIRD-PARTY.md](LICENSE-THIRD-PARTY.md) for license information
|
||||
about portions that have been imported from other projects.
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
#
|
||||
# This is the master makefile.
|
||||
# Here we put all the top-level make targets, platform-independent
|
||||
# rules, etc.
|
||||
# rules, etc. This is just a fancy wrapper around cmake, but for many
|
||||
# people, it's a lot simpler to just type "make" and have everything
|
||||
# happen automatically.
|
||||
#
|
||||
# Run 'make help' to list helpful targets.
|
||||
#
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
#########################################################################
|
||||
|
||||
|
||||
@@ -27,32 +32,26 @@ endif
|
||||
|
||||
MY_MAKE_FLAGS ?=
|
||||
MY_NINJA_FLAGS ?=
|
||||
MY_CMAKE_FLAGS += -g3 -DSELF_CONTAINED_INSTALL_TREE:BOOL=TRUE
|
||||
MY_CMAKE_FLAGS += -g3
|
||||
BUILDSENTINEL ?= Makefile
|
||||
NINJA ?= ninja
|
||||
CMAKE ?= cmake
|
||||
CMAKE_BUILD_TYPE ?= Release
|
||||
|
||||
# Site-specific build instructions
|
||||
ifndef OPENIMAGEIO_SITE
|
||||
OPENIMAGEIO_SITE := ${shell uname -n}
|
||||
endif
|
||||
OPENIMAGEIO_SITE ?= ${shell uname -n}
|
||||
ifneq (${shell echo ${OPENIMAGEIO_SITE} | grep imageworks.com},)
|
||||
include ${working_dir}/site/spi/Makefile-bits
|
||||
endif
|
||||
|
||||
# Set up variables holding the names of platform-dependent directories --
|
||||
# set these after evaluating site-specific instructions
|
||||
top_build_dir := build
|
||||
build_dir := ${top_build_dir}/${platform}${variant}
|
||||
top_dist_dir := dist
|
||||
dist_dir := ${top_dist_dir}/${platform}${variant}
|
||||
top_build_dir ?= build
|
||||
build_dir ?= ${top_build_dir}/${platform}${variant}
|
||||
top_dist_dir ?= dist
|
||||
dist_dir ?= ${top_dist_dir}/${platform}${variant}
|
||||
|
||||
ifndef INSTALL_PREFIX
|
||||
INSTALL_PREFIX := ${working_dir}/${dist_dir}
|
||||
INSTALL_PREFIX_BRIEF := ${dist_dir}
|
||||
else
|
||||
INSTALL_PREFIX_BRIEF := ${INSTALL_PREFIX}
|
||||
endif
|
||||
INSTALL_PREFIX ?= ${working_dir}/${dist_dir}
|
||||
|
||||
VERBOSE ?= ${SHOWCOMMANDS}
|
||||
ifneq (${VERBOSE},)
|
||||
@@ -71,14 +70,6 @@ ifneq (${EMBEDPLUGINS},)
|
||||
MY_CMAKE_FLAGS += -DEMBEDPLUGINS:BOOL=${EMBEDPLUGINS}
|
||||
endif
|
||||
|
||||
ifneq (${USE_OPENGL},)
|
||||
MY_CMAKE_FLAGS += -DUSE_OPENGL:BOOL=${USE_OPENGL}
|
||||
endif
|
||||
|
||||
ifneq (${USE_QT},)
|
||||
MY_CMAKE_FLAGS += -DUSE_QT:BOOL=${USE_QT}
|
||||
endif
|
||||
|
||||
ifneq (${OIIO_THREAD_ALLOW_DCLP},)
|
||||
MY_CMAKE_FLAGS += -DOIIO_THREAD_ALLOW_DCLP:BOOL=${OIIO_THREAD_ALLOW_DCLP}
|
||||
endif
|
||||
@@ -87,10 +78,6 @@ ifneq (${NAMESPACE},)
|
||||
MY_CMAKE_FLAGS += -DOIIO_NAMESPACE:STRING=${NAMESPACE}
|
||||
endif
|
||||
|
||||
ifneq (${HIDE_SYMBOLS},)
|
||||
MY_CMAKE_FLAGS += -DHIDE_SYMBOLS:BOOL=${HIDE_SYMBOLS}
|
||||
endif
|
||||
|
||||
ifneq (${USE_PYTHON},)
|
||||
MY_CMAKE_FLAGS += -DUSE_PYTHON:BOOL=${USE_PYTHON}
|
||||
endif
|
||||
@@ -107,116 +94,16 @@ ifneq (${PYLIB_INCLUDE_SONAME},)
|
||||
MY_CMAKE_FLAGS += -DPYLIB_INCLUDE_SONAME:BOOL=${PYLIB_INCLUDE_SONAME}
|
||||
endif
|
||||
|
||||
ifneq (${USE_FFMPEG},)
|
||||
MY_CMAKE_FLAGS += -DUSE_FFMPEG:BOOL=${USE_FFMPEG}
|
||||
endif
|
||||
|
||||
ifneq (${USE_FIELD3D},)
|
||||
MY_CMAKE_FLAGS += -DUSE_FIELD3D:BOOL=${USE_FIELD3D}
|
||||
endif
|
||||
|
||||
ifneq (${FIELD3D_HOME},)
|
||||
MY_CMAKE_FLAGS += -DFIELD3D_HOME:STRING=${FIELD3D_HOME}
|
||||
endif
|
||||
|
||||
ifneq (${USE_TBB},)
|
||||
MY_CMAKE_FLAGS += -DUSE_TBB:BOOL=${USE_TBB}
|
||||
endif
|
||||
|
||||
ifneq (${TBB_ROOT_DIR},)
|
||||
MY_CMAKE_FLAGS += -DTBB_ROOT_DIR:STRING=${TBB_ROOT_DIR}
|
||||
endif
|
||||
|
||||
ifneq (${USE_OPENVDB},)
|
||||
MY_CMAKE_FLAGS += -DUSE_OPENVDB:BOOL=${USE_OPENVDB}
|
||||
endif
|
||||
|
||||
ifneq (${OPENVDB_LOCATION},)
|
||||
MY_CMAKE_FLAGS += -DOPENVDB_LOCATION:STRING=${OPENVDB_LOCATION}
|
||||
endif
|
||||
|
||||
ifneq (${USE_OPENJPEG},)
|
||||
MY_CMAKE_FLAGS += -DUSE_OPENJPEG:BOOL=${USE_OPENJPEG}
|
||||
endif
|
||||
|
||||
ifneq (${OPENJPEG_HOME},)
|
||||
MY_CMAKE_FLAGS += -DOPENJPEG_HOME:STRING=${OPENJPEG_HOME}
|
||||
endif
|
||||
|
||||
ifneq (${USE_JPEGTURBO},)
|
||||
MY_CMAKE_FLAGS += -DUSE_JPEGTURBO:BOOL=${USE_JPEGTURBO}
|
||||
endif
|
||||
|
||||
ifneq (${JPEGTURBO_PATH},)
|
||||
MY_CMAKE_FLAGS += -DJPEGTURBO_PATH:STRING=${JPEGTURBO_PATH}
|
||||
endif
|
||||
|
||||
ifneq (${USE_GIF},)
|
||||
MY_CMAKE_FLAGS += -DUSE_GIF:BOOL=${USE_GIF}
|
||||
endif
|
||||
|
||||
ifneq (${GIF_DIR},)
|
||||
MY_CMAKE_FLAGS += -DGIF_DIR:STRING=${GIF_DIR}
|
||||
endif
|
||||
|
||||
ifneq (${USE_OCIO},)
|
||||
MY_CMAKE_FLAGS += -DUSE_OCIO:BOOL=${USE_OCIO}
|
||||
endif
|
||||
|
||||
ifneq (${USE_NUKE},)
|
||||
MY_CMAKE_FLAGS += -DUSE_NUKE:BOOL=${USE_NUKE}
|
||||
endif
|
||||
|
||||
ifneq (${USE_OPENCV},)
|
||||
MY_CMAKE_FLAGS += -DUSE_OPENCV:BOOL=${USE_OPENCV}
|
||||
endif
|
||||
|
||||
ifneq (${USE_LIBRAW},)
|
||||
MY_CMAKE_FLAGS += -DUSE_LIBRAW:BOOL=${USE_LIBRAW}
|
||||
endif
|
||||
|
||||
ifneq (${LIBRAW_PATH},)
|
||||
MY_CMAKE_FLAGS += -DLIBRAW_PATH:STRING=${LIBRAW_PATH}
|
||||
endif
|
||||
|
||||
ifneq (${USE_PTEX},)
|
||||
MY_CMAKE_FLAGS += -DUSE_PTEX:BOOL=${USE_PTEX}
|
||||
endif
|
||||
|
||||
ifneq (${USE_WEBP},)
|
||||
MY_CMAKE_FLAGS += -DUSE_WEBP:BOOL=${USE_WEBP}
|
||||
endif
|
||||
|
||||
ifneq (${USE_EXTERNAL_PUGIXML},)
|
||||
MY_CMAKE_FLAGS += -DUSE_EXTERNAL_PUGIXML:BOOL=${USE_EXTERNAL_PUGIXML} -DPUGIXML_HOME=${PUGIXML_HOME}
|
||||
endif
|
||||
|
||||
# Old names -- DEPRECATED (1.9)
|
||||
ifneq (${OPENEXR_HOME},)
|
||||
MY_CMAKE_FLAGS += -DOPENEXR_ROOT_DIR:STRING=${OPENEXR_HOME}
|
||||
endif
|
||||
ifneq (${ILMBASE_HOME},)
|
||||
MY_CMAKE_FLAGS += -DILMBASE_ROOT_DIR:STRING=${ILMBASE_HOME}
|
||||
ifneq (${OPENEXR_ROOT},)
|
||||
MY_CMAKE_FLAGS += -DOPENEXR_ROOT:STRING=${OPENEXR_ROOT}
|
||||
endif
|
||||
|
||||
ifneq (${OPENEXR_ROOT_DIR},)
|
||||
MY_CMAKE_FLAGS += -DOPENEXR_ROOT_DIR:STRING=${OPENEXR_ROOT_DIR}
|
||||
endif
|
||||
|
||||
ifneq (${ILMBASE_ROOT_DIR},)
|
||||
MY_CMAKE_FLAGS += -DILMBASE_ROOT_DIR:STRING=${ILMBASE_ROOT_DIR}
|
||||
endif
|
||||
|
||||
ifneq (${OCIO_HOME},)
|
||||
MY_CMAKE_FLAGS += -DOCIO_PATH:STRING=${OCIO_HOME}
|
||||
endif
|
||||
|
||||
ifneq (${BOOST_HOME},)
|
||||
MY_CMAKE_FLAGS += -DBOOST_ROOT:STRING=${BOOST_HOME}
|
||||
endif
|
||||
|
||||
ifneq (${NUKE_HOME},)
|
||||
MY_CMAKE_FLAGS += -DNuke_ROOT:STRING=${NUKE_HOME}
|
||||
ifneq (${ILMBASE_ROOT},)
|
||||
MY_CMAKE_FLAGS += -DILMBASE_ROOT:STRING=${ILMBASE_ROOT}
|
||||
endif
|
||||
|
||||
ifneq (${NUKE_VERSION},)
|
||||
@@ -227,8 +114,8 @@ ifneq (${STOP_ON_WARNING},)
|
||||
MY_CMAKE_FLAGS += -DSTOP_ON_WARNING:BOOL=${STOP_ON_WARNING}
|
||||
endif
|
||||
|
||||
ifneq (${BUILDSTATIC},)
|
||||
MY_CMAKE_FLAGS += -DBUILDSTATIC:BOOL=${BUILDSTATIC}
|
||||
ifneq (${BUILD_SHARED_LIBS},)
|
||||
MY_CMAKE_FLAGS += -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
|
||||
endif
|
||||
|
||||
ifneq (${LINKSTATIC},)
|
||||
@@ -256,11 +143,11 @@ MY_CMAKE_FLAGS += -DBUILD_OIIOUTIL_ONLY:BOOL=${BUILD_OIIOUTIL_ONLY}
|
||||
endif
|
||||
|
||||
ifdef DEBUG
|
||||
MY_CMAKE_FLAGS += -DCMAKE_BUILD_TYPE:STRING=Debug
|
||||
CMAKE_BUILD_TYPE=Debug
|
||||
endif
|
||||
|
||||
ifdef PROFILE
|
||||
MY_CMAKE_FLAGS += -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
|
||||
CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
endif
|
||||
|
||||
ifneq (${MYCC},)
|
||||
@@ -271,7 +158,11 @@ MY_CMAKE_FLAGS += -DCMAKE_CXX_COMPILER:STRING="${MYCXX}"
|
||||
endif
|
||||
|
||||
ifneq (${USE_CPP},)
|
||||
MY_CMAKE_FLAGS += -DUSE_CPP=${USE_CPP}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_CXX_STANDARD=${USE_CPP}
|
||||
endif
|
||||
|
||||
ifneq (${CMAKE_CXX_STANDARD},)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
|
||||
endif
|
||||
|
||||
ifneq (${USE_LIBCPLUSPLUS},)
|
||||
@@ -308,11 +199,12 @@ BUILDSENTINEL := build.ninja
|
||||
endif
|
||||
|
||||
ifeq (${CODECOV},1)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_BUILD_TYPE:STRING=Debug -DCODECOV:BOOL=${CODECOV}
|
||||
CMAKE_BUILD_TYPE=Debug
|
||||
MY_CMAKE_FLAGS += -DCODECOV:BOOL=${CODECOV}
|
||||
endif
|
||||
|
||||
ifneq (${SANITIZE},)
|
||||
MY_CMAKE_FLAGS += -DSANITIZE=${SANITIZE}
|
||||
MY_CMAKE_FLAGS += -DSANITIZE=${SANITIZE}
|
||||
endif
|
||||
|
||||
ifneq (${CLANG_TIDY},)
|
||||
@@ -337,12 +229,8 @@ ifneq (${CLANG_FORMAT_EXCLUDES},)
|
||||
MY_CMAKE_FLAGS += -DCLANG_FORMAT_EXCLUDES:STRING=${CLANG_FORMAT_EXCLUDES}
|
||||
endif
|
||||
|
||||
ifneq (${USE_FREETYPE},)
|
||||
MY_CMAKE_FLAGS += -DUSE_FREETYPE:BOOL=${USE_FREETYPE}
|
||||
endif
|
||||
|
||||
ifneq (${BUILD_MISSING_DEPS},)
|
||||
MY_CMAKE_FLAGS += -DBUILD_MISSING_DEPS:BOOL=${BUILD_MISSING_DEPS}
|
||||
MY_CMAKE_FLAGS += -DBUILD_MISSING_DEPS:BOOL=${BUILD_MISSING_DEPS}
|
||||
endif
|
||||
|
||||
|
||||
@@ -367,92 +255,78 @@ debug:
|
||||
profile:
|
||||
${MAKE} PROFILE=1 --no-print-directory
|
||||
|
||||
# 'make cmakesetup' constructs the build directory and runs 'cmake' there,
|
||||
# 'make config' constructs the build directory and runs 'cmake' there,
|
||||
# generating makefiles to build the project. For speed, it only does this when
|
||||
# ${build_dir}/Makefile doesn't already exist, in which case we rely on the
|
||||
# cmake generated makefiles to regenerate themselves when necessary.
|
||||
cmakesetup:
|
||||
config:
|
||||
@ (if [ ! -e ${build_dir}/${BUILDSENTINEL} ] ; then \
|
||||
${CMAKE} -E make_directory ${build_dir} ; \
|
||||
cd ${build_dir} ; \
|
||||
${CMAKE} -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
|
||||
${MY_CMAKE_FLAGS} -DBOOST_ROOT=${BOOST_HOME} \
|
||||
../.. ; \
|
||||
${CMAKE} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} \
|
||||
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
|
||||
${MY_CMAKE_FLAGS} ../.. ; \
|
||||
fi)
|
||||
|
||||
ifeq (${USE_NINJA},1)
|
||||
|
||||
# 'make cmake' does a basic build (after first setting it up)
|
||||
cmake: cmakesetup
|
||||
@ ( cd ${build_dir} ; ${NINJA} ${MY_NINJA_FLAGS} )
|
||||
# 'make build' does a basic build (after first setting it up)
|
||||
build: config
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --config ${CMAKE_BUILD_TYPE} \
|
||||
)
|
||||
|
||||
# 'make cmakeinstall' builds everthing and installs it in 'dist'.
|
||||
# 'make install' builds everthing and installs it in 'dist'.
|
||||
# Suppress pointless output from docs installation.
|
||||
cmakeinstall: cmake
|
||||
@ ( cd ${build_dir} ; ${NINJA} ${MY_NINJA_FLAGS} install | grep -v '^-- \(Installing\|Up-to-date\|Set runtime path\)' )
|
||||
install: build
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --target install --config ${CMAKE_BUILD_TYPE} | grep -v '^-- \(Installing\|Up-to-date\|Set runtime path\)' \
|
||||
)
|
||||
|
||||
# 'make package' builds everything and then makes an installable package
|
||||
# (platform dependent -- may be .tar.gz, .sh, .dmg, .rpm, .deb. .exe)
|
||||
package: cmakeinstall
|
||||
@ ( cd ${build_dir} ; ${NINJA} ${MY_NINJA_FLAGS} package )
|
||||
package: install
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --target package --config ${CMAKE_BUILD_TYPE} \
|
||||
)
|
||||
|
||||
# 'make package_source' makes an installable source package
|
||||
# (platform dependent -- may be .tar.gz, .sh, .dmg, .rpm, .deb. .exe)
|
||||
package_source: cmakeinstall
|
||||
@ ( cd ${build_dir} ; ${NINJA} ${MY_NINJA_FLAGS} package_source )
|
||||
package_source: install
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --target package_source --config ${CMAKE_BUILD_TYPE} \
|
||||
)
|
||||
|
||||
# 'make clang-format' runs clang-format on all source files (if it's installed)
|
||||
clang-format: cmakesetup
|
||||
@ ( cd ${build_dir} ; ${NINJA} ${MY_NINJA_FLAGS} clang-format )
|
||||
clang-format: config
|
||||
@ ( cd ${build_dir} ; \
|
||||
${CMAKE} --build . --target clang-format --config ${CMAKE_BUILD_TYPE} \
|
||||
)
|
||||
|
||||
else
|
||||
|
||||
# 'make cmake' does a basic build (after first setting it up)
|
||||
cmake: cmakesetup
|
||||
@ ( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} )
|
||||
|
||||
# 'make cmakeinstall' builds everthing and installs it in 'dist'.
|
||||
# Suppress pointless output from docs installation.
|
||||
cmakeinstall: cmake
|
||||
@ ( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} install | grep -v '^-- \(Installing\|Up-to-date\|Set runtime path\)' )
|
||||
|
||||
# 'make package' builds everything and then makes an installable package
|
||||
# (platform dependent -- may be .tar.gz, .sh, .dmg, .rpm, .deb. .exe)
|
||||
package: cmakeinstall
|
||||
@ ( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} package )
|
||||
|
||||
# 'make package_source' makes an installable source package
|
||||
# (platform dependent -- may be .tar.gz, .sh, .dmg, .rpm, .deb. .exe)
|
||||
package_source: cmakeinstall
|
||||
@ ( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} package_source )
|
||||
|
||||
# 'make clang-format' runs clang-format on all source files (if it's installed)
|
||||
clang-format: cmakesetup
|
||||
@ ( cd ${build_dir} ; ${MAKE} ${MY_MAKE_FLAGS} clang-format )
|
||||
|
||||
endif
|
||||
|
||||
# 'make dist' is just a synonym for 'make cmakeinstall'
|
||||
dist : cmakeinstall
|
||||
# 'make dist' is just a synonym for 'make install'
|
||||
dist : install
|
||||
|
||||
TEST_FLAGS += --force-new-ctest-process --output-on-failure
|
||||
|
||||
# 'make test' does a full build and then runs all tests
|
||||
test: cmake
|
||||
test: build
|
||||
@ ${CMAKE} -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests ${TEST_FLAGS}..."
|
||||
@ ( cd ${build_dir} ; PYTHONPATH=${PWD}/${build_dir}/src/python ctest -E broken ${TEST_FLAGS} )
|
||||
@ ( cd ${build_dir} ; \
|
||||
PYTHONPATH=${PWD}/${build_dir}/lib/python/site-packages \
|
||||
ctest -E broken ${TEST_FLAGS} \
|
||||
)
|
||||
@ ( if [[ "${CODECOV}" == "1" ]] ; then \
|
||||
cd ${build_dir} ; \
|
||||
lcov -b . -d . -c -o cov.info ; \
|
||||
lcov --remove cov.info "/usr*" -o cov.info ; \
|
||||
genhtml -o ./cov -t "OIIO test coverage" --num-spaces 4 cov.info ; \
|
||||
genhtml -o ./cov -t "Test coverage" --num-spaces 4 cov.info ; \
|
||||
fi )
|
||||
|
||||
# 'make testall' does a full build and then runs all tests (even the ones
|
||||
# that are expected to fail on some platforms)
|
||||
testall: cmake
|
||||
testall: build
|
||||
${CMAKE} -E cmake_echo_color --switch=$(COLOR) --cyan "Running all tests ${TEST_FLAGS}..."
|
||||
( cd ${build_dir} ; PYTHONPATH=${PWD}/${build_dir}/src/python ctest ${TEST_FLAGS} )
|
||||
( cd ${build_dir} ; PYTHONPATH=${PWD}/${build_dir}/lib/python/site-packages ctest ${TEST_FLAGS} )
|
||||
|
||||
# 'make clean' clears out the build directory for this platform
|
||||
clean:
|
||||
@@ -477,16 +351,18 @@ doxygen:
|
||||
# 'make help' prints important make targets
|
||||
help:
|
||||
@echo "Targets:"
|
||||
@echo " make Build optimized binaries and libraries"
|
||||
@echo " make debug Build unoptimized with symbols"
|
||||
@echo " make profile Build for profiling"
|
||||
@echo " make Build and install optimized binaries and libraries"
|
||||
@echo " make install Build and install optimized binaries and libraries"
|
||||
@echo " make build Build only (no install) optimized binaries and libraries"
|
||||
@echo " make config Just configure cmake, don't build"
|
||||
@echo " make debug Build and install unoptimized with symbols"
|
||||
@echo " make profile Build and install for profiling"
|
||||
@echo " make clean Remove the temporary files in ${build_dir}"
|
||||
@echo " make realclean Remove both ${build_dir} AND ${dist_dir}"
|
||||
@echo " make nuke Remove ALL of build and dist (not just ${platform})"
|
||||
@echo " make test Run tests"
|
||||
@echo " make testall Run all tests, even broken ones"
|
||||
@echo " make clang-format Run clang-format on all the source files"
|
||||
@echo " make doxygen Build the Doxygen docs in ${top_build_dir}/doxygen"
|
||||
@echo ""
|
||||
@echo "Helpful modifiers:"
|
||||
@echo " C++ compiler and build process:"
|
||||
@@ -494,7 +370,7 @@ help:
|
||||
@echo " STOP_ON_WARNING=0 Do not stop building if compiler warns"
|
||||
@echo " OPENIMAGEIO_SITE=xx Use custom site build mods"
|
||||
@echo " MYCC=xx MYCXX=yy Use custom compilers"
|
||||
@echo " USE_CPP=14 Compile in C++14 mode (default is C++11)"
|
||||
@echo " CMAKE_CXX_STANDARD=14 Compile in C++14 mode (default is C++11)"
|
||||
@echo " USE_LIBCPLUSPLUS=1 For clang, use libc++"
|
||||
@echo " GLIBCXX_USE_CXX11_ABI=1 For gcc, use the new string ABI"
|
||||
@echo " EXTRA_CPP_ARGS= Additional args to the C++ command"
|
||||
@@ -507,47 +383,31 @@ help:
|
||||
@echo " CLANG_FORMAT_INCLUDES=... CLANG_FORMAT_EXCLUDES=..."
|
||||
@echo " Customize files for 'make clang-format'"
|
||||
@echo " Linking and libraries:"
|
||||
@echo " HIDE_SYMBOLS=1 Hide symbols not in the public API"
|
||||
@echo " SOVERSION=nn Include the specifed major version number "
|
||||
@echo " in the shared object metadata"
|
||||
@echo " OIIO_LIBNAME_SUFFIX=name Optional name appended to library names"
|
||||
@echo " BUILDSTATIC=1 Build static library instead of shared"
|
||||
@echo " BUILD_SHARED_LIBS=0 Build static library instead of shared"
|
||||
@echo " LINKSTATIC=1 Link with static external libs when possible"
|
||||
@echo " Dependency hints:"
|
||||
@echo " For each dependeny Foo, defining ENABLE_Foo=0 disables it, even"
|
||||
@echo " if found. And you can hint where to find it with Foo_ROOT=path"
|
||||
@echo " Note that it is case sensitive! The list of package names is:"
|
||||
@echo " DCMTK FFmpeg Field3D Freetype GIF JPEGTurbo"
|
||||
@echo " LibRaw OpenColorIO OpenCV OpenGL OpenJpeg OpenVDB"
|
||||
@echo " PTex R3DSDK TBB TIFF Webp"
|
||||
@echo " Finding and Using Dependencies:"
|
||||
@echo " BOOST_HOME=path Custom Boost installation"
|
||||
@echo " OPENEXR_ROOT_DIR=path Custom OpenEXR installation"
|
||||
@echo " ILMBASE_ROOT_DIR=path Custom IlmBase installation"
|
||||
@echo " BOOST_ROOT=path Custom Boost installation"
|
||||
@echo " OPENEXR_ROOT=path Custom OpenEXR installation"
|
||||
@echo " ILMBASE_ROOT=path Custom IlmBase installation"
|
||||
@echo " USE_EXTERNAL_PUGIXML=1 Use the system PugiXML, not the one in OIIO"
|
||||
@echo " USE_QT=0 Skip anything that needs Qt"
|
||||
@echo " USE_OPENGL=0 Skip anything that needs OpenGL"
|
||||
@echo " USE_PYTHON=0 Don't build the Python binding"
|
||||
@echo " PYTHON_VERSION=2.6 Specify the Python version"
|
||||
@echo " USE_FIELD3D=0 Don't build the Field3D plugin"
|
||||
@echo " FIELD3D_HOME=path Custom Field3D installation"
|
||||
@echo " USE_OPENVDB=0 Don't build the OpenVDB plugin"
|
||||
@echo " OPENVDB_LOCATION=path Custom OpenVDB installation"
|
||||
@echo " USE_TBB=0 Don't use Intel TBB, though known"
|
||||
@echo " dependencies (USE_OPENVDB=1) will override this"
|
||||
@echo " TBB_ROOT_DIR=path Custom Intel TBB installation"
|
||||
@echo " USE_FFMPEG=0 Don't build the FFmpeg plugin"
|
||||
@echo " USE_JPEGTURBO=0 Don't build the JPEG-Turbo even if found"
|
||||
@echo " JPEGTURBO_PATH=path Custom path for JPEG-Turbo"
|
||||
@echo " USE_OPENJPEG=0 Don't build the JPEG-2000 plugin"
|
||||
@echo " USE_GIF=0 Don't build the GIF plugin"
|
||||
@echo " GIF_DIR=path Custom GIFLIB installation"
|
||||
@echo " USE_OCIO=0 Don't use OpenColorIO even if found"
|
||||
@echo " OCIO_HOME=path Custom OpenColorIO installation"
|
||||
@echo " USE_NUKE=0 Don't build Nuke plugins"
|
||||
@echo " NUKE_HOME=path Custom Nuke installation"
|
||||
@echo " Nuke_ROOT=path Custom Nuke installation"
|
||||
@echo " NUKE_VERSION=ver Custom Nuke version"
|
||||
@echo " USE_LIBRAW=0 Don't use LibRaw, even if found"
|
||||
@echo " LIBRAW_PATH=path Custom LibRaw installation"
|
||||
@echo " USE_OPENCV=0 Skip anything that needs OpenCV"
|
||||
@echo " USE_PTEX=0 Skip anything that needs PTex"
|
||||
@echo " USE_WEBP=0 Skip anything that needs WebP"
|
||||
@echo " USE_FREETYPE=0 Skip anything that needs Freetype"
|
||||
@echo " OIIO build-time options:"
|
||||
@echo " INSTALL_PREFIX=path Set installation prefix (default: ./${INSTALL_PREFIX_BRIEF})"
|
||||
@echo " INSTALL_PREFIX=path Set installation prefix (default: ./${INSTALL_PREFIX})"
|
||||
@echo " NAMESPACE=name Override namespace base name (default: OpenImageIO)"
|
||||
@echo " EMBEDPLUGINS=0 Don't compile the plugins into libOpenImageIO"
|
||||
@echo " OIIO_THREAD_ALLOW_DCLP=0 Don't allow threads.h to use DCLP"
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
README for OpenImageIO
|
||||
======================
|
||||
|
||||
[](https://github.com/OpenImageIO/oiio/blob/master/LICENSE)
|
||||
[](https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md)
|
||||
[](https://travis-ci.org/OpenImageIO/oiio)
|
||||
[](https://ci.appveyor.com/api/projects/status/a0l32ti7gcoergtf/branch/master)
|
||||
[](https://circleci.com/gh/OpenImageIO/oiio/tree/master)
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/2694)
|
||||
|
||||
|
||||
@@ -67,8 +66,7 @@ OpenImageIO consists of:
|
||||
Licensing
|
||||
---------
|
||||
|
||||
OpenImageIO is (c) Copyright 2008-2019 by Larry Gritz et al.
|
||||
All Rights Reserved.
|
||||
OpenImageIO is (c) Copyright Contributors to the OpenImageIO project.
|
||||
|
||||
OpenImageIO is distributed using the [modified BSD license](LICENSE.md)
|
||||
(also known as the "new BSD" or "3-clause BSD" license). The documentation
|
||||
@@ -103,10 +101,9 @@ plugins.
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
The primary user and programmer documentation can be found in
|
||||
[src/doc/openimageio.pdf](src/doc/openimageio.pdf) (in a source
|
||||
distribution) or in the share/doc/OpenImageIO/openimageio.pdf file of an
|
||||
installed binary distribution.
|
||||
The primary user and programmer documentation can be found
|
||||
on [openimageio.readthedocs.io](https://openimageio.readthedocs.io/en/latest/)
|
||||
as html or as [PDF](https://readthedocs.org/projects/openimageio/downloads/pdf/latest/).
|
||||
|
||||
|
||||
Contact & reporting problems
|
||||
|
||||
+9
-12
@@ -1,5 +1,5 @@
|
||||
version: '{branch}-{build}'
|
||||
image: Visual Studio 2015
|
||||
image: Previous Visual Studio 2015
|
||||
clone_folder: C:\projects\oiio
|
||||
test: off
|
||||
configuration:
|
||||
@@ -17,6 +17,9 @@ environment:
|
||||
tbs_arch: "x64"
|
||||
tbs_tools: "msvc14"
|
||||
tbs_static_runtime: 0
|
||||
MY_CMAKE_FLAGS: -DUSE_PYTHON=0
|
||||
USE_PYTHON: 0
|
||||
|
||||
|
||||
cache:
|
||||
- C:\tools\vcpkg\installed
|
||||
@@ -60,16 +63,7 @@ install:
|
||||
- vcpkg install openjpeg:"%platform%"-windows
|
||||
- vcpkg install ptex:"%platform%"-windows
|
||||
- vcpkg install libraw:x64-windows
|
||||
|
||||
# These are all deps for qt, install these first to isolate from the
|
||||
# huge time it takes qt to build
|
||||
- vcpkg install double-conversion:x64-windows
|
||||
- vcpkg install harfbuzz:x64-windows
|
||||
- vcpkg install libpq:x64-windows
|
||||
- vcpkg install openssl:x64-windows
|
||||
- vcpkg install pcre2:x64-windows
|
||||
- vcpkg install ragel:x64-windows
|
||||
- vcpkg install sqlite3:x64-windows
|
||||
- vcpkg install pybind11:x64-windows
|
||||
|
||||
# Qt
|
||||
- set CMAKE_PREFIX_PATH=%CMAKE_PREFIX_PATH%;C:\Qt\5.12
|
||||
@@ -109,11 +103,14 @@ build_script:
|
||||
- mkdir build\windows64
|
||||
- cd build\windows64
|
||||
- cmake -G "%CMAKE_PLATFORM%" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=C:\projects\oiio\dist\windows64 \
|
||||
-DUSE_PYTHON=0 -DUSE_PTEX=0 \
|
||||
-DPYTHON_INCLUDE_DIR:PATH=%PYTHON_DIR%/include -DPYTHON_LIBRARY:FILEPATH=%PYTHON_DIR%/libs/python27.lib -DPYTHON_EXECUTABLE:FILEPATH=%PYTHON_DIR%/python.exe -DCMAKE_LIBRARY_PATH=%CMAKE_LIBRARY_PATH% -DCMAKE_INCLUDE_PATH=%CMAKE_INCLUDE_PATH% -DCMAKE_PREFIX_PATH=%CMAKE_PREFIX_PATH% -DOPENEXR_ROOT_DIR=C:\projects\oiio\ext -DVERBOSE=1 -DBUILD_MISSING_DEPS=1 ../..
|
||||
- dir c:\projects\oiio
|
||||
- dir c:\projects\oiio\build
|
||||
- dir c:\projects\oiio\build\windows64
|
||||
- cmake --build . --config %CONFIGURATION%
|
||||
- cmake --build . --config %CONFIGURATION% --target install
|
||||
- dir c:\projects\oiio\dist\windows64
|
||||
|
||||
|
||||
matrix:
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
[requires]
|
||||
zlib/1.2.11
|
||||
libtiff/4.0.9
|
||||
libpng/1.6.37
|
||||
openexr/2.4.0
|
||||
boost/1.70.0
|
||||
libjpeg/9c
|
||||
libjpeg-turbo/2.0.2
|
||||
giflib/5.1.4
|
||||
freetype/2.10.0
|
||||
#opencv/4.1.1@conan/stable
|
||||
openjpeg/2.3.1
|
||||
libwebp/1.0.3
|
||||
tsl-robin-map/0.6.1@tessil/stable
|
||||
tbb/2020.0
|
||||
# To do:
|
||||
# opencolorio? not on conan?
|
||||
# pybind11/2.4.3 - conan doesn't have this minimum version
|
||||
# dcmtk
|
||||
# ffmpeg
|
||||
# field3d
|
||||
# libheif
|
||||
# libraw
|
||||
# openvdb
|
||||
# ptex
|
||||
# qt5
|
||||
# libsquish
|
||||
|
||||
|
||||
[generators]
|
||||
cmake
|
||||
|
||||
[options]
|
||||
#libpng:shared=False
|
||||
+183
-72
@@ -3,18 +3,32 @@ ifneq (${VERBOSE},)
|
||||
$(info Including spi/Makefile-bits)
|
||||
endif
|
||||
|
||||
# For SpComp2 builds, set env OIIO_SPCOMP2=1, and either
|
||||
# For SpComp2 builds, do:
|
||||
#
|
||||
# make OIIO_SPCOMP2=1 spcomp2_install
|
||||
# or
|
||||
# make OIIO_SPCOMP2=1 SPCOMP2_LOCAL_PATH=/test/path spcomp2_install_local
|
||||
#
|
||||
# For Arnold builds, set env OIIO_ARNOLD=1 and just do a regular
|
||||
# "make". We make this the default, so if you want neither an Arnold nor
|
||||
# a SpComp2, you have to set OIIO_ARNOLD=0. If both are set, SpComp2
|
||||
# takes precedence.
|
||||
# For Arnold builds, do:
|
||||
#
|
||||
# make OIIO_ARNOLD=1
|
||||
#
|
||||
# For a Rez-bound build, do:
|
||||
#
|
||||
# make OIIO_SPIREZ=1 spi
|
||||
#
|
||||
# (Options: OIIO_REZ_NAME=blah REZ_PACKAGE_ROOT=path)
|
||||
#
|
||||
# Otherwise a default 'make' will make a fully generic OIIO build.
|
||||
|
||||
OIIO_SPCOMP2 ?= 0
|
||||
OIIO_ARNOLD ?= 1
|
||||
OPENIMAGEIO_SPCOMP2_VERSION ?= 49
|
||||
OIIO_ARNOLD ?= 0
|
||||
OIIO_SPIREZ ?= 0
|
||||
OIIO_REZ_NAME ?= OpenImageIO
|
||||
OIIO_VERS = $(shell grep "OpenImageIO VERSION" CMakeLists.txt | egrep -o "[0-9.]+")
|
||||
ONEVERS = $(shell site/spi/format_version.py ${OIIO_VERS})
|
||||
OPENIMAGEIO_SPCOMP2_VERSION ?= ${ONEVERS}
|
||||
|
||||
ifeq (${OIIO_SPCOMP2},1)
|
||||
$(info Building for SpComp2)
|
||||
OIIO_ARNOLD := 0
|
||||
@@ -25,38 +39,61 @@ ifeq (${OIIO_SPCOMP2},1)
|
||||
else ifeq (${OIIO_ARNOLD},1)
|
||||
$(info Building for Arnold)
|
||||
NAMESPACE ?= 'OpenImageIO_Arnold'
|
||||
PYLIB_LIB_PREFIX ?= 0
|
||||
PYLIB_INCLUDE_SONAME ?= 0
|
||||
else ifeq (${OIIO_SPIREZ},1)
|
||||
$(info Building for Rez distribution)
|
||||
# NAMESPACE ?= 'OpenImageIO'
|
||||
MY_CMAKE_FLAGS += -DOIIO_SPIREZ=1 -DOIIO_REZ_PACKAGE_NAME=${OIIO_REZ_NAME}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_DEBUG_POSTFIX=_d
|
||||
else
|
||||
$(info Building generic OpenImageIO)
|
||||
# NAMESPACE ?= 'OpenImageIO'
|
||||
endif
|
||||
#$(info MAKECMDGOALS = $(MAKECMDGOALS))
|
||||
|
||||
|
||||
MY_CMAKE_FLAGS += -DEXTRA_CPP_ARGS:STRING="-DOIIO_SPI=1" -DOIIO_SITE:STRING=SPI
|
||||
MY_CMAKE_FLAGS += -DSPI_TESTS=1
|
||||
SPCOMP2_ROOT ?= /shots/spi/home/lib/SpComp2
|
||||
|
||||
|
||||
## Detect which SPI platform and set $platform, $COMPILER, $SPCOMP2_COMPILER,
|
||||
## and PYTHON_VERSION. Lots of other decisions are based on these.
|
||||
ifeq (${SP_OS}, rhel7)
|
||||
# Rhel7 (current)
|
||||
platform := rhel7
|
||||
SPCOMP2_COMPILER ?= gcc48m64
|
||||
SPI_COMPILER_PLATFORM ?= gcc-6.3
|
||||
ifeq (${SPI_COMPILER_PLATFORM},gcc-4.8)
|
||||
SPCOMP2_COMPILER ?= gcc48m64
|
||||
CMAKE_CXX_STANDARD ?= 11
|
||||
LLVM_VERSION ?= 9.0.1-1
|
||||
else
|
||||
SPCOMP2_COMPILER ?= gcc63
|
||||
CMAKE_CXX_STANDARD ?= 14
|
||||
LLVM_VERSION ?= 10.0.0-1
|
||||
endif
|
||||
SP_PLATFORM ?= linux
|
||||
SP_PROC ?= x86_64
|
||||
SP_REZ_OS ?= CentOS-7
|
||||
else ifeq (${platform}, macosx)
|
||||
# Generic OSX machines (including LG's laptop)
|
||||
COMPILER ?= clang
|
||||
SPCOMP2_COMPILER ?= clang
|
||||
PYTHON_VERSION ?= 2.6
|
||||
SP_OS ?= macosx
|
||||
SP_PLATFORM ?= macosx
|
||||
SP_PROC ?= x86_64
|
||||
SP_REZ_OS ?= MacOS
|
||||
else
|
||||
$(error Unknown SP_OS=${SP_OS} platform=${platform})
|
||||
endif # endif ${SP_OS}
|
||||
|
||||
PYTHON_VERSION ?= 2.7
|
||||
MY_CMAKE_FLAGS += -DSP_OS=${SP_OS} -DSP_PLATFORM=${SP_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DSP_PROC=${SP_PROC} -DSP_REZ_OS=${SP_REZ_OS}
|
||||
MY_CMAKE_FLAGS += -DSPI_COMPILER_PLATFORM=${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DEXTRA_CPP_ARGS:STRING="-DOIIO_SPI=1" -DOIIO_SITE:STRING=spi
|
||||
MY_CMAKE_FLAGS += -DSPI_TESTS=1
|
||||
MY_CMAKE_FLAGS += -DOIIO_NAMESPACE_INCLUDE_PATCH=1
|
||||
REZ_PACKAGE_ROOT ?= /shots/spi/home/software/packages
|
||||
SPCOMP2_ROOT ?= /shots/spi/home/lib/SpComp2
|
||||
|
||||
|
||||
## Rhel7 (current)
|
||||
ifeq (${SP_OS}, rhel7)
|
||||
USE_CPP ?= 11
|
||||
USE_SIMD ?= sse4.1,aes
|
||||
CMAKE ?= cmake
|
||||
USE_NINJA ?= 1
|
||||
@@ -69,6 +106,8 @@ ifeq (${SP_OS}, rhel7)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_INSTALL_LIBDIR="${INSTALL_PREFIX}/lib"
|
||||
ifeq (${OIIO_SPCOMP2},1)
|
||||
MY_CMAKE_FLAGS += -DPYTHON_SITE_DIR="${INSTALL_PREFIX}/python"
|
||||
else ifeq (${OIIO_SPIREZ},1)
|
||||
MY_CMAKE_FLAGS += -DPYTHON_SITE_DIR="${INSTALL_PREFIX}/python"
|
||||
else ifeq (${OIIO_ARNOLD},1)
|
||||
OIIO_LIBNAME_SUFFIX=_Arnold
|
||||
endif
|
||||
@@ -78,22 +117,21 @@ ifeq (${SP_OS}, rhel7)
|
||||
#
|
||||
# A variety of tags can be used to try specific versions of gcc or
|
||||
# clang from the site-specific places we have installed them.
|
||||
LLVM_DIRECTORY ?= /shots/spi/home/lib/arnold/rhel7/llvm_8.0.0
|
||||
ifeq (${COMPILER},clang6)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_6.0.1
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
else ifeq (${COMPILER},clang7)
|
||||
LLVM_DIRECTORY ?= /shots/spi/home/software/packages/llvm/${LLVM_VERSION}/${SPI_COMPILER_PLATFORM}
|
||||
ifeq (${COMPILER},clang7)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_7.0.1
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
else ifeq (${COMPILER},clang7)
|
||||
else ifeq (${COMPILER},clang8)
|
||||
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_8.0.0
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
else ifeq (${COMPILER},clang9)
|
||||
LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/9.0.1-1/${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang10)
|
||||
LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/10.0.0-1/${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
else ifeq (${COMPILER},clang)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
else ifeq (${COMPILER}, gcc6)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/gcc \
|
||||
@@ -105,15 +143,20 @@ ifeq (${SP_OS}, rhel7)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
|
||||
endif
|
||||
ifeq (${SPI_COMPILER_PLATFORM},gcc-4.8)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" \
|
||||
-DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr" \
|
||||
-DTOOLCHAIN_FLAGS="--gcc-toolchain=/usr"
|
||||
endif
|
||||
|
||||
#
|
||||
# Boost
|
||||
#
|
||||
BOOSTVERS ?= 1.55
|
||||
BOOSTVERS ?= 1.70
|
||||
BOOSTSPSUFFIX ?=
|
||||
BOOSTVERSSP=${BOOSTVERS}${BOOSTSPSUFFIX}
|
||||
MY_CMAKE_FLAGS += -DBOOST_VERS_SP=${BOOSTVERSSP}
|
||||
# $(info BOOSTVERSSP ${BOOSTVERSSP})
|
||||
ifeq (${BOOSTVERS},1.55)
|
||||
SPBOOST_INC_DIR ?= /usr/include/boost_${BOOSTVERSSP}
|
||||
@@ -156,8 +199,7 @@ ifeq (${SP_OS}, rhel7)
|
||||
-DPYTHON_VERSION_MINOR=6 \
|
||||
-DPYTHON_VERSION_PATCH=3 \
|
||||
-DPython_ADDITIONAL_VERSIONS="${PYTHON_VERSION}"
|
||||
endif
|
||||
ifeq (${PYTHON_VERSION},3.7)
|
||||
else ifeq (${PYTHON_VERSION},3.7)
|
||||
# Special sauce for Python 3.7
|
||||
PYTHON_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}m
|
||||
PYTHON_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}m.so
|
||||
@@ -168,49 +210,81 @@ ifeq (${SP_OS}, rhel7)
|
||||
-DPYTHON_VERSION_MINOR=7 \
|
||||
-DPYTHON_VERSION_PATCH=3 \
|
||||
-DPython_ADDITIONAL_VERSIONS="${PYTHON_VERSION}"
|
||||
else ifeq (${PYTHON_VERSION},2.7)
|
||||
# Special sauce for Python 2.7
|
||||
PYTHON_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}
|
||||
PYTHON_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}.so
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DPYTHONINTERP_FOUND=1 \
|
||||
-DPYTHON_VERSION_STRING=2.7.5 \
|
||||
-DPYTHON_VERSION_MAJOR=2 \
|
||||
-DPYTHON_VERSION_MINOR=7 \
|
||||
-DPYTHON_VERSION_PATCH=5 \
|
||||
-DPython_ADDITIONAL_VERSIONS="${PYTHON_VERSION}"
|
||||
endif
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DPYTHON_INCLUDE_DIR:STRING=${PYTHON_INCLUDE_DIR} \
|
||||
-DPYTHON_LIBRARY:STRING=${PYTHON_LIBRARY}
|
||||
-DPYTHON_LIBRARY:STRING=${PYTHON_LIBRARY} \
|
||||
-Dpybind11_ROOT:STRING=${REZ_PACKAGE_ROOT}/pybind11/2.4.3/python-${PYTHON_VERSION}
|
||||
|
||||
# Set our preferred OpenEXR path, but allow env variable to override
|
||||
# with custom/test version.
|
||||
ifeq (${OPENEXR_ROOT_DIR},)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DOPENEXR_INCLUDE_DIR=/usr/include/OpenEXR2 \
|
||||
-DOPENEXR_LIBRARY_DIR=/usr/lib64/OpenEXR2
|
||||
endif
|
||||
OPENEXR_VERSION ?= 2.4.0
|
||||
OpenEXR_ROOT ?= ${REZ_PACKAGE_ROOT}/OpenEXR/${OPENEXR_VERSION}/${SPI_COMPILER_PLATFORM}/python-${PYTHON_VERSION}
|
||||
MY_CMAKE_FLAGS += -DOpenEXR_ROOT=${OpenEXR_ROOT}
|
||||
|
||||
#
|
||||
# SpComp2 and other weird SPI-installed packages
|
||||
#
|
||||
OCIO_SPCOMP_VERSION ?= 2
|
||||
OPENVDB_SPCOMP2_VERSION ?= v5020000
|
||||
NUKE_VERSION ?= 11.2v3
|
||||
SPCOMP2_FULLBOOST_SUFFIX = ${SP_OS}-${SPCOMP2_COMPILER}-boost${shell echo ${BOOSTVERSSP} | sed "s/\\.//"}
|
||||
# $(info SPCOMP2_FULLBOOST_SUFFIX ${SPCOMP2_FULLBOOST_SUFFIX})
|
||||
OCIO_PATH ?= ${SPCOMP2_ROOT}/OpenColorIO/${SP_OS}-${SPCOMP2_COMPILER}/v${OCIO_SPCOMP_VERSION}
|
||||
ifneq (${OIIO_SPCOMP2},1)
|
||||
ifeq (${OIIO_SPCOMP2},1)
|
||||
OCIO_SPCOMP_VERSION ?= 2
|
||||
OpenColorIO_ROOT ?= ${SPCOMP2_ROOT}/OpenColorIO/${SP_OS}-${SPCOMP2_COMPILER}/v${OCIO_SPCOMP_VERSION}
|
||||
# OPENVDB_SPCOMP2_VERSION ?= v6020001
|
||||
# OpenVDB_ROOT ?= ${SPCOMP2_ROOT}/openvdb/${SPCOMP2_FULLBOOST_SUFFIX}/${OPENVDB_SPCOMP2_VERSION}
|
||||
OPENVDB_VERSION ?= 6.2.2-3
|
||||
OpenVDB_ROOT ?= ${REZ_PACKAGE_ROOT}/OpenVDB/${OPENVDB_VERSION}/${SPI_COMPILER_PLATFORM}/python-${PYTHON_VERSION}/boost-${BOOSTVERS}
|
||||
else
|
||||
OPENCOLORIO_VERSION ?= 1.1.1-1
|
||||
OpenColorIO_ROOT ?= ${REZ_PACKAGE_ROOT}/OpenColorIO/${OPENCOLORIO_VERSION}/${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DOPENCOLORIO_LIBRARY=${OpenColorIO_ROOT}/lib/libOpenColorIO_SPI.so
|
||||
# Anybody remember why we needed Field3d disabled for SpComp2?
|
||||
FIELD3D_HOME ?= ${SPCOMP2_ROOT}/Field3D/${SPCOMP2_FULLBOOST_SUFFIX}/v412
|
||||
endif
|
||||
OPENVDB_ROOT_DIR ?= ${SPCOMP2_ROOT}/openvdb/${SPCOMP2_FULLBOOST_SUFFIX}/${OPENVDB_SPCOMP2_VERSION}
|
||||
TBB_ROOT_DIR ?= /net/apps/rhel7/intel/tbb
|
||||
Field3D_ROOT ?= ${SPCOMP2_ROOT}/Field3D/${SPCOMP2_FULLBOOST_SUFFIX}/v412
|
||||
OPENVDB_VERSION ?= 6.2.2-3
|
||||
OpenVDB_ROOT ?= ${REZ_PACKAGE_ROOT}/OpenVDB/${OPENVDB_VERSION}/${SPI_COMPILER_PLATFORM}/python-${PYTHON_VERSION}/boost-${BOOSTVERS}
|
||||
endif
|
||||
TBB_ROOT ?= /net/apps/rhel7/intel/tbb
|
||||
TBB_LIBRARY ?= /net/apps/rhel7/intel/tbb/lib/intel64/gcc4.7
|
||||
Libheif_ROOT=/shots/spi/home/lib/arnold/rhel7/libheif-1.3.2
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DOCIO_PATH=${OCIO_PATH} \
|
||||
-DFIELD3D_HOME=${FIELD3D_HOME} \
|
||||
-DOPENVDB_ROOT_DIR=${OPENVDB_ROOT_DIR} \
|
||||
-DTBB_ROOT_DIR=${TBB_ROOT_DIR} \
|
||||
-DOpenColorIO_ROOT=${OpenColorIO_ROOT} \
|
||||
-DField3D_ROOT=${Field3D_ROOT} \
|
||||
-DOpenVDB_ROOT=${OpenVDB_ROOT} \
|
||||
-DTBB_ROOT=${TBB_ROOT} \
|
||||
-DTBB_LIBRARY=${TBB_LIBRARY} \
|
||||
-DTBB_USE_DEBUG_BUILD=0 \
|
||||
-DHDF5_CUSTOM=1 \
|
||||
-DHDF5_LIBRARIES=/usr/lib64/libhdf5.so \
|
||||
-DNuke_ROOT=/net/apps/rhel7/foundry/nuke${NUKE_VERSION} \
|
||||
-DLIBRAW_INCLUDEDIR_HINT=/usr/include/libraw-0.18.11 \
|
||||
-DLIBRAW_LIBDIR_HINT=/usr/lib64/libraw-0.18.11 \
|
||||
-DLIBHEIF_PATH=/shots/spi/home/lib/arnold/rhel7/libheif-1.3.2 \
|
||||
-DLibheif_ROOT=${Libheif_ROOT} \
|
||||
-DFFMPEG_INCLUDES=/usr/include/ffmpegroot/ffmpeg34 \
|
||||
-DFFMPEG_LIBRARIES="/usr/lib64/ffmpegroot/ffmpeg345/libavcodec.so;/usr/lib64/ffmpegroot/ffmpeg345/libavformat.so;/usr/lib64/ffmpegroot/ffmpeg345/libavutil.so;/usr/lib64/ffmpegroot/ffmpeg345/libswscale.so;" \
|
||||
-DUSE_OPENCV=0 \
|
||||
-DHIDE_SYMBOLS=1 \
|
||||
-DVISIBILITY_MAP_FILE:STRING="${working_dir}/site/spi/hidesymbols.map"
|
||||
|
||||
# LibRaw
|
||||
ifeq (${SPI_COMPILER_PLATFORM},gcc-4.8)
|
||||
MY_CMAKE_FLAGS += -DLIBRAW_INCLUDEDIR_HINT=/usr/include/libraw-0.18.11
|
||||
MY_CMAKE_FLAGS += -DLIBRAW_LIBDIR_HINT=/usr/lib64/libraw-0.18.11
|
||||
LIBRAW_LIBDIR = /usr/lib64/libraw-0.18.11
|
||||
else
|
||||
LibRaw_ROOT ?= /shots/spi/home/software/packages/LibRaw/0.20.0-dev3/${SPI_COMPILER_PLATFORM}
|
||||
MY_CMAKE_FLAGS += -DLibRaw_ROOT=${LibRaw_ROOT}
|
||||
LIBRAW_LIBDIR = ${LibRaw_ROOT}/lib
|
||||
endif
|
||||
|
||||
# Use libtiff I built myself, static, and try to hide its symbols.
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DTIFF_INCLUDE_DIR:STRING=/usr/include \
|
||||
@@ -244,12 +318,26 @@ else ifeq (${platform}, macosx)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
|
||||
USE_LIBCPLUSPLUS := 0
|
||||
else ifeq (${COMPILER},clang6)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_1/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_1/bin/clang++
|
||||
else ifeq (${COMPILER}, gcc9)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9
|
||||
USE_LIBCPLUSPLUS := 0
|
||||
else ifeq (${COMPILER}, gcc10)
|
||||
MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
|
||||
USE_LIBCPLUSPLUS := 0
|
||||
else ifeq (${COMPILER},clang7)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@7/7.0.1/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@7/7.0.1/bin/clang++
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/opt/llvm@7/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/usr/local/llvm@7/bin/clang++
|
||||
else ifeq (${COMPILER},clang8)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm/8.0.0/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/8.0.0/bin/clang++
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/opt/llvm@8/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@8/bin/clang++
|
||||
else ifeq (${COMPILER},clang9)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/opt/llvm@9/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@9/bin/clang++
|
||||
else ifeq (${COMPILER},clang10)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++
|
||||
else ifeq (${COMPILER},clang)
|
||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
else ifeq (${COMPILER},gcc)
|
||||
@@ -269,13 +357,35 @@ endif # endif ${SP_OS}
|
||||
|
||||
|
||||
|
||||
ifeq (${OIIO_SPIREZ},1)
|
||||
# Rpath touch-ups
|
||||
# NOTE: This MUST match the order and naming of the Rez variants
|
||||
# set in rez/package.py.in
|
||||
REZ_INSTALL_PATH := ${REZ_PACKAGE_ROOT}/${OIIO_REZ_NAME}/${OIIO_VERS}/${SPI_COMPILER_PLATFORM}/python-${PYTHON_VERSION}/boost-${BOOSTVERSSP}
|
||||
MY_CMAKE_FLAGS += -DOIIO_REZ_INSTALL_PATH=${REZ_INSTALL_PATH}
|
||||
MY_CMAKE_FLAGS += -DCMAKE_INSTALL_RPATH=${REZ_INSTALL_PATH}/lib
|
||||
INSTALL_PREFIX := ${working_dir}/dist/${platform}
|
||||
endif
|
||||
|
||||
|
||||
ifneq (${VERBOSE},)
|
||||
$(info MY_CMAKE_FLAGS: $(MY_CMAKE_FLAGS))
|
||||
endif
|
||||
|
||||
|
||||
|
||||
############################################################################
|
||||
# SpComp2 magic incantations follow. Here be dragons.
|
||||
############################################################################
|
||||
|
||||
|
||||
CPPSTDSUFFIX=
|
||||
SPCOMP2_INSTALL_ROOT ?= $(SPCOMP2_ROOT)
|
||||
BOOSTVERSSP?=${BOOSTVERS}${BOOSTSPSUFFIX}
|
||||
SPARCH=${SP_OS}-$(SPCOMP2_COMPILER)$(CPPSTDSUFFIX)-boost$(subst .,,$(BOOSTVERSSP))
|
||||
OIIO_SPCOMP2_PATH := ${SPCOMP2_INSTALL_ROOT}/OpenImageIO/${SPARCH}/v${OPENIMAGEIO_SPCOMP2_VERSION}
|
||||
# $(info New rhel7 OIIO_SPCOMP2_PATH is ${OIIO_SPCOMP2_PATH})
|
||||
|
||||
PYVERNOSPACE=${shell echo ${PYTHON_VERSION} | sed "s/\\.//"}
|
||||
SPPYARCH=$(SPARCH)-py$(PYVERNOSPACE)
|
||||
|
||||
@@ -283,33 +393,35 @@ SPPYARCH=$(SPARCH)-py$(PYVERNOSPACE)
|
||||
|
||||
all: dist
|
||||
|
||||
.PHONY: spcomp2_install spcomp2_install_local clean all
|
||||
local: dist
|
||||
|
||||
.PHONY: spcomp2_install spcomp2_install_local spi clean all
|
||||
|
||||
spi: MY_CMAKE_FLAGS += -DCMAKE_DEBUG_POSTFIX=_d
|
||||
spi: debug dist
|
||||
|
||||
|
||||
|
||||
comma:= ,
|
||||
empty:=
|
||||
space:= $(empty) $(empty)
|
||||
|
||||
INSTALL_BIN_LOCATION = /shots/spi/home/bin/${SP_OS}
|
||||
SPCOMP2_INSTALL_ROOT ?= $(SPCOMP2_ROOT)
|
||||
OIIO_SPCOMP2_PATH := ${SPCOMP2_INSTALL_ROOT}/OpenImageIO/$(SPARCH)/v${OPENIMAGEIO_SPCOMP2_VERSION}
|
||||
INSTALL_SPCOMP2_CURRENT = $(SPCOMP2_INSTALL_ROOT)/OpenImageIO/$(SPARCH)/v$(OPENIMAGEIO_SPCOMP2_VERSION)
|
||||
# $(info New rhel7 OIIO_SPCOMP2_PATH is ${OIIO_SPCOMP2_PATH})
|
||||
INSTALL_BIN_LOCATION = $(INSTALL_SPCOMP2_CURRENT)/bin
|
||||
SPCOMP2_LOCAL_PATH ?= /net/soft_scratch/users/$(USER)/SpComp2_test
|
||||
|
||||
SPCOMP2_RPATH_OPT ?= ${OCIO_PATH}/lib:${FIELD3D_HOME}/lib:/usr/lib64/libraw-0.18.11:${OPENVDB_ROOT_DIR}/lib:/shots/spi/home/lib/arnold/rhel7/libheif-1.3.2/lib:shots/spi/home/lib/arnold/rhel7/libde265-1.0.3/lib:${SPBOOST_LIB_DIR}
|
||||
SPCOMP2_RPATH_DEBUG ?= ${OCIO_PATH}/lib/debug:${FIELD3D_HOME}/lib/debug:/usr/lib64/libraw-0.18.11:${OPENVDB_ROOT_DIR}/lib/debug:/shots/spi/home/lib/arnold/rhel7/libheif-1.3.2/lib:shots/spi/home/lib/arnold/rhel7/libde265-1.0.3/lib:${SPBOOST_LIB_DIR}
|
||||
PYSPCOMP2_RPATH_OPT ?= ${SPCOMP2_RPATH_OPT}:${OIIO_SPCOMP2_PATH}/lib:${PYTHON_LIBRARY_DIR}
|
||||
PYSPCOMP2_RPATH_DEBUG ?= ${SPCOMP2_RPATH_DEBUG}:${OIIO_SPCOMP2_PATH}/lib/debug:${PYTHON_LIBRARY_DIR}
|
||||
|
||||
|
||||
spcomp2_install_local: SPCOMP2_INSTALL_ROOT = $(SPCOMP2_LOCAL_PATH)
|
||||
spcomp2_install_local: INSTALL_BIN_LOCATION = $(INSTALL_SPCOMP2_CURRENT)/bin
|
||||
spcomp2_install_local: spcomp2_install
|
||||
|
||||
local: dist
|
||||
SPCOMP2_RPATH_OPT ?= ${OpenEXR_ROOT}/lib:${OpenColorIO_ROOT}/lib:${Field3D_ROOT}/lib:${LIBRAW_LIBDIR}:${OpenVDB_ROOT}/lib:${Libheif_ROOT}/lib:shots/spi/home/lib/arnold/rhel7/libde265-1.0.3/lib:${TBB_ROOT}/lib/intel64/gcc4.7:${SPBOOST_LIB_DIR}
|
||||
SPCOMP2_RPATH_DEBUG ?= ${OpenEXR_ROOT}/lib:${OpenColorIO_ROOT}/lib:${Field3D_ROOT}/lib/debug:${LIBRAW_LIBDIR}:${OpenVDB_ROOT}/lib/debug:${Libheif_ROOT}/lib:shots/spi/home/lib/arnold/rhel7/libde265-1.0.3/lib:${TBB_ROOT}/lib/intel64/gcc4.7:${SPBOOST_LIB_DIR}
|
||||
PYSPCOMP2_RPATH_OPT ?= ${SPCOMP2_RPATH_OPT}:${OIIO_SPCOMP2_PATH}/lib:${PYTHON_LIBRARY_DIR}
|
||||
PYSPCOMP2_RPATH_DEBUG ?= ${SPCOMP2_RPATH_DEBUG}:${OIIO_SPCOMP2_PATH}/lib/debug:${PYTHON_LIBRARY_DIR}
|
||||
|
||||
|
||||
spcomp2: MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \
|
||||
-DCMAKE_SKIP_BUILD_RPATH:BOOL=OFF \
|
||||
-DCMAKE_INSTALL_RPATH=$(SPCOMP2_INSTALL_ROOT)/OpenImageIO/$(SPARCH)/v$(OPENIMAGEIO_SPCOMP2_VERSION)/lib \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
|
||||
-DPYLIB_INCLUDE_SONAME:BOOL=ON \
|
||||
@@ -319,7 +431,7 @@ spcomp2: MY_CMAKE_FLAGS += \
|
||||
spcomp2: dist
|
||||
|
||||
spcomp2_debug: MY_CMAKE_FLAGS += \
|
||||
-DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \
|
||||
-DCMAKE_SKIP_BUILD_RPATH:BOOL=OFF \
|
||||
-DCMAKE_INSTALL_RPATH=$(SPCOMP2_INSTALL_ROOT)/OpenImageIO/$(SPARCH)/v$(OPENIMAGEIO_SPCOMP2_VERSION)/lib \
|
||||
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \
|
||||
-DPYLIB_INCLUDE_SONAME:BOOL=ON \
|
||||
@@ -372,4 +484,3 @@ spcomp2_install: spcomp2_install_fixup_${SP_OS}
|
||||
--srcdir=${dist_dir}/python \
|
||||
--builddir_o=${dist_dir}/python \
|
||||
--builddir_d=${dist_dir}.debug/python
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<cfg>
|
||||
<version>@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.@PROJECT_VERSION_TWEAK@</version>
|
||||
<appdir architecture="@SP_OS@">@OIIO_REZ_INSTALL_PATH@</appdir>
|
||||
<launchprogram></launchprogram>
|
||||
<setup></setup>
|
||||
</cfg>
|
||||
@@ -0,0 +1,16 @@
|
||||
option (${PROJ_NAME}_SPIREZ "Enable extra bits for building for SPI Rez install" OFF)
|
||||
set (${PROJ_NAME}_REZ_PACKAGE_NAME CACHE STRING "${PROJECT_NAME}")
|
||||
|
||||
if (${PROJ_NAME}_SPIREZ)
|
||||
# message (STATUS "Creating package.py from package.py.in")
|
||||
# configure_file ("${PROJECT_SOURCE_DIR}/site/spi/rez/package.py.in" "${CMAKE_BINARY_DIR}/package.py")
|
||||
|
||||
set (appcfg_filename "${CMAKE_BINARY_DIR}/${PROJECT_NAME}_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}.xml")
|
||||
configure_file ("${PROJECT_SOURCE_DIR}/site/spi/appcfg.xml.in" "${appcfg_filename}")
|
||||
|
||||
# install (FILES ${CMAKE_BINARY_DIR}/package.py
|
||||
# "${PROJECT_SOURCE_DIR}/site/spi/rez/CMakeLists.txt"
|
||||
# ${appcfg_filename}
|
||||
# DESTINATION ${CMAKE_INSTALL_PREFIX}
|
||||
# COMPONENT developer)
|
||||
endif ()
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# This helper script takes a major.minor.patch semantic version string
|
||||
# ("2.1.1") and reformats it into the dot-less zero-padded version like
|
||||
# "20101". This is necessary to turn external release designations into
|
||||
# integer SpComp2 version numbers.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import
|
||||
import sys
|
||||
|
||||
if len(sys.argv) != 2 :
|
||||
print('Need 1 argument: version number with dots')
|
||||
exit(1)
|
||||
|
||||
vers = sys.argv[1]
|
||||
parts = vers.split('.')
|
||||
print ('{:d}{:02d}{:02d}'.format(int(parts[0]), int(parts[1]), int(parts[2])))
|
||||
@@ -1 +1,5 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
add_oiio_plugin (bmpinput.cpp bmpoutput.cpp bmp_pvt.cpp)
|
||||
|
||||
@@ -1,34 +1,12 @@
|
||||
/*
|
||||
Copyright 2008-2009 Larry Gritz and the other authors and contributors.
|
||||
All Rights Reserved.
|
||||
// Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the software's owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(This is the Modified BSD License)
|
||||
*/
|
||||
#include "bmp_pvt.h"
|
||||
|
||||
#include <OpenImageIO/fmath.h>
|
||||
|
||||
OIIO_PLUGIN_NAMESPACE_BEGIN
|
||||
|
||||
namespace bmp_pvt {
|
||||
|
||||
@@ -1,39 +1,12 @@
|
||||
/*
|
||||
Copyright 2008-2009 Larry Gritz and the other authors and contributors.
|
||||
All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the software's owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(This is the Modified BSD License)
|
||||
*/
|
||||
// Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include <OpenImageIO/filesystem.h>
|
||||
#include <OpenImageIO/fmath.h>
|
||||
#include <OpenImageIO/imageio.h>
|
||||
|
||||
OIIO_PLUGIN_NAMESPACE_BEGIN
|
||||
@@ -155,14 +128,14 @@ public:
|
||||
void* data) override;
|
||||
|
||||
private:
|
||||
int m_padded_scanline_size;
|
||||
int64_t m_padded_scanline_size;
|
||||
int m_pad_size;
|
||||
FILE* m_fd;
|
||||
bmp_pvt::BmpFileHeader m_bmp_header;
|
||||
bmp_pvt::DibInformationHeader m_dib_header;
|
||||
std::string m_filename;
|
||||
std::vector<bmp_pvt::color_table> m_colortable;
|
||||
fpos_t m_image_start;
|
||||
int64_t m_image_start;
|
||||
void init(void)
|
||||
{
|
||||
m_padded_scanline_size = 0;
|
||||
@@ -193,12 +166,12 @@ public:
|
||||
stride_t ystride, stride_t zstride) override;
|
||||
|
||||
private:
|
||||
int m_padded_scanline_size;
|
||||
int64_t m_padded_scanline_size;
|
||||
FILE* m_fd;
|
||||
std::string m_filename;
|
||||
bmp_pvt::BmpFileHeader m_bmp_header;
|
||||
bmp_pvt::DibInformationHeader m_dib_header;
|
||||
fpos_t m_image_start;
|
||||
int64_t m_image_start;
|
||||
unsigned int m_dither;
|
||||
std::vector<unsigned char> m_tilebuffer;
|
||||
|
||||
|
||||
@@ -1,32 +1,6 @@
|
||||
/*
|
||||
Copyright 2008-2009 Larry Gritz and the other authors and contributors.
|
||||
All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the software's owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(This is the Modified BSD License)
|
||||
*/
|
||||
// Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
#include "bmp_pvt.h"
|
||||
|
||||
OIIO_PLUGIN_NAMESPACE_BEGIN
|
||||
@@ -77,24 +51,24 @@ BmpInput::open(const std::string& name, ImageSpec& spec)
|
||||
|
||||
m_fd = Filesystem::fopen(m_filename, "rb");
|
||||
if (!m_fd) {
|
||||
error("Could not open file \"%s\"", name.c_str());
|
||||
errorf("Could not open file \"%s\"", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
// we read header of the file that we think is BMP file
|
||||
if (!m_bmp_header.read_header(m_fd)) {
|
||||
error("\"%s\": wrong bmp header size", m_filename.c_str());
|
||||
errorf("\"%s\": wrong bmp header size", m_filename);
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
if (!m_bmp_header.isBmp()) {
|
||||
error("\"%s\" is not a BMP file, magic number doesn't match",
|
||||
m_filename.c_str());
|
||||
errorf("\"%s\" is not a BMP file, magic number doesn't match",
|
||||
m_filename);
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
if (!m_dib_header.read_header(m_fd)) {
|
||||
error("\"%s\": wrong bitmap header size", m_filename.c_str());
|
||||
errorf("\"%s\": wrong bitmap header size", m_filename);
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
@@ -140,7 +114,7 @@ BmpInput::open(const std::string& name, ImageSpec& spec)
|
||||
|
||||
// file pointer is set to the beginning of image data
|
||||
// we save this position - it will be helpfull in read_native_scanline
|
||||
fgetpos(m_fd, &m_image_start);
|
||||
m_image_start = Filesystem::ftell(m_fd);
|
||||
|
||||
spec = m_spec;
|
||||
return true;
|
||||
@@ -149,7 +123,7 @@ BmpInput::open(const std::string& name, ImageSpec& spec)
|
||||
|
||||
|
||||
bool
|
||||
BmpInput::read_native_scanline(int subimage, int miplevel, int y, int z,
|
||||
BmpInput::read_native_scanline(int subimage, int miplevel, int y, int /*z*/,
|
||||
void* data)
|
||||
{
|
||||
lock_guard lock(m_mutex);
|
||||
@@ -162,17 +136,17 @@ BmpInput::read_native_scanline(int subimage, int miplevel, int y, int z,
|
||||
// if the height is positive scanlines are stored bottom-up
|
||||
if (m_dib_header.width >= 0)
|
||||
y = m_spec.height - y - 1;
|
||||
const int scanline_off = y * m_padded_scanline_size;
|
||||
const int64_t scanline_off = y * m_padded_scanline_size;
|
||||
|
||||
std::vector<unsigned char> fscanline(m_padded_scanline_size);
|
||||
fsetpos(m_fd, &m_image_start);
|
||||
fseek(m_fd, scanline_off, SEEK_CUR);
|
||||
size_t n = fread(&fscanline[0], 1, m_padded_scanline_size, m_fd);
|
||||
std::unique_ptr<unsigned char[]> fscanline(
|
||||
new unsigned char[m_padded_scanline_size]);
|
||||
Filesystem::fseek(m_fd, m_image_start + scanline_off, SEEK_SET);
|
||||
size_t n = fread(fscanline.get(), 1, m_padded_scanline_size, m_fd);
|
||||
if (n != (size_t)m_padded_scanline_size) {
|
||||
if (feof(m_fd))
|
||||
error("Hit end of file unexpectedly");
|
||||
errorf("Hit end of file unexpectedly");
|
||||
else
|
||||
error("read error");
|
||||
errorf("read error");
|
||||
return false; // Read failed
|
||||
}
|
||||
|
||||
@@ -183,17 +157,18 @@ BmpInput::read_native_scanline(int subimage, int miplevel, int y, int z,
|
||||
for (unsigned int i = 0; i < m_spec.scanline_bytes();
|
||||
i += m_spec.nchannels)
|
||||
std::swap(fscanline[i], fscanline[i + 2]);
|
||||
memcpy(data, &fscanline[0], m_spec.scanline_bytes());
|
||||
memcpy(data, fscanline.get(), m_spec.scanline_bytes());
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<unsigned char> mscanline(m_spec.scanline_bytes());
|
||||
size_t scanline_bytes = m_spec.scanline_bytes();
|
||||
std::unique_ptr<unsigned char[]> mscanline(
|
||||
new unsigned char[scanline_bytes]);
|
||||
if (m_dib_header.bpp == 16) {
|
||||
const uint16_t RED = 0x7C00;
|
||||
const uint16_t GREEN = 0x03E0;
|
||||
const uint16_t BLUE = 0x001F;
|
||||
for (unsigned int i = 0, j = 0; j < m_spec.scanline_bytes();
|
||||
i += 2, j += 3) {
|
||||
for (unsigned int i = 0, j = 0; j < scanline_bytes; i += 2, j += 3) {
|
||||
uint16_t pixel = (uint16_t) * (&fscanline[i]);
|
||||
mscanline[j] = (uint8_t)((pixel & RED) >> 8);
|
||||
mscanline[j + 1] = (uint8_t)((pixel & GREEN) >> 4);
|
||||
@@ -201,16 +176,14 @@ BmpInput::read_native_scanline(int subimage, int miplevel, int y, int z,
|
||||
}
|
||||
}
|
||||
if (m_dib_header.bpp == 8) {
|
||||
for (unsigned int i = 0, j = 0; j < m_spec.scanline_bytes();
|
||||
++i, j += 3) {
|
||||
for (unsigned int i = 0, j = 0; j < scanline_bytes; ++i, j += 3) {
|
||||
mscanline[j] = m_colortable[fscanline[i]].r;
|
||||
mscanline[j + 1] = m_colortable[fscanline[i]].g;
|
||||
mscanline[j + 2] = m_colortable[fscanline[i]].b;
|
||||
}
|
||||
}
|
||||
if (m_dib_header.bpp == 4) {
|
||||
for (unsigned int i = 0, j = 0; j + 6 < m_spec.scanline_bytes();
|
||||
++i, j += 6) {
|
||||
for (unsigned int i = 0, j = 0; j + 6 < scanline_bytes; ++i, j += 6) {
|
||||
uint8_t mask = 0xF0;
|
||||
mscanline[j] = m_colortable[(fscanline[i] & mask) >> 4].r;
|
||||
mscanline[j + 1] = m_colortable[(fscanline[i] & mask) >> 4].g;
|
||||
@@ -222,9 +195,9 @@ BmpInput::read_native_scanline(int subimage, int miplevel, int y, int z,
|
||||
}
|
||||
}
|
||||
if (m_dib_header.bpp == 1) {
|
||||
for (unsigned int i = 0, k = 0; i < fscanline.size(); ++i) {
|
||||
for (int64_t i = 0, k = 0; i < m_padded_scanline_size; ++i) {
|
||||
for (int j = 7; j >= 0; --j, k += 3) {
|
||||
if (k + 2 >= mscanline.size())
|
||||
if (size_t(k + 2) >= scanline_bytes)
|
||||
break;
|
||||
int index = 0;
|
||||
if (fscanline[i] & (1 << j))
|
||||
@@ -235,7 +208,7 @@ BmpInput::read_native_scanline(int subimage, int miplevel, int y, int z,
|
||||
}
|
||||
}
|
||||
}
|
||||
memcpy(data, &mscanline[0], m_spec.scanline_bytes());
|
||||
memcpy(data, &mscanline[0], scanline_bytes);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -271,9 +244,10 @@ BmpInput::read_color_table(void)
|
||||
size_t n = fread(&m_colortable[i], 1, entry_size, m_fd);
|
||||
if (n != entry_size) {
|
||||
if (feof(m_fd))
|
||||
error("Hit end of file unexpectedly while reading color table");
|
||||
errorf(
|
||||
"Hit end of file unexpectedly while reading color table");
|
||||
else
|
||||
error("read error while reading color table");
|
||||
errorf("read error while reading color table");
|
||||
return false; // Read failed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,6 @@
|
||||
/*
|
||||
Copyright 2008-2009 Larry Gritz and the other authors and contributors.
|
||||
All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the software's owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(This is the Modified BSD License)
|
||||
*/
|
||||
// Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
#include <OpenImageIO/strutil.h>
|
||||
|
||||
@@ -64,7 +38,7 @@ bool
|
||||
BmpOutput::open(const std::string& name, const ImageSpec& spec, OpenMode mode)
|
||||
{
|
||||
if (mode != Create) {
|
||||
error("%s does not support subimages or MIP levels", format_name());
|
||||
errorf("%s does not support subimages or MIP levels", format_name());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -73,8 +47,18 @@ BmpOutput::open(const std::string& name, const ImageSpec& spec, OpenMode mode)
|
||||
m_spec = spec;
|
||||
|
||||
if (m_spec.nchannels != 3 && m_spec.nchannels != 4) {
|
||||
error("%s does not support %d-channel images\n", format_name(),
|
||||
m_spec.nchannels);
|
||||
errorf("%s does not support %d-channel images\n", format_name(),
|
||||
m_spec.nchannels);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only support 8 bit channels for now.
|
||||
m_spec.set_format(TypeDesc::UINT8);
|
||||
m_dither = m_spec.get_int_attribute("oiio:dither", 0);
|
||||
|
||||
int64_t file_size = m_spec.image_bytes() + BMP_HEADER_SIZE + WINDOWS_V3;
|
||||
if (file_size >= int64_t(1) << 32) {
|
||||
errorf("%s does not support files over 4GB in size\n", format_name());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -89,11 +73,7 @@ BmpOutput::open(const std::string& name, const ImageSpec& spec, OpenMode mode)
|
||||
|
||||
// Scanline size is rounded up to align to 4-byte boundary
|
||||
m_padded_scanline_size = ((m_spec.width * m_spec.nchannels) + 3) & ~3;
|
||||
fgetpos(m_fd, &m_image_start);
|
||||
|
||||
// Only support 8 bit channels for now.
|
||||
m_spec.set_format(TypeDesc::UINT8);
|
||||
m_dither = m_spec.get_int_attribute("oiio:dither", 0);
|
||||
m_image_start = Filesystem::ftell(m_fd);
|
||||
|
||||
// If user asked for tiles -- which this format doesn't support, emulate
|
||||
// it by buffering the whole image.
|
||||
@@ -110,21 +90,23 @@ BmpOutput::write_scanline(int y, int z, TypeDesc format, const void* data,
|
||||
stride_t xstride)
|
||||
{
|
||||
if (y > m_spec.height) {
|
||||
error("Attempt to write too many scanlines to %s", m_filename.c_str());
|
||||
errorf("Attempt to write too many scanlines to %s", m_filename);
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_spec.width >= 0)
|
||||
y = (m_spec.height - y - 1);
|
||||
int scanline_off = y * m_padded_scanline_size;
|
||||
fsetpos(m_fd, &m_image_start);
|
||||
fseek(m_fd, scanline_off, SEEK_CUR);
|
||||
int64_t scanline_off = y * m_padded_scanline_size;
|
||||
Filesystem::fseek(m_fd, m_image_start + scanline_off, SEEK_SET);
|
||||
|
||||
std::vector<unsigned char> scratch;
|
||||
data = to_native_scanline(format, data, xstride, scratch, m_dither, y, z);
|
||||
std::vector<unsigned char> buf(m_padded_scanline_size);
|
||||
memcpy(&buf[0], data, m_spec.scanline_bytes());
|
||||
std::vector<unsigned char> buf;
|
||||
buf.reserve(m_padded_scanline_size); // reserve enough for padded scanline
|
||||
buf.assign((const unsigned char*)data,
|
||||
(const unsigned char*)data + m_spec.scanline_bytes());
|
||||
buf.resize(m_padded_scanline_size, 0); // pad with zeroes if needed
|
||||
|
||||
// Swap RGB pixels into BGR format
|
||||
if (m_spec.nchannels >= 3)
|
||||
@@ -159,7 +141,7 @@ BmpOutput::close(void)
|
||||
bool ok = true;
|
||||
if (m_spec.tile_width) {
|
||||
// Handle tile emulation -- output the buffered pixels
|
||||
ASSERT(m_tilebuffer.size());
|
||||
OIIO_DASSERT(m_tilebuffer.size());
|
||||
ok &= write_scanlines(m_spec.y, m_spec.y + m_spec.height, 0,
|
||||
m_spec.format, &m_tilebuffer[0]);
|
||||
std::vector<unsigned char>().swap(m_tilebuffer);
|
||||
@@ -174,9 +156,10 @@ BmpOutput::close(void)
|
||||
void
|
||||
BmpOutput::create_and_write_file_header(void)
|
||||
{
|
||||
m_bmp_header.magic = MAGIC_BM;
|
||||
const int data_size = m_spec.width * m_spec.height * m_spec.nchannels;
|
||||
const int file_size = data_size + BMP_HEADER_SIZE + WINDOWS_V3;
|
||||
m_bmp_header.magic = MAGIC_BM;
|
||||
int64_t data_size = int64_t(m_spec.width) * m_spec.height
|
||||
* m_spec.nchannels;
|
||||
int64_t file_size = data_size + BMP_HEADER_SIZE + WINDOWS_V3;
|
||||
m_bmp_header.fsize = file_size;
|
||||
m_bmp_header.res1 = 0;
|
||||
m_bmp_header.res2 = 0;
|
||||
|
||||
@@ -5,6 +5,6 @@ includedir=${prefix}/include
|
||||
|
||||
Name: OpenImageIO
|
||||
Description: OpenImageIO is a library for reading and writing images.
|
||||
Version: @OIIO_VERSION_MAJOR@.@OIIO_VERSION_MINOR@.@OIIO_VERSION_PATCH@
|
||||
Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.@PROJECT_VERSION_TWEAK@
|
||||
Libs: -L${libdir} -lOpenImageIO
|
||||
Cflags: -I${includedir}/OpenImageIO
|
||||
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build cmake
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
echo "Building cmake"
|
||||
uname
|
||||
|
||||
CMAKE_VERSION=${CMAKE_VERSION:=3.12.4}
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
CMAKE_INSTALL_DIR=${CMAKE_INSTALL_DIR:=${LOCAL_DEPS_DIR}/cmake}
|
||||
|
||||
if [[ `uname` == "Linux" && `uname -m` == "x86_64" ]] ; then
|
||||
mkdir -p ${CMAKE_INSTALL_DIR} || true
|
||||
curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" -o "cmake.sh"
|
||||
sh cmake.sh --skip-license --prefix=${CMAKE_INSTALL_DIR}
|
||||
export PATH=${CMAKE_INSTALL_DIR}/bin:$PATH
|
||||
fi
|
||||
|
||||
if [[ `uname` == "Linux" && `uname -m` == "aarch64" ]] ; then
|
||||
mkdir -p ${CMAKE_INSTALL_DIR} || true
|
||||
curl --location https://anaconda.org/conda-forge/cmake/3.17.0/download/linux-aarch64/cmake-3.17.0-h28c56e5_0.tar.bz2 -o cmake-3.17.0-h28c56e5_0.tar.bz2
|
||||
tar -xjvf cmake-3.17.0-h28c56e5_0.tar.bz2 -C ${CMAKE_INSTALL_DIR}
|
||||
export PATH=${CMAKE_INSTALL_DIR}/bin:$PATH
|
||||
|
||||
# In case we ever need to build from scratch:
|
||||
# curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz" -o cmake.tar.gz
|
||||
# tar xzf cmake.tar.gz
|
||||
# pushd cmake-${CMAKE_VERSION}
|
||||
# CXX="ccache $CXX" ./bootstrap --parallel=${PARALLEL:=4} --enable-ccache
|
||||
# CXX="ccache $CXX" timeout 2100 time make ${PAR_MAKEFAGS} || true
|
||||
# export PATH=${CMAKE_INSTALL_DIR}/bin:$PWD/bin:$PATH
|
||||
# popd
|
||||
fi
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build libjpeg-turbo
|
||||
#
|
||||
# Copyright Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Repo and branch/tag/commit of libjpeg-turbo to download if we don't have it yet
|
||||
LIBJPEGTURBO_REPO=${LIBJPEGTURBO_REPO:=https://github.com/libjpeg-turbo/libjpeg-turbo.git}
|
||||
LIBJPEGTURBO_VERSION=${LIBJPEGTURBO_VERSION:=2.0.5}
|
||||
|
||||
# Where to put libjpeg-turbo repo source (default to the ext area)
|
||||
LIBJPEGTURBO_SRC_DIR=${LIBJPEGTURBO_SRC_DIR:=${PWD}/ext/libjpeg-turbo}
|
||||
# Temp build area (default to a build/ subdir under source)
|
||||
LIBJPEGTURBO_BUILD_DIR=${LIBJPEGTURBO_BUILD_DIR:=${LIBJPEGTURBO_SRC_DIR}/build}
|
||||
# Install area for libjpeg-turbo (default to ext/dist)
|
||||
LIBJPEGTURBO_INSTALL_DIR=${LIBJPEGTURBO_INSTALL_DIR:=${PWD}/ext/dist}
|
||||
#LIBJPEGTURBO_CONFIG_OPTS=${LIBJPEGTURBO_CONFIG_OPTS:=}
|
||||
|
||||
pwd
|
||||
echo "libjpeg-turbo install dir will be: ${LIBJPEGTURBO_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ./ext
|
||||
pushd ./ext
|
||||
|
||||
# Clone libjpeg-turbo project from GitHub and build
|
||||
if [[ ! -e ${LIBJPEGTURBO_SRC_DIR} ]] ; then
|
||||
echo "git clone ${LIBJPEGTURBO_REPO} ${LIBJPEGTURBO_SRC_DIR}"
|
||||
git clone ${LIBJPEGTURBO_REPO} ${LIBJPEGTURBO_SRC_DIR}
|
||||
fi
|
||||
cd ${LIBJPEGTURBO_SRC_DIR}
|
||||
echo "git checkout ${LIBJPEGTURBO_VERSION} --force"
|
||||
git checkout ${LIBJPEGTURBO_VERSION} --force
|
||||
|
||||
mkdir -p ${LIBJPEGTURBO_BUILD_DIR}
|
||||
cd ${LIBJPEGTURBO_BUILD_DIR}
|
||||
time cmake --config Release \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${LIBJPEGTURBO_INSTALL_DIR} \
|
||||
${LIBJPEGTURBO_CONFIG_OPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
|
||||
ls -R ${LIBJPEGTURBO_INSTALL_DIR}
|
||||
popd
|
||||
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export JPEGTurbo_ROOT=$LIBJPEGTURBO_INSTALL_DIR
|
||||
|
||||
Executable
+56
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build libpng
|
||||
#
|
||||
# Copyright Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Repo and branch/tag/commit of libpng to download if we don't have it yet
|
||||
LIBPNG_REPO=${LIBPNG_REPO:=https://github.com/glennrp/libpng.git}
|
||||
LIBPNG_VERSION=${LIBPNG_VERSION:=v1.6.35}
|
||||
|
||||
# Where to put libpng repo source (default to the ext area)
|
||||
LIBPNG_SRC_DIR=${LIBPNG_SRC_DIR:=${PWD}/ext/libpng}
|
||||
# Temp build area (default to a build/ subdir under source)
|
||||
LIBPNG_BUILD_DIR=${LIBPNG_BUILD_DIR:=${LIBPNG_SRC_DIR}/build}
|
||||
# Install area for libpng (default to ext/dist)
|
||||
LIBPNG_INSTALL_DIR=${LIBPNG_INSTALL_DIR:=${PWD}/ext/dist}
|
||||
#LIBPNG_CONFIG_OPTS=${LIBPNG_CONFIG_OPTS:=}
|
||||
|
||||
pwd
|
||||
echo "libpng install dir will be: ${LIBPNG_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ./ext
|
||||
pushd ./ext
|
||||
|
||||
# Clone libpng project from GitHub and build
|
||||
if [[ ! -e ${LIBPNG_SRC_DIR} ]] ; then
|
||||
echo "git clone ${LIBPNG_REPO} ${LIBPNG_SRC_DIR}"
|
||||
git clone ${LIBPNG_REPO} ${LIBPNG_SRC_DIR}
|
||||
fi
|
||||
cd ${LIBPNG_SRC_DIR}
|
||||
echo "git checkout ${LIBPNG_VERSION} --force"
|
||||
git checkout ${LIBPNG_VERSION} --force
|
||||
|
||||
mkdir -p ${LIBPNG_BUILD_DIR}
|
||||
cd ${LIBPNG_BUILD_DIR}
|
||||
time cmake --config Release \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${LIBPNG_INSTALL_DIR} \
|
||||
-DPNG_EXECUTABLES=OFF \
|
||||
-DPNG_TESTS=OFF \
|
||||
${LIBPNG_CONFIG_OPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
|
||||
ls -R ${LIBPNG_INSTALL_DIR}
|
||||
popd
|
||||
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export PNG_ROOT=$LIBPNG_INSTALL_DIR
|
||||
|
||||
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build LibRaw
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Which LibRaw to retrieve, how to build it
|
||||
LIBRAW_REPO=${LIBRAW_REPO:=https://github.com/LibRaw/LibRaw.git}
|
||||
LIBRAW_VERSION=${LIBRAW_VERSION:=0.19.5}
|
||||
LIBRAW_BRANCH=${LIBRAW_BRANCH:=${LIBRAW_VERSION}}
|
||||
|
||||
# Where to install the final results
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
LIBRAW_SOURCE_DIR=${LIBRAW_SOURCE_DIR:=${LOCAL_DEPS_DIR}/libraw}
|
||||
LIBRAW_BUILD_DIR=${LIBRAW_BUILD_DIR:=${LOCAL_DEPS_DIR}/libraw-build}
|
||||
LIBRAW_INSTALL_DIR=${LIBRAW_INSTALL_DIR:=${LOCAL_DEPS_DIR}/libraw-install}
|
||||
LIBRAW_BUILD_TYPE=${LIBRAW_BUILD_TYPE:=Release}
|
||||
|
||||
pwd
|
||||
echo "Building LibRaw ${LIBRAW_BRANCH}"
|
||||
echo " build dir will be: ${LIBRAW_BUILD_DIR}"
|
||||
echo " install dir will be: ${LIBRAW_INSTALL_DIR}"
|
||||
echo " build type is ${LIBRAW_BUILD_TYPE}"
|
||||
|
||||
|
||||
# Clone LibRaw project (including IlmBase) from GitHub and build
|
||||
if [[ ! -e ${LIBRAW_SOURCE_DIR} ]] ; then
|
||||
echo "git clone ${LIBRAW_REPO} ${LIBRAW_SOURCE_DIR}"
|
||||
git clone ${LIBRAW_REPO} ${LIBRAW_SOURCE_DIR}
|
||||
fi
|
||||
|
||||
mkdir -p ${LIBRAW_INSTALL_DIR} && true
|
||||
mkdir -p ${LIBRAW_BUILD_DIR} && true
|
||||
|
||||
pushd ${LIBRAW_SOURCE_DIR}
|
||||
git checkout ${LIBRAW_BRANCH} --force
|
||||
|
||||
aclocal
|
||||
autoreconf --install
|
||||
./configure --prefix=${LIBRAW_INSTALL_DIR}
|
||||
time make -j ${PARALLEL:=4} && make install
|
||||
|
||||
popd
|
||||
|
||||
#ls -R ${LIBRAW_INSTALL_DIR}
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export LibRaw_ROOT=$LIBRAW_INSTALL_DIR
|
||||
export LibRaw_LIBRARY_DIR=$LIBRAW_INSTALL_DIR/lib
|
||||
export LD_LIBRARY_PATH=$LIBRAW_ROOT/lib:$LD_LIBRARY_PATH
|
||||
|
||||
Executable
+52
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build libtiff
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
LIBTIFF_REPO=${LIBTIFF_REPO:=https://gitlab.com/libtiff/libtiff.git}
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
LIBTIFF_BUILD_DIR=${LIBTIFF_BUILD_DIR:=${LOCAL_DEPS_DIR}/libtiff}
|
||||
LIBTIFF_INSTALL_DIR=${LIBTIFF_INSTALL_DIR:=${PWD}/ext/dist}
|
||||
LIBTIFF_VERSION=${LIBTIFF_VERSION:=v4.1.0}
|
||||
if [[ `uname` == `Linux` ]] ; then
|
||||
LIBTIFF_CXX_FLAGS=${LIBTIFF_CXX_FLAGS:="-O3 -Wno-unused-function -Wno-deprecated-declarations -Wno-cast-qual -Wno-write-strings"}
|
||||
fi
|
||||
LIBTIFF_BUILDOPTS="${LIBTIFF_BUILDOPTS}"
|
||||
BASEDIR=`pwd`
|
||||
pwd
|
||||
echo "libtiff install dir will be: ${LIBTIFF_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ${LOCAL_DEPS_DIR}
|
||||
pushd ${LOCAL_DEPS_DIR}
|
||||
|
||||
# Clone libtiff project from GitHub and build
|
||||
if [[ ! -e libtiff ]] ; then
|
||||
echo "git clone ${LIBTIFF_REPO} libtiff"
|
||||
git clone ${LIBTIFF_REPO} libtiff
|
||||
fi
|
||||
cd libtiff
|
||||
|
||||
echo "git checkout ${LIBTIFF_VERSION} --force"
|
||||
git checkout ${LIBTIFF_VERSION} --force
|
||||
mkdir -p build
|
||||
cd build
|
||||
time cmake --config Release \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${LIBTIFF_INSTALL_DIR} \
|
||||
-DCMAKE_CXX_FLAGS="${LIBTIFF_CXX_FLAGS}" \
|
||||
${LIBTIFF_BUILDOPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
popd
|
||||
|
||||
ls -R ${LIBTIFF_INSTALL_DIR}
|
||||
|
||||
#echo "listing .."
|
||||
#ls ..
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export TIFF_ROOT=$LIBTIFF_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LIBTIFF_INSTALL_DIR}/lib
|
||||
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build LLVM & clang
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
echo "Building LLVM"
|
||||
uname
|
||||
|
||||
|
||||
if [[ `uname` == "Linux" ]] ; then
|
||||
LLVM_VERSION=${LLVM_VERSION:=8.0.0}
|
||||
LLVM_INSTALL_DIR=${LLVM_INSTALL_DIR:=${PWD}/llvm-install}
|
||||
if [[ "$GITHUB_WORKFLOW" != "" ]] ; then
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-18.04}
|
||||
elif [[ "$TRAVIS_DIST" == "trusty" ]] ; then
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-14.04}
|
||||
elif [[ "$TRAVIS_DIST" == "xenial" ]] ; then
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-16.04}
|
||||
elif [[ "$TRAVIS_DIST" == "bionic" ]] ; then
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-18.04}
|
||||
else
|
||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=error}
|
||||
fi
|
||||
if [ "$LLVM_VERSION" == "5.0.0" ] ; then
|
||||
LLVMTAR=clang+llvm-${LLVM_VERSION}-linux-x86_64-${LLVM_DISTRO_NAME}.tar.xz
|
||||
else
|
||||
LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-${LLVM_DISTRO_NAME}.tar.xz
|
||||
fi
|
||||
echo LLVMTAR = $LLVMTAR
|
||||
curl --location http://releases.llvm.org/${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
||||
ls -l $LLVMTAR
|
||||
tar xf $LLVMTAR
|
||||
rm -f $LLVMTAR
|
||||
echo "Installed ${LLVM_VERSION} in ${LLVM_INSTALL_DIR}"
|
||||
mkdir -p $LLVM_INSTALL_DIR && true
|
||||
mv clang+llvm*/* $LLVM_INSTALL_DIR
|
||||
export LLVM_DIRECTORY=$LLVM_INSTALL_DIR
|
||||
export PATH=${LLVM_INSTALL_DIR}/bin:$PATH
|
||||
ls -a $LLVM_DIRECTORY
|
||||
fi
|
||||
@@ -1,41 +1,52 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
OCIOREPO=${OCIOREPO:=https://github.com/imageworks/OpenColorIO.git}
|
||||
OCIOBUILDDIR=${OCIOBUILDDIR:=${PWD}/ext/OpenColorIO}
|
||||
OCIOINSTALLDIR=${OCIOINSTALLDIR:=${PWD}/ext/OpenColorIO/dist}
|
||||
OCIOBRANCH=${OCIOBRANCH:=v1.1.0}
|
||||
OCIOCXXFLAGS=${OCIOCXXFLAGS:="-Wno-unused-function -Wno-deprecated-declarations -Wno-cast-qual -Wno-write-strings"}
|
||||
# Utility script to download and build OpenColorIO
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
OCIO_REPO=${OCIO_REPO:=https://github.com/AcademySoftwareFoundation/OpenColorIO.git}
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
OCIO_BUILD_DIR=${OCIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO}
|
||||
OCIO_INSTALL_DIR=${OCIO_INSTALL_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO/dist}
|
||||
OCIO_VERSION=${OCIO_VERSION:=1.1.1}
|
||||
OCIO_BRANCH=${OCIO_BRANCH:=v${OCIO_VERSION}}
|
||||
OCIO_CXX_FLAGS=${OCIO_CXX_FLAGS:="-Wno-unused-function -Wno-deprecated-declarations -Wno-cast-qual -Wno-write-strings"}
|
||||
# Just need libs:
|
||||
OCIO_BUILDOPTS="-DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_NUKE=OFF \
|
||||
-DOCIO_BUILD_DOCS=OFF -DOCIO_BUILD_TESTS=OFF \
|
||||
-DOCIO_BUILD_PYTHON=OFF -DOCIO_BUILD_PYGLUE=OFF \
|
||||
-DOCIO_BUILD_JAVA=OFF"
|
||||
-DOCIO_BUILD_JAVA=OFF \
|
||||
-DOCIO_BUILD_STATIC=${OCIO_BUILD_STATIC:=OFF}"
|
||||
BASEDIR=`pwd`
|
||||
pwd
|
||||
echo "OpenColorIO install dir will be: ${OCIOINSTALLDIR}"
|
||||
echo "OpenColorIO install dir will be: ${OCIO_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ./ext
|
||||
pushd ./ext
|
||||
mkdir -p ${LOCAL_DEPS_DIR}
|
||||
pushd ${LOCAL_DEPS_DIR}
|
||||
|
||||
# Clone OpenColorIO project from GitHub and build
|
||||
if [[ ! -e OpenColorIO ]] ; then
|
||||
echo "git clone ${OCIOREPO} OpenColorIO"
|
||||
git clone ${OCIOREPO} OpenColorIO
|
||||
echo "git clone ${OCIO_REPO} OpenColorIO"
|
||||
git clone ${OCIO_REPO} OpenColorIO
|
||||
fi
|
||||
cd OpenColorIO
|
||||
|
||||
echo "git checkout ${OCIOBRANCH} --force"
|
||||
git checkout ${OCIOBRANCH} --force
|
||||
echo "git checkout ${OCIO_BRANCH} --force"
|
||||
git checkout ${OCIO_BRANCH} --force
|
||||
mkdir -p build
|
||||
time (cd build ; cmake --config Release -DCMAKE_INSTALL_PREFIX=${OCIOINSTALLDIR} -DCMAKE_CXX_FLAGS="${OCIOCXXFLAGS}" ${OCIO_BUILDOPTS} .. && make clean && make -j 4 && make install)
|
||||
cd build
|
||||
time cmake --config Release -DCMAKE_INSTALL_PREFIX=${OCIO_INSTALL_DIR} -DCMAKE_CXX_FLAGS="${OCIO_CXX_FLAGS}" ${OCIO_BUILDOPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
popd
|
||||
|
||||
ls -R ${OCIOINSTALLDIR}
|
||||
ls -R ${OCIO_INSTALL_DIR}
|
||||
|
||||
#echo "listing .."
|
||||
#ls ..
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OCIOINSTALLDIR}/lib
|
||||
export OpenColorIO_ROOT=$OCIO_INSTALL_DIR
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OCIO_INSTALL_DIR}/lib
|
||||
|
||||
|
||||
@@ -1,74 +1,105 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# The Linux VM used by Travis has OpenEXR 1.x. We really want 2.x.
|
||||
# This script downloads and builds OpenEXR in the ext/ subdirectory.
|
||||
# Utility script to download and build OpenEXR & IlmBase
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Which OpenEXR to retrieve, how to build it
|
||||
OPENEXR_REPO=${OPENEXR_REPO:=https://github.com/openexr/openexr.git}
|
||||
OPENEXR_VERSION=${OPENEXR_VERSION:=v2.4.1}
|
||||
|
||||
# Where to install the final results
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
OPENEXR_SOURCE_DIR=${OPENEXR_SOURCE_DIR:=${LOCAL_DEPS_DIR}/openexr}
|
||||
OPENEXR_BUILD_DIR=${OPENEXR_BUILD_DIR:=${LOCAL_DEPS_DIR}/openexr-build}
|
||||
OPENEXR_INSTALL_DIR=${OPENEXR_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||
OPENEXR_BUILD_TYPE=${OPENEXR_BUILD_TYPE:=Release}
|
||||
CMAKE_GENERATOR=${CMAKE_GENERATOR:="Unix Makefiles"}
|
||||
OPENEXR_CMAKE_FLAGS=${OPENEXR_CMAKE_FLAGS:=""}
|
||||
OPENEXR_CXX_FLAGS=${OPENEXR_CXX_FLAGS:=""}
|
||||
BASEDIR=$PWD
|
||||
|
||||
EXRREPO=${EXRREPO:=https://github.com/openexr/openexr.git}
|
||||
EXRINSTALLDIR=${EXRINSTALLDIR:=${PWD}/ext/openexr-install}
|
||||
EXRBRANCH=${EXRBRANCH:=v2.3.0}
|
||||
EXRCXXFLAGS=${EXRCXXFLAGS:=""}
|
||||
BASEDIR=`pwd`
|
||||
pwd
|
||||
echo "EXR install dir will be: ${EXRINSTALLDIR}"
|
||||
echo "Building OpenEXR ${OPENEXR_VERSION}"
|
||||
echo "EXR build dir will be: ${OPENEXR_BUILD_DIR}"
|
||||
echo "EXR install dir will be: ${OPENEXR_INSTALL_DIR}"
|
||||
echo "CMAKE_PREFIX_PATH is ${CMAKE_PREFIX_PATH}"
|
||||
echo "OpenEXR Build type is ${OPENEXR_BUILD_TYPE}"
|
||||
|
||||
if [[ ! -e ${EXRINSTALLDIR} ]] ; then
|
||||
mkdir -p ${EXRINSTALLDIR}
|
||||
if [[ "$CMAKE_GENERATOR" == "" ]] ; then
|
||||
OPENEXR_GENERATOR_CMD="-G \"$CMAKE_GENERATOR\""
|
||||
fi
|
||||
|
||||
# Clone OpenEXR project (including IlmBase) from GitHub and build
|
||||
if [[ ! -e ./ext/openexr ]] ; then
|
||||
echo "git clone ${EXRREPO} ./ext/openexr"
|
||||
git clone ${EXRREPO} ./ext/openexr
|
||||
if [[ ! -e ${OPENEXR_SOURCE_DIR} ]] ; then
|
||||
echo "git clone ${OPENEXR_REPO} ${OPENEXR_SOURCE_DIR}"
|
||||
git clone ${OPENEXR_REPO} ${OPENEXR_SOURCE_DIR}
|
||||
fi
|
||||
|
||||
flags=
|
||||
mkdir -p ${OPENEXR_INSTALL_DIR} && true
|
||||
mkdir -p ${OPENEXR_BUILD_DIR} && true
|
||||
|
||||
if [[ ${LINKSTATIC:=0} == 1 ]] ; then
|
||||
flags=${flags} --enable-static --enable-shared=no --with-pic
|
||||
fi
|
||||
pushd ${OPENEXR_SOURCE_DIR}
|
||||
git checkout ${OPENEXR_VERSION} --force
|
||||
|
||||
pushd ./ext/openexr
|
||||
echo "git checkout ${EXRBRANCH} --force"
|
||||
git checkout ${EXRBRANCH} --force
|
||||
|
||||
if [[ ${EXRBRANCH} == "v2.3.0" ]] ; then
|
||||
if [[ ${OPENEXR_VERSION} == "v2.2.0" ]] || [[ ${OPENEXR_VERSION} == "v2.2.1" ]] ; then
|
||||
mkdir -p ${OPENEXR_BUILD_DIR}/IlmBase && true
|
||||
mkdir -p ${OPENEXR_BUILD_DIR}/OpenEXR && true
|
||||
cd ${OPENEXR_BUILD_DIR}/IlmBase
|
||||
cmake --config ${OPENEXR_BUILD_TYPE} ${OPENEXR_GENERATOR_CMD} \
|
||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
||||
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}/IlmBase
|
||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
||||
cd ${OPENEXR_BUILD_DIR}/OpenEXR
|
||||
cmake --config ${OPENEXR_BUILD_TYPE} ${OPENEXR_GENERATOR_CMD} \
|
||||
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}\;${OPENEXR_INSTALL_DIR}" \
|
||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DBUILD_UTILS=0 -DBUILD_TESTS=0 \
|
||||
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
||||
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}/OpenEXR
|
||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
||||
elif [[ ${OPENEXR_VERSION} == "v2.3.0" ]] ; then
|
||||
# Simplified setup for 2.3+
|
||||
mkdir build
|
||||
cd build
|
||||
mkdir OpenEXR
|
||||
mkdir OpenEXR/IlmImf
|
||||
unzip -d OpenEXR/IlmImf ${BASEDIR}/src/build-scripts/b44ExpLogTable.h.zip
|
||||
unzip -d OpenEXR/IlmImf ${BASEDIR}/src/build-scripts/dwaLookups.h.zip
|
||||
cmake --config Release -DCMAKE_INSTALL_PREFIX=${EXRINSTALLDIR} -DILMBASE_PACKAGE_PREFIX=${EXRINSTALLDIR} -DOPENEXR_BUILD_UTILS=0 -DOPENEXR_BUILD_TESTS=0 -DOPENEXR_BUILD_PYTHON_LIBS=0 -DCMAKE_CXX_FLAGS=${EXRCXXFLAGS} .. && make clean && make -j 4 && make install
|
||||
cd ${OPENEXR_BUILD_DIR}
|
||||
cmake --config ${OPENEXR_BUILD_TYPE} -G "$CMAKE_GENERATOR" \
|
||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
|
||||
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DOPENEXR_BUILD_UTILS=0 \
|
||||
-DOPENEXR_BUILD_TESTS=0 \
|
||||
-DOPENEXR_BUILD_PYTHON_LIBS=0 \
|
||||
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
||||
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}
|
||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
||||
else
|
||||
cd IlmBase
|
||||
mkdir build
|
||||
cd build
|
||||
cmake --config Release -DCMAKE_INSTALL_PREFIX=${EXRINSTALLDIR} -DCMAKE_CXX_FLAGS=${EXRCXXFLAGS} .. && make clean && make -j 4 && make install
|
||||
cd ..
|
||||
cd ../OpenEXR
|
||||
cp ${BASEDIR}/src/build-scripts/OpenEXR-CMakeLists.txt CMakeLists.txt
|
||||
cp ${BASEDIR}/src/build-scripts/OpenEXR-IlmImf-CMakeLists.txt IlmImf/CMakeLists.txt
|
||||
mkdir build
|
||||
mkdir build/IlmImf
|
||||
cd build
|
||||
unzip -d IlmImf ${BASEDIR}/src/build-scripts/b44ExpLogTable.h.zip
|
||||
unzip -d IlmImf ${BASEDIR}/src/build-scripts/dwaLookups.h.zip
|
||||
cmake --config Release -DCMAKE_INSTALL_PREFIX=${EXRINSTALLDIR} -DILMBASE_PACKAGE_PREFIX=${EXRINSTALLDIR} -DBUILD_UTILS=0 -DBUILD_TESTS=0 -DCMAKE_CXX_FLAGS=${EXRCXXFLAGS} .. && make clean && make -j 4 && make install
|
||||
# Simplified setup for 2.4+
|
||||
cd ${OPENEXR_BUILD_DIR}
|
||||
cmake --config ${OPENEXR_BUILD_TYPE} -G "$CMAKE_GENERATOR" \
|
||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
|
||||
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||
-DOPENEXR_BUILD_UTILS=0 \
|
||||
-DBUILD_TESTING=0 \
|
||||
-DPYILMBASE_ENABLE=0 \
|
||||
-DOPENEXR_VIEWERS_ENABLE=0 \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
||||
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}
|
||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
||||
fi
|
||||
|
||||
popd
|
||||
|
||||
ls -R ${EXRINSTALLDIR}
|
||||
|
||||
#echo "listing .."
|
||||
#ls ..
|
||||
#ls -R ${OPENEXR_INSTALL_DIR}
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export ILMBASE_ROOT_DIR=$EXRINSTALLDIR
|
||||
export OPENEXR_ROOT_DIR=$EXRINSTALLDIR
|
||||
export ILMBASE_LIBRARY_DIR=$EXRINSTALLDIR/lib
|
||||
export OPENEXR_LIBRARY_DIR=$EXRINSTALLDIR/lib
|
||||
export LD_LIBRARY_PATH=$OPENEXR_ROOT_DIR/lib:$LD_LIBRARY_PATH
|
||||
export ILMBASE_ROOT=$OPENEXR_INSTALL_DIR
|
||||
export OPENEXR_ROOT=$OPENEXR_INSTALL_DIR
|
||||
export ILMBASE_LIBRARY_DIR=$OPENEXR_INSTALL_DIR/lib
|
||||
export OPENEXR_LIBRARY_DIR=$OPENEXR_INSTALL_DIR/lib
|
||||
export LD_LIBRARY_PATH=$OPENEXR_ROOT/lib:$LD_LIBRARY_PATH
|
||||
|
||||
|
||||
Executable
+58
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build pugixml
|
||||
#
|
||||
# Copyright Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Repo and branch/tag/commit of pugixml to download if we don't have it yet
|
||||
PUGIXML_REPO=${PUGIXML_REPO:=https://github.com/zeux/pugixml.git}
|
||||
PUGIXML_VERSION=${PUGIXML_VERSION:=1.10}
|
||||
PUGIXML_BRANCH=${PUGIXML_BRANCH:=v${PUGIXML_VERSION}}
|
||||
|
||||
# Where to put pugixml repo source (default to the ext area)
|
||||
PUGIXML_SRC_DIR=${PUGIXML_SRC_DIR:=${PWD}/ext/pugixml}
|
||||
# Temp build area (default to a build/ subdir under source)
|
||||
PUGIXML_BUILD_DIR=${PUGIXML_BUILD_DIR:=${PUGIXML_SRC_DIR}/build}
|
||||
# Install area for pugixml (default to ext/dist)
|
||||
PUGIXML_INSTALL_DIR=${PUGIXML_INSTALL_DIR:=${PWD}/ext/dist}
|
||||
#PUGIXML_BUILD_OPTS=${PUGIXML_BUILD_OPTS:=}
|
||||
|
||||
pwd
|
||||
echo "pugixml install dir will be: ${PUGIXML_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ./ext
|
||||
pushd ./ext
|
||||
|
||||
# Clone pugixml project from GitHub and build
|
||||
if [[ ! -e ${PUGIXML_SRC_DIR} ]] ; then
|
||||
echo "git clone ${PUGIXML_REPO} ${PUGIXML_SRC_DIR}"
|
||||
git clone ${PUGIXML_REPO} ${PUGIXML_SRC_DIR}
|
||||
fi
|
||||
cd ${PUGIXML_SRC_DIR}
|
||||
echo "git checkout ${PUGIXML_BRANCH} --force"
|
||||
git checkout ${PUGIXML_BRANCH} --force
|
||||
|
||||
mkdir -p ${PUGIXML_BUILD_DIR}
|
||||
cd ${PUGIXML_BUILD_DIR}
|
||||
time cmake --config Release \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${PUGIXML_INSTALL_DIR} \
|
||||
-DBUILD_TESTS=OFF \
|
||||
${PUGIXML_BUILD_OPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
|
||||
ls -R ${PUGIXML_INSTALL_DIR}
|
||||
popd
|
||||
|
||||
#echo "listing .."
|
||||
#ls ..
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export pugixml_ROOT=$PUGIXML_INSTALL_DIR
|
||||
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build pybind11
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Repo and branch/tag/commit of pybind11 to download if we don't have it yet
|
||||
PYBIND11_REPO=${PYBIND11_REPO:=https://github.com/pybind/pybind11.git}
|
||||
PYBIND11_VERSION=${PYBIND11_VERSION:=v2.4.3}
|
||||
|
||||
# Where to put pybind11 repo source (default to the ext area)
|
||||
PYBIND11_SRC_DIR=${PYBIND11_SRC_DIR:=${PWD}/ext/pybind11}
|
||||
# Temp build area (default to a build/ subdir under source)
|
||||
PYBIND11_BUILD_DIR=${PYBIND11_BUILD_DIR:=${PYBIND11_SRC_DIR}/build}
|
||||
# Install area for pybind11 (default to ext/dist)
|
||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||
PYBIND11_INSTALL_DIR=${PYBIND11_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||
#PYBIND11_BUILD_OPTS=${PYBIND11_BUILD_OPTS:=}
|
||||
|
||||
if [[ "${PYTHON_VERSION}" != "" ]] ; then
|
||||
PYBIND11_BUILD_OPTS+=" -DPYBIND11_PYTHON_VERSION=${PYTHON_VERSION}"
|
||||
fi
|
||||
|
||||
pwd
|
||||
echo "pybind11 install dir will be: ${PYBIND11_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ./ext
|
||||
pushd ./ext
|
||||
|
||||
# Clone pybind11 project from GitHub and build
|
||||
if [[ ! -e ${PYBIND11_SRC_DIR} ]] ; then
|
||||
echo "git clone ${PYBIND11_REPO} ${PYBIND11_SRC_DIR}"
|
||||
git clone ${PYBIND11_REPO} ${PYBIND11_SRC_DIR}
|
||||
fi
|
||||
cd ${PYBIND11_SRC_DIR}
|
||||
echo "git checkout ${PYBIND11_VERSION} --force"
|
||||
git checkout ${PYBIND11_VERSION} --force
|
||||
|
||||
mkdir -p ${PYBIND11_BUILD_DIR}
|
||||
cd ${PYBIND11_BUILD_DIR}
|
||||
time cmake --config Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${PYBIND11_INSTALL_DIR} \
|
||||
-DPYBIND11_TEST=OFF \
|
||||
${PYBIND11_BUILD_OPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
|
||||
ls -R ${PYBIND11_INSTALL_DIR}
|
||||
popd
|
||||
|
||||
#echo "listing .."
|
||||
#ls ..
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export pybind11_ROOT=$PYBIND11_INSTALL_DIR
|
||||
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Utility script to download and build zlib
|
||||
#
|
||||
# Copyright Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio
|
||||
|
||||
# Exit the whole script if any command fails.
|
||||
set -ex
|
||||
|
||||
# Repo and branch/tag/commit of zlib to download if we don't have it yet
|
||||
ZLIB_REPO=${ZLIB_REPO:=https://github.com/madler/zlib.git}
|
||||
ZLIB_VERSION=${ZLIB_VERSION:=v1.2.11}
|
||||
|
||||
# Where to put zlib repo source (default to the ext area)
|
||||
ZLIB_SRC_DIR=${ZLIB_SRC_DIR:=${PWD}/ext/zlib}
|
||||
# Temp build area (default to a build/ subdir under source)
|
||||
ZLIB_BUILD_DIR=${ZLIB_BUILD_DIR:=${ZLIB_SRC_DIR}/build}
|
||||
# Install area for zlib (default to ext/dist)
|
||||
ZLIB_INSTALL_DIR=${ZLIB_INSTALL_DIR:=${PWD}/ext/dist}
|
||||
#ZLIB_CONFIG_OPTS=${ZLIB_CONFIG_OPTS:=}
|
||||
|
||||
pwd
|
||||
echo "zlib install dir will be: ${ZLIB_INSTALL_DIR}"
|
||||
|
||||
mkdir -p ./ext
|
||||
pushd ./ext
|
||||
|
||||
# Clone zlib project from GitHub and build
|
||||
if [[ ! -e ${ZLIB_SRC_DIR} ]] ; then
|
||||
echo "git clone ${ZLIB_REPO} ${ZLIB_SRC_DIR}"
|
||||
git clone ${ZLIB_REPO} ${ZLIB_SRC_DIR}
|
||||
fi
|
||||
cd ${ZLIB_SRC_DIR}
|
||||
echo "git checkout ${ZLIB_VERSION} --force"
|
||||
git checkout ${ZLIB_VERSION} --force
|
||||
|
||||
mkdir -p ${ZLIB_BUILD_DIR} && true
|
||||
cd ${ZLIB_BUILD_DIR}
|
||||
time cmake --config Release \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=${ZLIB_INSTALL_DIR} \
|
||||
${ZLIB_CONFIG_OPTS} ..
|
||||
time cmake --build . --config Release --target install
|
||||
|
||||
ls -R ${ZLIB_INSTALL_DIR}
|
||||
popd
|
||||
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export ZLIB_ROOT=$ZLIB_INSTALL_DIR
|
||||
|
||||
@@ -12,22 +12,47 @@ if [[ -e src/build-scripts/ci-setenv.bash ]] ; then
|
||||
source src/build-scripts/ci-setenv.bash
|
||||
fi
|
||||
|
||||
|
||||
if [[ "$TRAVIS" != "" ]] ; then
|
||||
MAKEFLAGS=-j2
|
||||
elif [[ "$CIRCLECI" != "" ]] ; then
|
||||
MAKEFLAGS=-j4
|
||||
if [[ ! -e build/$PLATFORM ]] ; then
|
||||
mkdir -p build/$PLATFORM
|
||||
fi
|
||||
if [[ ! -e dist/$PLATFORM ]] ; then
|
||||
mkdir -p dist/$PLATFORM
|
||||
fi
|
||||
|
||||
make $MAKEFLAGS VERBOSE=1 $BUILD_FLAGS cmakesetup
|
||||
make $MAKEFLAGS $BUILD_FLAGS $BUILDTARGET
|
||||
|
||||
if [[ "$SKIP_TESTS" == "" ]] ; then
|
||||
$OPENIMAGEIO_ROOT_DIR/bin/oiiotool --help
|
||||
make $BUILD_FLAGS test
|
||||
if [[ "$USE_SIMD" != "" ]] ; then
|
||||
MY_CMAKE_FLAGS="$MY_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
|
||||
fi
|
||||
if [[ "$DEBUG" == "1" ]] ; then
|
||||
export CMAKE_BUILD_TYPE=Debug
|
||||
fi
|
||||
|
||||
if [[ $BUILDTARGET == clang-format ]] ; then
|
||||
pushd build/$PLATFORM
|
||||
cmake ../.. -G "$CMAKE_GENERATOR" \
|
||||
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
|
||||
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
|
||||
-DCMAKE_INSTALL_PREFIX="$OpenImageIO_ROOT" \
|
||||
-DPYTHON_VERSION="$PYTHON_VERSION" \
|
||||
-DCMAKE_INSTALL_LIBDIR="$OpenImageIO_ROOT/lib" \
|
||||
-DCMAKE_CXX_STANDARD="$CMAKE_CXX_STANDARD" \
|
||||
$MY_CMAKE_FLAGS -DVERBOSE=1
|
||||
if [[ "$BUILDTARGET" != "none" ]] ; then
|
||||
echo "Parallel build " ${CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
time cmake --build . --target ${BUILDTARGET:=install} --config ${CMAKE_BUILD_TYPE}
|
||||
fi
|
||||
popd
|
||||
|
||||
|
||||
if [[ "${SKIP_TESTS:=0}" == "0" ]] ; then
|
||||
$OpenImageIO_ROOT/bin/oiiotool --help || true
|
||||
TESTSUITE_CLEANUP_ON_SUCCESS=1
|
||||
echo "Parallel test " ${CTEST_PARALLEL_LEVEL}
|
||||
# make $BUILD_FLAGS test
|
||||
pushd build/$PLATFORM
|
||||
ctest -C ${CMAKE_BUILD_TYPE} -E broken --force-new-ctest-process --output-on-failure
|
||||
popd
|
||||
fi
|
||||
|
||||
if [[ "$BUILDTARGET" == clang-format ]] ; then
|
||||
git diff --color
|
||||
THEDIFF=`git diff`
|
||||
if [[ "$THEDIFF" != "" ]] ; then
|
||||
@@ -36,6 +61,6 @@ if [[ $BUILDTARGET == clang-format ]] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$CODECOV" == 1 ]] ; then
|
||||
bash <(curl -s https://codecov.io/bash)
|
||||
fi
|
||||
# if [[ "$CODECOV" == 1 ]] ; then
|
||||
# bash <(curl -s https://codecov.io/bash)
|
||||
# fi
|
||||
|
||||
@@ -5,13 +5,18 @@
|
||||
# with 'source', not in a separate shell.
|
||||
|
||||
# Figure out the platform
|
||||
if [[ $TRAVIS_OS_NAME == osx ]] ; then
|
||||
if [[ $TRAVIS_OS_NAME == osx || $RUNNER_OS == macOS ]] ; then
|
||||
export ARCH=macosx
|
||||
fi
|
||||
if [[ $TRAVIS_OS_NAME == linux || $CIRCLECI == true ]] ; then
|
||||
elif [[ `uname -m` == aarch64 ]] ; then
|
||||
export ARCH=aarch64
|
||||
elif [[ $TRAVIS_OS_NAME == linux || $RUNNER_OS == Linux || $CIRCLECI == true ]] ; then
|
||||
export ARCH=linux64
|
||||
elif [[ $RUNNER_OS == Windows ]] ; then
|
||||
export ARCH=windows64
|
||||
else
|
||||
export ARCH=unknown
|
||||
fi
|
||||
PLATFORM=$ARCH
|
||||
export PLATFORM=$ARCH
|
||||
|
||||
if [[ "$DEBUG" == 1 ]] ; then
|
||||
export PLATFORM=${PLATFORM}.debug
|
||||
@@ -21,29 +26,56 @@ echo "Architecture is $ARCH"
|
||||
echo "Build platform name is $PLATFORM"
|
||||
|
||||
# Environment variables we always need
|
||||
export USE_CCACHE=1
|
||||
export USE_CCACHE=${USE_CCACHE:=1}
|
||||
export CCACHE_CPP2=1
|
||||
export OPENIMAGEIO_ROOT_DIR=$PWD/dist/$PLATFORM
|
||||
export DYLD_LIBRARY_PATH=$OPENIMAGEIO_ROOT_DIR/lib:$DYLD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$OPENIMAGEIO_ROOT_DIR/lib:$LD_LIBRARY_PATH
|
||||
export OIIO_LIBRARY_PATH=$OPENIMAGEIO_ROOT_DIR/lib
|
||||
export PYTHONPATH=$OPENIMAGEIO_ROOT_DIR/python:$PYTHONPATH
|
||||
export OpenImageIO_ROOT=$PWD/dist/$PLATFORM
|
||||
export DYLD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$DYLD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=$OpenImageIO_ROOT/lib64:$LD_LIBRARY_PATH
|
||||
export OIIO_LIBRARY_PATH=$OpenImageIO_ROOT/lib
|
||||
export LSAN_OPTIONS=suppressions=$PWD/src/build-scripts/nosanitize.txt
|
||||
export ASAN_OPTIONS=print_suppressions=0
|
||||
|
||||
export PYTHON_VERSION=${PYTHON_VERSION:="2.7"}
|
||||
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
||||
export BUILD_MISSING_DEPS=${BUILD_MISSING_DEPS:=1}
|
||||
export COMPILER=${COMPILER:=gcc}
|
||||
export CXX=${CXX:=g++}
|
||||
export CI=true
|
||||
export USE_NINJA=${USE_NINJA:=1}
|
||||
export CMAKE_GENERATOR=${CMAKE_GENERATOR:=Ninja}
|
||||
export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release}
|
||||
export CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD:=11}
|
||||
|
||||
uname -n
|
||||
if [[ $TRAVIS == true && "$ARCH" == aarch64 ]] ; then
|
||||
export PARALLEL=4
|
||||
elif [[ $TRAVIS == true ]] ; then
|
||||
export PARALLEL=2
|
||||
elif [[ $CIRCLECI == true ]] ; then
|
||||
export PARALLEL=4
|
||||
elif [[ $GITHUB_ACTIONS == true ]] ; then
|
||||
export PARALLEL=4
|
||||
fi
|
||||
export PARALLEL=${PARALLEL:=4}
|
||||
export PAR_MAKEFLAGS=-j${PARALLEL}
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:=${PARALLEL}}
|
||||
export CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL:=${PARALLEL}}
|
||||
|
||||
export LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=$HOME/ext}
|
||||
export PATH=${LOCAL_DEPS_DIR}/bin:$PATH
|
||||
export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/lib:$LD_LIBRARY_PATH
|
||||
export DYLD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/lib:$DYLD_LIBRARY_PATH
|
||||
|
||||
echo "uname -a: " `uname -a`
|
||||
echo "uname -m: " `uname -m`
|
||||
echo "uname -s: " `uname -s`
|
||||
echo "uname -n: " `uname -n`
|
||||
pwd
|
||||
ls
|
||||
env
|
||||
env | sort
|
||||
|
||||
if [[ $ARCH == linux64 ]] ; then
|
||||
if [[ `uname -s` == "Linux" ]] ; then
|
||||
head -40 /proc/cpuinfo
|
||||
elif [[ $ARCH == macosx ]] ; then
|
||||
sysctl machdep.cpu.features
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
|
||||
set -ex
|
||||
|
||||
#dpkg --list
|
||||
|
||||
time apt-get update
|
||||
|
||||
time apt-get install -y \
|
||||
git \
|
||||
cmake \
|
||||
ninja-build \
|
||||
g++ \
|
||||
ccache \
|
||||
libboost-dev libboost-thread-dev \
|
||||
libboost-filesystem-dev libboost-regex-dev \
|
||||
libtiff-dev \
|
||||
libilmbase-dev libopenexr-dev \
|
||||
python-dev python-numpy \
|
||||
libgif-dev \
|
||||
libpng-dev \
|
||||
libraw-dev \
|
||||
libwebp-dev \
|
||||
libfreetype6-dev \
|
||||
dcmtk \
|
||||
libavcodec-dev libavformat-dev libswscale-dev libavutil-dev \
|
||||
locales \
|
||||
opencolorio-tools \
|
||||
wget \
|
||||
libtbb-dev \
|
||||
libopenvdb-dev \
|
||||
libopencv-dev \
|
||||
ptex-base \
|
||||
dcmtk
|
||||
|
||||
|
||||
# time apt-get install -y g++-4.8
|
||||
#time apt-get install -y g++-7
|
||||
#time apt-get install -y g++-8
|
||||
# time apt-get install -y clang
|
||||
# time apt-get install -y llvm
|
||||
#time apt-get install -y libopenjpeg-dev
|
||||
#time apt-get install -y libjpeg-turbo8-dev
|
||||
|
||||
dpkg --list
|
||||
|
||||
# I think opencolor-tools package is adequate for now. For more recent
|
||||
# versions of OCIO, we could buidl it ourselves:
|
||||
#CXX="ccache $CXX" src/build-scripts/build_ocio.bash
|
||||
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/ext/OpenColorIO/dist/lib
|
||||
|
||||
src/build-scripts/install_test_images.bash
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
|
||||
set -ex
|
||||
|
||||
echo "Which g++ " `which g++`
|
||||
g++ --version && true
|
||||
ls /usr/bin/g++* && true
|
||||
/usr/bin/g++ --version && true
|
||||
|
||||
export PATH=/opt/rh/devtoolset-6/root/usr/bin:/usr/local/bin:$PATH
|
||||
#ls /opt/rh/devtoolset-6/root/usr/bin && true
|
||||
#ls /usr/local/bin
|
||||
|
||||
ls /etc/yum.repos.d
|
||||
|
||||
sudo yum install -y giflib giflib-devel && true
|
||||
sudo yum install -y opencv opencv-devel && true
|
||||
sudo yum install -y Field3D Field3D-devel && true
|
||||
|
||||
#sudo rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro && true
|
||||
#sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm && true
|
||||
sudo yum install -y ffmpeg ffmpeg-devel && true
|
||||
|
||||
|
||||
|
||||
if [[ "$CXX" == "clang++" ]] ; then
|
||||
source src/build-scripts/build_llvm.bash
|
||||
fi
|
||||
|
||||
|
||||
src/build-scripts/install_test_images.bash
|
||||
|
||||
source src/build-scripts/build_pybind11.bash
|
||||
|
||||
if [[ "$OPENEXR_BRANCH" || "$OPENEXR_VERSION" ]] ; then
|
||||
source src/build-scripts/build_openexr.bash
|
||||
fi
|
||||
|
||||
if [[ "$LIBTIFF_BRANCH" || "$LIBTIFF_VERSION" ]] ; then
|
||||
source src/build-scripts/build_libtiff.bash
|
||||
fi
|
||||
|
||||
if [[ "$OCIO_BRANCH" || "$OCIO_VERSION" ]] ; then
|
||||
# Temporary (?) fix: GH ninja having problems, fall back to make
|
||||
CMAKE_GENERATOR="Unix Makefiles" \
|
||||
source src/build-scripts/build_ocio.bash
|
||||
fi
|
||||
Executable
+98
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
|
||||
set -ex
|
||||
|
||||
#dpkg --list
|
||||
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
time sudo apt-get update
|
||||
|
||||
time sudo apt-get -q install -y \
|
||||
git \
|
||||
cmake \
|
||||
ninja-build \
|
||||
g++ \
|
||||
ccache \
|
||||
libboost-dev libboost-thread-dev \
|
||||
libboost-filesystem-dev libboost-regex-dev \
|
||||
libtiff-dev \
|
||||
libilmbase-dev libopenexr-dev \
|
||||
python-dev python-numpy \
|
||||
libgif-dev \
|
||||
libpng-dev \
|
||||
libraw-dev \
|
||||
libwebp-dev \
|
||||
libfreetype6-dev \
|
||||
libavcodec-dev libavformat-dev libswscale-dev libavutil-dev \
|
||||
locales \
|
||||
libopencolorio-dev \
|
||||
wget \
|
||||
libtbb-dev \
|
||||
libopenvdb-dev \
|
||||
libopencv-dev \
|
||||
ptex-base \
|
||||
dcmtk \
|
||||
libsquish-dev \
|
||||
qt5-default \
|
||||
libhdf5-dev
|
||||
|
||||
# Disable libheif on CI for now... seems to make crashes in CI tests.
|
||||
# Works fine for me in real life. Investigate.
|
||||
#if [[ "$USE_LIBHEIF" != "0" ]] ; then
|
||||
# sudo add-apt-repository ppa:strukturag/libde265
|
||||
# sudo add-apt-repository ppa:strukturag/libheif
|
||||
# time sudo apt-get -q install -y libheif-dev
|
||||
#fi
|
||||
|
||||
export CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu:$CMAKE_PREFIX_PATH
|
||||
|
||||
if [[ "$CXX" == "g++-4.8" ]] ; then
|
||||
time sudo apt-get install -y g++-4.8
|
||||
elif [[ "$CXX" == "g++-6" ]] ; then
|
||||
time sudo apt-get install -y g++-6
|
||||
elif [[ "$CXX" == "g++-7" ]] ; then
|
||||
time sudo apt-get install -y g++-7
|
||||
elif [[ "$CXX" == "g++-8" ]] ; then
|
||||
time sudo apt-get install -y g++-8
|
||||
elif [[ "$CXX" == "g++-9" ]] ; then
|
||||
time sudo apt-get install -y g++-9
|
||||
elif [[ "$CXX" == "g++-10" ]] ; then
|
||||
time sudo apt-get install -y g++-10
|
||||
fi
|
||||
|
||||
# time sudo apt-get install -y clang
|
||||
# time sudo apt-get install -y llvm
|
||||
#time sudo apt-get install -y libopenjpeg-dev
|
||||
#time sudo apt-get install -y libjpeg-turbo8-dev
|
||||
echo "Which python3 " `which python3`
|
||||
python3 --version && true
|
||||
|
||||
#dpkg --list
|
||||
|
||||
if [[ "$CXX" == "clang++" ]] ; then
|
||||
source src/build-scripts/build_llvm.bash
|
||||
fi
|
||||
|
||||
|
||||
src/build-scripts/install_test_images.bash
|
||||
|
||||
CXX="ccache $CXX" source src/build-scripts/build_pybind11.bash
|
||||
|
||||
if [[ "$OPENEXR_BRANCH" || "$OPENEXR_VERSION" ]] ; then
|
||||
CXX="ccache $CXX" source src/build-scripts/build_openexr.bash
|
||||
fi
|
||||
|
||||
if [[ "$LIBTIFF_BRANCH" || "$LIBTIFF_VERSION" ]] ; then
|
||||
CXX="ccache $CXX" source src/build-scripts/build_libtiff.bash
|
||||
fi
|
||||
|
||||
if [[ "$LIBRAW_BRANCH" || "$LIBRAW_VERSION" ]] ; then
|
||||
CXX="ccache $CXX" source src/build-scripts/build_libraw.bash
|
||||
fi
|
||||
|
||||
if [[ "$OCIO_BRANCH" || "$OCIO_VERSION" ]] ; then
|
||||
# Temporary (?) fix: GH ninja having problems, fall back to make
|
||||
CMAKE_GENERATOR="Unix Makefiles" \
|
||||
source src/build-scripts/build_ocio.bash
|
||||
fi
|
||||
Executable
+137
@@ -0,0 +1,137 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
if [[ ! -e build/$PLATFORM ]] ; then
|
||||
mkdir -p build/$PLATFORM
|
||||
fi
|
||||
if [[ ! -e dist/$PLATFORM ]] ; then
|
||||
mkdir -p dist/$PLATFORM
|
||||
fi
|
||||
|
||||
# DEP_DIR="$PWD/ext/dist"
|
||||
DEP_DIR="$PWD/dist/$PLATFORM"
|
||||
mkdir -p "$DEP_DIR"
|
||||
mkdir -p ext && true
|
||||
INT_DIR="build/$PLATFORM"
|
||||
VCPKG_INSTALLATION_ROOT=/c/vcpkg
|
||||
|
||||
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:=.}
|
||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$DEP_DIR"
|
||||
export BOOST_ROOT=${BOOST_ROOT_1_72_0}
|
||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$BOOST_ROOT"
|
||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
|
||||
export PATH="$PATH:$DEP_DIR/bin:$DEP_DIR/lib:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin:/bin"
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DEP_DIR/bin:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DEP_DIR/lib:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
|
||||
|
||||
# export MY_CMAKE_FLAGS="$MY_CMAKE_FLAGS -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
|
||||
# export OPENEXR_CMAKE_FLAGS="$OPENEXR_CMAKE_FLAGS -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
|
||||
|
||||
ls -l "C:/Program Files (x86)/Microsoft Visual Studio/*/Enterprise/VC/Tools/MSVC" && true
|
||||
ls -l "C:/Program Files (x86)/Microsoft Visual Studio" && true
|
||||
|
||||
|
||||
########################################################################
|
||||
# Dependency method #1: Use vcpkg (disabled)
|
||||
#
|
||||
# Currently we are not using this, but here it is for reference:
|
||||
#
|
||||
# vcpkg list
|
||||
# vcpkg update
|
||||
#
|
||||
# # vcpkg install zlib:x64-windows
|
||||
# vcpkg install tiff:x64-windows
|
||||
# vcpkg install libpng:x64-windows
|
||||
# vcpkg install giflib:x64-windows
|
||||
# vcpkg install freetype:x64-windows
|
||||
# # vcpkg install openexr:x64-windows
|
||||
# # vcpkg install libjpeg-turbo:x64-windows
|
||||
#
|
||||
# vcpkg install libraw:x64-windows
|
||||
# vcpkg install openjpeg:x64-windows
|
||||
# vcpkg install libsquish:x64-windows
|
||||
# # vcpkg install ffmpeg:x64-windows # takes FOREVER!
|
||||
# # vcpkg install webp:x64-windows # No such vcpkg package?a
|
||||
#
|
||||
# #echo "$VCPKG_INSTALLATION_ROOT"
|
||||
# #ls "$VCPKG_INSTALLATION_ROOT"
|
||||
# #echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
|
||||
# #ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
|
||||
# #echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
|
||||
# #ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
|
||||
# #echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
||||
# #ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
||||
#
|
||||
# # export PATH="$PATH:$DEP_DIR/bin:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
||||
# export PATH="$DEP_DIR/lib:$DEP_DIR/bin:$PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
|
||||
# export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib:$DEP_DIR/lib:$DEP_DIR/bin"
|
||||
#
|
||||
# echo "All VCPkg installs:"
|
||||
# vcpkg list
|
||||
#
|
||||
########################################################################
|
||||
|
||||
|
||||
########################################################################
|
||||
# Dependency method #2: Build from source ourselves
|
||||
#
|
||||
#
|
||||
|
||||
src/build-scripts/build_zlib.bash
|
||||
export ZLIB_ROOT=$PWD/ext/dist
|
||||
|
||||
src/build-scripts/build_libpng.bash
|
||||
export PNG_ROOT=$PWD/ext/dist
|
||||
|
||||
src/build-scripts/build_libtiff.bash
|
||||
export TIFF_ROOT=$PWD/ext/dist
|
||||
|
||||
LIBJPEGTURBO_CONFIG_OPTS=-DWITH_SIMD=OFF
|
||||
# ^^ because we're too lazy to build nasm
|
||||
src/build-scripts/build_libjpeg-turbo.bash
|
||||
export JPEGTurbo_ROOT=$PWD/ext/dist
|
||||
|
||||
source src/build-scripts/build_pybind11.bash
|
||||
#export pybind11_ROOT=$PWD/ext/dist
|
||||
|
||||
|
||||
curl --location https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.2.1-win64-dev.zip -o ffmpeg-dev.zip
|
||||
unzip ffmpeg-dev.zip
|
||||
FFmpeg_ROOT=$PWD/ffmpeg-4.2.1-win64-dev
|
||||
|
||||
echo "CMAKE_PREFIX_PATH = $CMAKE_PREFIX_PATH"
|
||||
|
||||
|
||||
OPENEXR_CXX_FLAGS=" /W1 /EHsc /DWIN32=1 "
|
||||
#OPENEXR_BUILD_TYPE=$CMAKE_BUILD_TYPE
|
||||
OPENEXR_INSTALL_DIR=$DEP_DIR
|
||||
OPENEXR_BRANCH=v2.4.0
|
||||
source src/build-scripts/build_openexr.bash
|
||||
export PATH="$OPENEXR_INSTALL_DIR/bin:$OPENEXR_INSTALL_DIR/lib:$PATH"
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PATH
|
||||
# the above line is admittedly sketchy
|
||||
|
||||
cp $DEP_DIR/lib/*.lib $DEP_DIR/bin
|
||||
cp $DEP_DIR/bin/*.dll $DEP_DIR/lib
|
||||
echo "DEP_DIR $DEP_DIR :"
|
||||
ls -R -l "$DEP_DIR"
|
||||
|
||||
|
||||
src/build-scripts/install_test_images.bash
|
||||
|
||||
ls /c/hostedtoolcache/windows/Python
|
||||
echo "/c/hostedtoolcache/windows/Python/3.6.8/x64"
|
||||
ls /c/hostedtoolcache/windows/Python/3.6.8/x64
|
||||
|
||||
|
||||
# source src/build-scripts/build_openexr.bash
|
||||
# export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$ILMBASE_ROOT;$OPENEXR_ROOT"
|
||||
# source src/build-scripts/build_ocio.bash
|
||||
|
||||
|
||||
if [[ "$PYTHON_VERSION" == "3.6" ]] ; then
|
||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.6.8/x64"
|
||||
fi
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script, which assumes it is runnign on a Mac OSX with Homebrew
|
||||
# installed, does a "brew install" in all packages reasonably needed by
|
||||
@@ -24,50 +24,54 @@ brew list --versions
|
||||
if [[ "$BUILDTARGET" == "clang-format" ]] ; then
|
||||
# If we are running for the sake of clang-format only, just install the
|
||||
# bare minimum packages and return.
|
||||
time brew install ilmbase openexr llvm clang-format
|
||||
brew install --display-times ilmbase openexr llvm clang-format libtiff libpng boost ninja giflib
|
||||
brew install --display-times python pybind11 && true
|
||||
brew upgrade --display-times python && true
|
||||
brew link --overwrite python
|
||||
brew upgrade --display-times cmake && true
|
||||
else
|
||||
# All cases except for clang-format target, we need the dependencies.
|
||||
time brew install gcc
|
||||
time brew link --overwrite gcc
|
||||
time brew install ccache cmake ninja
|
||||
time brew install ilmbase openexr
|
||||
time brew install opencolorio
|
||||
time brew install freetype
|
||||
time brew install libraw
|
||||
time brew install libpng webp jpeg-turbo
|
||||
time brew install openjpeg
|
||||
time brew install dcmtk
|
||||
time brew install qt
|
||||
time brew install -s field3d
|
||||
# Note: field3d must be build from source to fix boost mismatch as of
|
||||
# Nov 2018. Maybe it will be fixed soon? Check later.
|
||||
time brew install ffmpeg
|
||||
time brew install opencv
|
||||
time brew install tbb
|
||||
time brew install openvdb
|
||||
time brew install pybind11
|
||||
time brew install libheif
|
||||
brew install --display-times gcc ccache cmake ninja boost && true
|
||||
brew link --overwrite gcc
|
||||
brew install --display-times python && true
|
||||
brew upgrade --display-times python && true
|
||||
brew link --overwrite python
|
||||
brew upgrade --display-times cmake && true
|
||||
brew install --display-times libtiff ilmbase openexr opencolorio
|
||||
brew install --display-times libpng giflib webp jpeg-turbo openjpeg
|
||||
brew install --display-times freetype libraw dcmtk pybind11 numpy && true
|
||||
brew install --display-times ffmpeg libheif libsquish
|
||||
brew install --display-times openvdb tbb
|
||||
brew install --display-times opencv qt ptex
|
||||
brew install --display-times field3d && true
|
||||
fi
|
||||
|
||||
if [[ "$LINKSTATIC" == "1" ]] ; then
|
||||
time brew install little-cms2 tinyxml szip
|
||||
time brew install homebrew/dupes/bzip2
|
||||
time brew install yaml-cpp --with-static-lib
|
||||
brew install --display-times little-cms2 tinyxml szip
|
||||
brew install --display-times homebrew/dupes/bzip2
|
||||
brew install --display-times yaml-cpp --with-static-lib
|
||||
fi
|
||||
if [[ "$CLANG_TIDY" != "" ]] ; then
|
||||
# If we are running for the sake of clang-tidy only, we will need
|
||||
# a modern clang version not just the xcode one.
|
||||
time brew install llvm
|
||||
brew install --display-times llvm
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "After brew installs:"
|
||||
brew list --versions
|
||||
|
||||
# Needed on some systems
|
||||
pip install numpy
|
||||
|
||||
# Set up paths. These will only affect the caller if this script is
|
||||
# run with 'source' rather than in a separate shell.
|
||||
export PATH=/usr/local/opt/qt5/bin:$PATH ;
|
||||
export PATH=/usr/local/opt/python/libexec/bin:$PATH ;
|
||||
export PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH ;
|
||||
export PATH=/usr/local/Cellar/llvm/8.0.0*/bin:$PATH ;
|
||||
export PATH=/usr/local/opt/llvm/bin:$PATH ;
|
||||
|
||||
# If field3d and hdf5 get even slightly out of sync, hdf5 will throw fits.
|
||||
# This is unnecessary, so we disable the step to make CI more likely to
|
||||
# pass in cases where they don't exactly match on the Travis/GH instances.
|
||||
export HDF5_DISABLE_VERSION_CHECK=1
|
||||
|
||||
@@ -5,7 +5,7 @@ if [[ ! -e ../oiio-images ]] ; then
|
||||
fi
|
||||
|
||||
if [[ ! -e ../libtiffpic ]] ; then
|
||||
wget https://download.osgeo.org/libtiff/pics-3.8.0.tar.gz
|
||||
curl -o pics-3.8.0.tar.gz https://download.osgeo.org/libtiff/pics-3.8.0.tar.gz
|
||||
tar xf pics-3.8.0.tar.gz -C ..
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
leak:Imf_2_2
|
||||
leak:Imf_2_3
|
||||
leak:libIlmImf
|
||||
leak:libgomp
|
||||
leak:boost::detail::make_external_thread_data
|
||||
@@ -6,3 +7,4 @@ leak:boost::detail::add_new_tss_node
|
||||
leak:g_malloc0
|
||||
leak:ArgParse::options
|
||||
leak:LibRaw::copy_fuji_uncropped
|
||||
leak:libtbb
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
add_oiio_plugin (cineoninput.cpp
|
||||
libcineon/Cineon.cpp libcineon/OutStream.cpp libcineon/Codec.cpp libcineon/Reader.cpp
|
||||
libcineon/Writer.cpp libcineon/CineonHeader.cpp libcineon/ElementReadStream.cpp
|
||||
libcineon/InStream.cpp)
|
||||
libcineon/Cineon.cpp libcineon/OutStream.cpp libcineon/Codec.cpp
|
||||
libcineon/Reader.cpp libcineon/Writer.cpp libcineon/CineonHeader.cpp
|
||||
libcineon/ElementReadStream.cpp libcineon/InStream.cpp)
|
||||
|
||||
@@ -1,37 +1,12 @@
|
||||
/*
|
||||
Copyright 2010 Larry Gritz and the other authors and contributors.
|
||||
All Rights Reserved.
|
||||
// Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the software's owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(This is the Modified BSD License)
|
||||
*/
|
||||
#include <cmath>
|
||||
|
||||
#include "libcineon/Cineon.h"
|
||||
|
||||
#include <OpenImageIO/dassert.h>
|
||||
#include <OpenImageIO/fmath.h>
|
||||
#include <OpenImageIO/imageio.h>
|
||||
#include <OpenImageIO/strutil.h>
|
||||
#include <OpenImageIO/typedesc.h>
|
||||
@@ -104,13 +79,13 @@ CineonInput::open(const std::string& name, ImageSpec& newspec)
|
||||
// open the image
|
||||
m_stream = new InStream();
|
||||
if (!m_stream->Open(name.c_str())) {
|
||||
error("Could not open file \"%s\"", name.c_str());
|
||||
errorf("Could not open file \"%s\"", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
m_cin.SetInStream(m_stream);
|
||||
if (!m_cin.ReadHeader()) {
|
||||
error("Could not read header");
|
||||
errorf("Could not read header");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -126,7 +101,7 @@ CineonInput::open(const std::string& name, ImageSpec& newspec)
|
||||
case 2: typedesc = TypeDesc::UINT16; break;
|
||||
case 3:
|
||||
case 4: typedesc = TypeDesc::UINT32; break;
|
||||
default: error("Unsupported bit depth %d", maxbits); return false;
|
||||
default: errorf("Unsupported bit depth %d", maxbits); return false;
|
||||
}
|
||||
m_spec = ImageSpec(m_cin.header.Width(), m_cin.header.Height(),
|
||||
m_cin.header.NumberOfElements(), typedesc);
|
||||
@@ -206,7 +181,7 @@ CineonInput::open(const std::string& name, ImageSpec& newspec)
|
||||
case cineon::kRec709Blue: m_spec.attribute("oiio:ColorSpace", "Rec709");
|
||||
default:
|
||||
// either grayscale or printing density
|
||||
if (!isinf(m_cin.header.Gamma()) && m_cin.header.Gamma() != 0.0f)
|
||||
if (!std::isinf(m_cin.header.Gamma()) && m_cin.header.Gamma() != 0.0f)
|
||||
// actual gamma value is read later on
|
||||
m_spec.attribute("oiio:ColorSpace",
|
||||
Strutil::sprintf("GammaCorrected%.2g", g));
|
||||
@@ -214,7 +189,7 @@ CineonInput::open(const std::string& name, ImageSpec& newspec)
|
||||
}
|
||||
|
||||
// gamma exponent
|
||||
if (!isinf(m_cin.header.Gamma()) && m_cin.header.Gamma() != 0.0f)
|
||||
if (!std::isinf(m_cin.header.Gamma()) && m_cin.header.Gamma() != 0.0f)
|
||||
m_spec.attribute("oiio:Gamma", (float)m_cin.header.Gamma());
|
||||
#endif
|
||||
|
||||
@@ -248,40 +223,40 @@ CineonInput::open(const std::string& name, ImageSpec& newspec)
|
||||
// per-file attribs
|
||||
#define CINEON_SET_ATTRIB_S(x, n, s) m_spec.attribute(s, m_cin.header.x(n))
|
||||
#define CINEON_SET_ATTRIB(x, n) CINEON_SET_ATTRIB_S(x, n, "cineon:" #x)
|
||||
#define CINEON_SET_ATTRIB_BYTE(x) \
|
||||
if (m_cin.header.x() != 0xFF) \
|
||||
#define CINEON_SET_ATTRIB_BYTE(x) \
|
||||
if (m_cin.header.x() != 0xFF) \
|
||||
CINEON_SET_ATTRIB(x, )
|
||||
#define CINEON_SET_ATTRIB_INT(x) \
|
||||
if (static_cast<unsigned int>(m_cin.header.x()) != 0xFFFFFFFF) \
|
||||
#define CINEON_SET_ATTRIB_INT(x) \
|
||||
if (static_cast<unsigned int>(m_cin.header.x()) != 0xFFFFFFFF) \
|
||||
CINEON_SET_ATTRIB(x, )
|
||||
#define CINEON_SET_ATTRIB_FLOAT(x) \
|
||||
if (!isinf(m_cin.header.x())) \
|
||||
#define CINEON_SET_ATTRIB_FLOAT(x) \
|
||||
if (!std::isinf(m_cin.header.x())) \
|
||||
CINEON_SET_ATTRIB(x, )
|
||||
#define CINEON_SET_ATTRIB_COORDS(x) \
|
||||
m_cin.header.x(floats); \
|
||||
if (!isinf(floats[0]) && !isinf(floats[1]) \
|
||||
&& !(floats[0] == 0. && floats[1] == 0.)) \
|
||||
#define CINEON_SET_ATTRIB_COORDS(x) \
|
||||
m_cin.header.x(floats); \
|
||||
if (!std::isinf(floats[0]) && !std::isinf(floats[1]) \
|
||||
&& !(floats[0] == 0. && floats[1] == 0.)) \
|
||||
m_spec.attribute("cineon:" #x, TypeDesc(TypeDesc::FLOAT, 2), &floats[0])
|
||||
#define CINEON_SET_ATTRIB_STR(X, x) \
|
||||
if (m_cin.header.x[0] && m_cin.header.x[0] != char(-1)) \
|
||||
#define CINEON_SET_ATTRIB_STR(X, x) \
|
||||
if (m_cin.header.x[0] && m_cin.header.x[0] != char(-1)) \
|
||||
m_spec.attribute("cineon:" #X, m_cin.header.x)
|
||||
|
||||
// per-element attribs
|
||||
#define CINEON_SET_ATTRIB_N(x, a, t, c) \
|
||||
for (int i = 0; i < m_cin.header.NumberOfElements(); i++) { \
|
||||
c(x) a[i] = m_cin.header.x(i); \
|
||||
} \
|
||||
m_spec.attribute("cineon:" #x, \
|
||||
TypeDesc(TypeDesc::t, m_cin.header.NumberOfElements()), \
|
||||
#define CINEON_SET_ATTRIB_N(x, a, t, c) \
|
||||
for (int i = 0; i < m_cin.header.NumberOfElements(); i++) { \
|
||||
c(x) a[i] = m_cin.header.x(i); \
|
||||
} \
|
||||
m_spec.attribute("cineon:" #x, \
|
||||
TypeDesc(TypeDesc::t, m_cin.header.NumberOfElements()), \
|
||||
&a)
|
||||
#define CINEON_CHECK_ATTRIB_FLOAT(x) if (!isinf(m_cin.header.x(i)))
|
||||
#define CINEON_SET_ATTRIB_FLOAT_N(x) \
|
||||
#define CINEON_CHECK_ATTRIB_FLOAT(x) if (!std::isinf(m_cin.header.x(i)))
|
||||
#define CINEON_SET_ATTRIB_FLOAT_N(x) \
|
||||
CINEON_SET_ATTRIB_N(x, floats, FLOAT, CINEON_CHECK_ATTRIB_FLOAT)
|
||||
#define CINEON_CHECK_ATTRIB_INT(x) if (m_cin.header.x(i) != 0xFFFFFFFF)
|
||||
#define CINEON_SET_ATTRIB_INT_N(x) \
|
||||
#define CINEON_SET_ATTRIB_INT_N(x) \
|
||||
CINEON_SET_ATTRIB_N(x, ints, UINT32, CINEON_CHECK_ATTRIB_INT)
|
||||
#define CINEON_CHECK_ATTRIB_BYTE(x) if (m_cin.header.x(i) != 0xFF)
|
||||
#define CINEON_SET_ATTRIB_BYTE_N(x) \
|
||||
#define CINEON_SET_ATTRIB_BYTE_N(x) \
|
||||
CINEON_SET_ATTRIB_N(x, ints, UINT32, CINEON_CHECK_ATTRIB_BYTE)
|
||||
|
||||
CINEON_SET_ATTRIB_STR(Version, version);
|
||||
@@ -391,7 +366,7 @@ CineonInput::close()
|
||||
|
||||
|
||||
bool
|
||||
CineonInput::read_native_scanline(int subimage, int miplevel, int y, int z,
|
||||
CineonInput::read_native_scanline(int subimage, int miplevel, int y, int /*z*/,
|
||||
void* data)
|
||||
{
|
||||
lock_guard lock(m_mutex);
|
||||
|
||||
@@ -159,10 +159,10 @@ void cineon::IndustryHeader::Reset()
|
||||
|
||||
cineon::ImageElement::ImageElement()
|
||||
{
|
||||
this->lowData = 0xffffffff;
|
||||
this->lowQuantity = 0xffffffff;
|
||||
this->highData = 0xffffffff;
|
||||
this->highQuantity = 0xffffffff;
|
||||
this->lowData = R32(0xffffffff);
|
||||
this->lowQuantity = R32(0xffffffff);
|
||||
this->highData = R32(0xffffffff);
|
||||
this->highQuantity = R32(0xffffffff);
|
||||
this->bitDepth = 0xff;
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ void cineon::GenericHeader::SetCreationTimeDate(const long sec)
|
||||
struct tm *tm_time;
|
||||
char str[32];
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
_tzset();
|
||||
#endif
|
||||
|
||||
@@ -560,7 +560,7 @@ void cineon::GenericHeader::SetSourceTimeDate(const long sec)
|
||||
struct tm *tm_time;
|
||||
char str[32];
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
_tzset();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1085,7 +1085,7 @@ namespace cineon
|
||||
* \brief Returns the size of the header
|
||||
* \return 2048 as defined by the standard
|
||||
*/
|
||||
const U32 Size() const;
|
||||
U32 Size() const;
|
||||
|
||||
/*!
|
||||
* \brief Calculate all of the offset members in the header
|
||||
@@ -1128,7 +1128,7 @@ namespace cineon
|
||||
return this->DetermineByteSwap(this->magicNumber);
|
||||
}
|
||||
|
||||
inline const U32 Header::Size() const
|
||||
inline U32 Header::Size() const
|
||||
{
|
||||
return 2048;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
|
||||
#include "Cineon.h"
|
||||
#include "CineonStream.h"
|
||||
#include "EndianSwap.h"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
# add here all the find_dependency() whenever switching to config based dependencies
|
||||
# e.g. if switching to Boost::Boost instead of using ${Boost_LIBRARY_DIRS} the add:
|
||||
# find_dependency(Boost @Boost_VERSION@)
|
||||
|
||||
set_and_check (@PROJECT_NAME@_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||
set_and_check (@PROJECT_NAME@_INCLUDES "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||
set_and_check (@PROJECT_NAME@_LIB_DIR "@CMAKE_INSTALL_FULL_LIBDIR@")
|
||||
set (@PROJECT_NAME@_PLUGIN_SEARCH_PATH "@PLUGIN_SEARCH_PATH_NATIVE@")
|
||||
|
||||
#...logic to determine installedPrefix from the own location...
|
||||
#set (@PROJECT_NAME@_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@")
|
||||
|
||||
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||
|
||||
check_required_components ("@PROJECT_NAME@")
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
# Is the named package "enabled" via our disabling convention? If either
|
||||
# USE_pkgname (or the all-uppercase USE_PKGNAME, or ENABLE_pkgname, or
|
||||
# ENABLE_PKGNAME) exists as either a CMake or environment variable, is
|
||||
# nonempty by contains a non-true/nonnzero value, store false in the
|
||||
# variable named by <enablevar>, otherwise store true.
|
||||
function (check_is_enabled pkgname enablevar)
|
||||
string (TOUPPER ${pkgname} pkgname_upper)
|
||||
set (${enablevar} true PARENT_SCOPE)
|
||||
if (
|
||||
(NOT "${USE_${pkgname}}" STREQUAL "" AND NOT "${USE_${pkgname}}") OR
|
||||
(NOT "${USE_${pkgname_upper}}" STREQUAL "" AND NOT "${USE_${pkgname_upper}}") OR
|
||||
(NOT "$ENV{USE_${pkgname}}" STREQUAL "" AND NOT "$ENV{USE_${pkgname}}") OR
|
||||
(NOT "$ENV{USE_${pkgname_upper}}" STREQUAL "" AND NOT "$ENV{USE_${pkgname_upper}}") OR
|
||||
(NOT "${ENABLE_${pkgname}}" STREQUAL "" AND NOT "${ENABLE_${pkgname}}") OR
|
||||
(NOT "${ENABLE_${pkgname_upper}}" STREQUAL "" AND NOT "${ENABLE_${pkgname_upper}}") OR
|
||||
(NOT "$ENV{ENABLE_${pkgname}}" STREQUAL "" AND NOT "$ENV{ENABLE_${pkgname}}") OR
|
||||
(NOT "$ENV{ENABLE_${pkgname_upper}}" STREQUAL "" AND NOT "$ENV{ENABLE_${pkgname_upper}}") OR
|
||||
(DISABLE_${pkgname} OR DISABLE_${pkgname_upper} OR
|
||||
"$ENV{DISABLE_${pkgname}}" OR "$ENV{DISABLE_${pkgname_upper}}") OR
|
||||
(NOT "${_pkg_ENABLE}" STREQUAL "" AND NOT "${_pkg_ENABLE}")
|
||||
)
|
||||
set (${enablevar} false PARENT_SCOPE)
|
||||
endif ()
|
||||
endfunction ()
|
||||
@@ -0,0 +1,12 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
|
||||
# Define color codes for pretty terminal output
|
||||
string (ASCII 27 ColorEsc)
|
||||
set (ColorReset "${ColorEsc}[m")
|
||||
set (ColorRed "${ColorEsc}[31m")
|
||||
set (ColorGreen "${ColorEsc}[32m")
|
||||
set (ColorYellow "${ColorEsc}[33m")
|
||||
set (ColorBoldWhite "${ColorEsc}[1;37m")
|
||||
+334
-159
@@ -1,41 +1,43 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
###########################################################################
|
||||
#
|
||||
# This file contains compiler-related detection, options, and actions.
|
||||
#
|
||||
# Each option declaration is kept close to the related logic for that
|
||||
# option.
|
||||
#
|
||||
###########################################################################
|
||||
# Compiler-related detection, options, and actions
|
||||
|
||||
message (STATUS "CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
|
||||
message (STATUS "CMAKE_CXX_COMPILER_ID is ${CMAKE_CXX_COMPILER_ID}")
|
||||
|
||||
set (USE_CPP 11 CACHE STRING "C++ standard to prefer (11, 14, 17, etc.)")
|
||||
option (USE_LIBCPLUSPLUS "Compile with clang libc++" OFF)
|
||||
set (USE_SIMD "" CACHE STRING "Use SIMD directives (0, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2, avx512f, f16c, aes)")
|
||||
option (STOP_ON_WARNING "Stop building if there are any compiler warnings" ON)
|
||||
option (HIDE_SYMBOLS "Hide symbols not in the public API" OFF)
|
||||
option (USE_CCACHE "Use ccache if found" ON)
|
||||
option (USE_fPIC "Build with -fPIC")
|
||||
set (EXTRA_CPP_ARGS "" CACHE STRING "Extra C++ command line definitions")
|
||||
set (EXTRA_DSO_LINK_ARGS "" CACHE STRING "Extra command line definitions when building DSOs")
|
||||
option (BUILDSTATIC "Build static libraries instead of shared" OFF)
|
||||
option (LINKSTATIC "Link with static external libraries when possible" OFF)
|
||||
option (CODECOV "Build code coverage tests" OFF)
|
||||
set (SANITIZE "" CACHE STRING "Build code using sanitizer (address, thread)")
|
||||
option (CLANG_TIDY "Enable clang-tidy" OFF)
|
||||
set (CLANG_TIDY_CHECKS "" CACHE STRING "clang-tidy checks to perform (none='-*')")
|
||||
set (CLANG_TIDY_ARGS "" CACHE STRING "clang-tidy args")
|
||||
option (CLANG_TIDY_FIX "Have clang-tidy fix source" OFF)
|
||||
set (CLANG_FORMAT_EXE_HINT "" CACHE STRING "clang-format executable's directory (will search if not specified")
|
||||
set (CLANG_FORMAT_INCLUDES "src/*.h" "src/*.cpp"
|
||||
CACHE STRING "Glob patterns to include for clang-format")
|
||||
# Eventually: want this to be: "src/*.h;src/*.cpp"
|
||||
set (CLANG_FORMAT_EXCLUDES "src/include/OpenImageIO/fmt/*.h"
|
||||
"*pugixml*" "*SHA1*" "*/farmhash.cpp" "*/tinyformat.h"
|
||||
"src/dpx.imageio/libdpx/*"
|
||||
"src/cineon.imageio/libcineon/*"
|
||||
"src/dds.imageio/squish/*"
|
||||
"src/gif.imageio/gif.h"
|
||||
"src/hdr.imageio/rgbe.cpp"
|
||||
CACHE STRING "Glob patterns to exclude for clang-format")
|
||||
set (GLIBCXX_USE_CXX11_ABI "" CACHE STRING "For gcc, use the new C++11 library ABI (0|1)")
|
||||
###########################################################################
|
||||
# Print some basic status about the system and compiler
|
||||
#
|
||||
if (VERBOSE)
|
||||
message (STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
|
||||
message (STATUS "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}")
|
||||
message (STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif ()
|
||||
message (STATUS "CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}")
|
||||
message (STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
|
||||
|
||||
|
||||
###########################################################################
|
||||
# C++ language standard
|
||||
#
|
||||
set (CMAKE_CXX_STANDARD 11 CACHE STRING
|
||||
"C++ standard to prefer (11, 14, 17, 20, etc.)")
|
||||
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set (CMAKE_CXX_EXTENSIONS OFF)
|
||||
message (STATUS "Building for C++${CMAKE_CXX_STANDARD}")
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Figure out which compiler we're using
|
||||
#
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
execute_process (COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
|
||||
OUTPUT_VARIABLE GCC_VERSION
|
||||
@@ -43,9 +45,10 @@ if (CMAKE_COMPILER_IS_GNUCC)
|
||||
if (VERBOSE)
|
||||
message (STATUS "Using gcc ${GCC_VERSION} as the compiler")
|
||||
endif ()
|
||||
else ()
|
||||
set (GCC_VERSION 0)
|
||||
endif ()
|
||||
|
||||
# Figure out which compiler we're using, for tricky cases
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER MATCHES "[Cc]lang")
|
||||
# If using any flavor of clang, set CMAKE_COMPILER_IS_CLANG. If it's
|
||||
# Apple's variety, set CMAKE_COMPILER_IS_APPLECLANG and
|
||||
@@ -73,89 +76,101 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# turn on more detailed warnings and consider warnings as errors
|
||||
|
||||
###########################################################################
|
||||
# Turn on more detailed warnings and optionally consider warnings as errors
|
||||
#
|
||||
option (STOP_ON_WARNING "Stop building if there are any compiler warnings" ON)
|
||||
option (EXTRA_WARNINGS "Enable lots of extra pedantic warnings" OFF)
|
||||
if (NOT MSVC)
|
||||
add_definitions ("-Wall")
|
||||
add_compile_options ("-Wall")
|
||||
if (EXTRA_WARNINGS)
|
||||
add_compile_options ("-Wextra")
|
||||
endif ()
|
||||
if (STOP_ON_WARNING OR DEFINED ENV{CI})
|
||||
add_definitions ("-Werror")
|
||||
add_compile_options ("-Werror")
|
||||
# N.B. Force CI builds (Travis defines $CI) to use -Werror, even if
|
||||
# STOP_ON_WARNING has been switched off by default, which we may do
|
||||
# in release branches.
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||
# cmake bug workaround -- on some platforms, cmake doesn't set
|
||||
# NDEBUG for RelWithDebInfo mode
|
||||
add_definitions ("-DNDEBUG")
|
||||
|
||||
###########################################################################
|
||||
# Control symbol visibility
|
||||
#
|
||||
# We try hard to make default symbol visibility be "hidden", except for
|
||||
# symbols that are part of the public API, which should be marked in the
|
||||
# source code with a special decorator, OIIO_API.
|
||||
#
|
||||
# Additionally, there is a hidesymbols.map file that on some platforms may
|
||||
# give more fine-grained control for hiding symbols, because sometimes
|
||||
# dependent libraries may not be well behaved and need extra hiding.
|
||||
#
|
||||
set (CXX_VISIBILITY_PRESET "hidden" CACHE STRING "Symbol visibility (hidden or default")
|
||||
option (VISIBILITY_INLINES_HIDDEN "Hide symbol visibility of inline functions" ON)
|
||||
set (VISIBILITY_MAP_FILE "${PROJECT_SOURCE_DIR}/src/build-scripts/hidesymbols.map" CACHE FILEPATH "Visibility map file")
|
||||
set (C_VISIBILITY_PRESET ${CXX_VISIBILITY_PRESET})
|
||||
if (${CXX_VISIBILITY_PRESET} STREQUAL "hidden" AND
|
||||
(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) AND
|
||||
(CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU"))
|
||||
# Linux/FreeBSD/Hurd: also hide all the symbols of dependent libraries
|
||||
# to prevent clashes if an app using this project is linked against
|
||||
# other verions of our dependencies.
|
||||
set (VISIBILITY_MAP_COMMAND "-Wl,--version-script=${VISIBILITY_MAP_FILE}")
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Compiler-specific and platform-specific options.
|
||||
#
|
||||
# Here is where we add a whole bunch of options for specific compilers or
|
||||
# platforms. Usually this is to suppress false-positive compiler warnings.
|
||||
#
|
||||
if (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG)
|
||||
# Clang-specific options
|
||||
add_compile_options ("-Wno-unused-function")
|
||||
add_compile_options ("-Wno-overloaded-virtual")
|
||||
add_compile_options ("-Wno-unneeded-internal-declaration")
|
||||
add_compile_options ("-Wno-unused-private-field")
|
||||
add_compile_options ("-Wno-tautological-compare")
|
||||
# disable warning about unused command line arguments
|
||||
add_compile_options ("-Qunused-arguments")
|
||||
# Don't warn if we ask it not to warn about warnings it doesn't know
|
||||
add_compile_options ("-Wunknown-warning-option")
|
||||
if (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 3.6 OR
|
||||
APPLECLANG_VERSION_STRING VERSION_GREATER 6.1)
|
||||
add_compile_options ("-Wno-unused-local-typedefs")
|
||||
endif ()
|
||||
if (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 3.9)
|
||||
# Don't warn about using unknown preprocessor symbols in #if'set
|
||||
add_compile_options ("-Wno-expansion-to-defined")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND NOT (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG))
|
||||
# gcc specific options
|
||||
add_compile_options ("-Wno-unused-local-typedefs")
|
||||
add_compile_options ("-Wno-unused-result")
|
||||
if (NOT ${GCC_VERSION} VERSION_LESS 7.0)
|
||||
add_compile_options ("-Wno-aligned-new")
|
||||
add_compile_options ("-Wno-noexcept-type")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Options common to gcc and clang
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||
# CMake doesn't automatically know what do do with
|
||||
# include_directories(SYSTEM...) when using clang or gcc.
|
||||
set (CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
|
||||
# Options common to gcc and clang
|
||||
|
||||
# Ensure this macro is set for stdint.h
|
||||
add_definitions ("-D__STDC_LIMIT_MACROS")
|
||||
add_definitions ("-D__STDC_CONSTANT_MACROS")
|
||||
# this allows native instructions to be used for sqrtf instead of a function call
|
||||
add_definitions ("-fno-math-errno")
|
||||
add_compile_options ("-fno-math-errno")
|
||||
endif ()
|
||||
|
||||
if (HIDE_SYMBOLS AND NOT DEBUGMODE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||
# Turn default symbol visibility to hidden
|
||||
set (VISIBILITY_COMMAND "-fvisibility=hidden -fvisibility-inlines-hidden")
|
||||
add_definitions (${VISIBILITY_COMMAND})
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU")
|
||||
# Linux/FreeBSD/Hurd: also hide all the symbols of dependent
|
||||
# libraries to prevent clashes if an app using OIIO is linked
|
||||
# against other verions of our dependencies.
|
||||
if (NOT VISIBILITY_MAP_FILE)
|
||||
set (VISIBILITY_MAP_FILE "${PROJECT_SOURCE_DIR}/src/build-scripts/hidesymbols.map")
|
||||
endif ()
|
||||
set (VISIBILITY_MAP_COMMAND "-Wl,--version-script=${VISIBILITY_MAP_FILE}")
|
||||
if (VERBOSE)
|
||||
message (STATUS "VISIBILITY_MAP_COMMAND = ${VISIBILITY_MAP_COMMAND}")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Clang-specific options
|
||||
if (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG)
|
||||
# Disable some warnings for Clang, for some things that are too awkward
|
||||
# to change just for the sake of having no warnings.
|
||||
add_definitions ("-Wno-unused-function")
|
||||
add_definitions ("-Wno-overloaded-virtual")
|
||||
add_definitions ("-Wno-unneeded-internal-declaration")
|
||||
add_definitions ("-Wno-unused-private-field")
|
||||
add_definitions ("-Wno-tautological-compare")
|
||||
# disable warning about unused command line arguments
|
||||
add_definitions ("-Qunused-arguments")
|
||||
# Don't warn if we ask it not to warn about warnings it doesn't know
|
||||
add_definitions ("-Wunknown-warning-option")
|
||||
if (CLANG_VERSION_STRING VERSION_GREATER 3.5 OR
|
||||
APPLECLANG_VERSION_STRING VERSION_GREATER 6.1)
|
||||
add_definitions ("-Wno-unused-local-typedefs")
|
||||
endif ()
|
||||
if (CLANG_VERSION_STRING VERSION_EQUAL 3.9 OR CLANG_VERSION_STRING VERSION_GREATER 3.9)
|
||||
# Don't warn about using unknown preprocessor symbols in #if'set
|
||||
add_definitions ("-Wno-expansion-to-defined")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# gcc specific options
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND NOT (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG))
|
||||
add_definitions ("-Wno-unused-local-typedefs")
|
||||
add_definitions ("-Wno-unused-result")
|
||||
if (NOT ${GCC_VERSION} VERSION_LESS 7.0)
|
||||
add_definitions ("-Wno-aligned-new")
|
||||
add_definitions ("-Wno-noexcept-type")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Microsoft specific options
|
||||
if (MSVC)
|
||||
add_definitions (/W1)
|
||||
# Microsoft specific options
|
||||
add_compile_options (/W1)
|
||||
add_definitions (-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
|
||||
add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
|
||||
@@ -163,7 +178,21 @@ if (MSVC)
|
||||
add_definitions (-DJAS_WIN_MSVC_BUILD)
|
||||
endif (MSVC)
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
|
||||
AND ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
|
||||
# For FreeBSD, minimum arch of i586 is needed for atomic cpu instructions
|
||||
add_compile_options (-march=i586)
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Use ccache if found
|
||||
#
|
||||
# This can really speed up compilation by caching object files that have
|
||||
# been compiled previously with idential arguments and inputs. Putting this
|
||||
# logic here makes it work even if the user is unaware of ccache. If it's
|
||||
# not found on the system, it will simply be silnetly not used.
|
||||
option (USE_CCACHE "Use ccache if found" ON)
|
||||
find_program (CCACHE_FOUND ccache)
|
||||
if (CCACHE_FOUND AND USE_CCACHE)
|
||||
if (CMAKE_COMPILER_IS_CLANG AND USE_QT AND (NOT DEFINED ENV{CCACHE_CPP2}))
|
||||
@@ -174,44 +203,45 @@ if (CCACHE_FOUND AND USE_CCACHE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
set (CSTD_FLAGS "")
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_INTEL)
|
||||
if (USE_CPP VERSION_EQUAL 17)
|
||||
message (STATUS "Building for C++17")
|
||||
set (CSTD_FLAGS "-std=c++17")
|
||||
elseif (USE_CPP VERSION_EQUAL 14)
|
||||
message (STATUS "Building for C++14")
|
||||
set (CSTD_FLAGS "-std=c++14")
|
||||
else ()
|
||||
message (STATUS "Building for C++11")
|
||||
set (CSTD_FLAGS "-std=c++11")
|
||||
endif ()
|
||||
add_definitions (${CSTD_FLAGS})
|
||||
if (CMAKE_COMPILER_IS_CLANG)
|
||||
# C++ >= 11 doesn't like 'register' keyword, which is in Qt headers
|
||||
add_definitions ("-Wno-deprecated-register")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
###########################################################################
|
||||
# Option to force use of libc++ (the LLVM project's alternate C++ standard
|
||||
# library). Currently this only has an effect if using clang as the
|
||||
# compiler. Maybe it would also work for g++? Investigate.
|
||||
option (USE_LIBCPLUSPLUS "Compile with clang libc++" OFF)
|
||||
if (USE_LIBCPLUSPLUS AND CMAKE_COMPILER_IS_CLANG)
|
||||
message (STATUS "Using libc++")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
endif ()
|
||||
|
||||
# GCC 5+: honor build-time option for whether or not to use new string ABI.
|
||||
|
||||
###########################################################################
|
||||
# For gcc >= 5, allow an option to force which version of the C++ ABI to
|
||||
# use (mostly this affects the implementation of std::string).
|
||||
#
|
||||
# FIXME: In theory, this should also be needed for clang, if compiling with
|
||||
# the gcc libstdc++ toolchain. In practice, I could not get things to build
|
||||
# with clang properly when using this option, and I haven't yet seen a case
|
||||
# where it's needed. We can return to this and fix for clang if it becomes a
|
||||
# legit problem later.
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND NOT ${GCC_VERSION} VERSION_LESS 5.0)
|
||||
#
|
||||
set (GLIBCXX_USE_CXX11_ABI "" CACHE STRING "For gcc, use the new C++11 library ABI (0|1)")
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND ${GCC_VERSION} VERSION_GREATER_EQUAL 5.0)
|
||||
if (NOT ${GLIBCXX_USE_CXX11_ABI} STREQUAL "")
|
||||
add_definitions ("-D_GLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
# SIMD and machine architecture options
|
||||
###########################################################################
|
||||
# SIMD and machine architecture options.
|
||||
#
|
||||
# The USE_SIMD optinon may be set to a comma-separated list of machine /
|
||||
# instruction set optinos, such as "avx3,f16c". The list will be parsed and
|
||||
# the proper compiler directives added to generate code for those ISA
|
||||
# capabilities.
|
||||
#
|
||||
set (USE_SIMD "" CACHE STRING "Use SIMD directives (0, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2, avx512f, f16c, aes)")
|
||||
set (SIMD_COMPILE_FLAGS "")
|
||||
if (NOT USE_SIMD STREQUAL "")
|
||||
message (STATUS "Compiling with SIMD level ${USE_SIMD}")
|
||||
@@ -233,29 +263,29 @@ if (NOT USE_SIMD STREQUAL "")
|
||||
# off by default except when we explicitly use madd. At some
|
||||
# future time, we should look at this again carefully and
|
||||
# see if we want to use it more widely by ffp-contract=fast.
|
||||
add_definitions ("-ffp-contract=off")
|
||||
add_compile_options ("-ffp-contract=off")
|
||||
endif ()
|
||||
endforeach()
|
||||
endif ()
|
||||
add_definitions (${SIMD_COMPILE_FLAGS})
|
||||
add_compile_options (${SIMD_COMPILE_FLAGS})
|
||||
endif ()
|
||||
|
||||
|
||||
if (USE_fPIC)
|
||||
add_definitions ("-fPIC")
|
||||
endif ()
|
||||
|
||||
|
||||
# Test for features
|
||||
###########################################################################
|
||||
# Preparation to test for compiler/language features
|
||||
if (NOT VERBOSE)
|
||||
set (CMAKE_REQUIRED_QUIET 1)
|
||||
endif ()
|
||||
include (CMakePushCheckState)
|
||||
include (CheckCXXSourceRuns)
|
||||
include (CheckLibraryExists)
|
||||
|
||||
# Find out if it's safe for us to use std::regex or if we need boost.regex
|
||||
###########################################################################
|
||||
# Find out if it's safe for us to use std::regex or if we need boost.regex.
|
||||
# This is primarily about gcc 4.8 having a broken regex implementation.
|
||||
# This will be obsolete once our minimum supported gcc is >= 4.9.
|
||||
#
|
||||
cmake_push_check_state ()
|
||||
set (CMAKE_REQUIRED_DEFINITIONS ${CSTD_FLAGS})
|
||||
check_cxx_source_runs("
|
||||
#include <regex>
|
||||
int main() {
|
||||
@@ -263,39 +293,79 @@ check_cxx_source_runs("
|
||||
return r == \"a c\" ? 0 : -1;
|
||||
}"
|
||||
USE_STD_REGEX)
|
||||
cmake_pop_check_state ()
|
||||
if (USE_STD_REGEX)
|
||||
add_definitions (-DUSE_STD_REGEX)
|
||||
else ()
|
||||
add_definitions (-DUSE_BOOST_REGEX)
|
||||
endif ()
|
||||
cmake_pop_check_state ()
|
||||
|
||||
###########################################################################
|
||||
# Check if we need libatomic on this platform. We shouldn't on mainstream
|
||||
# x86/x86_64, but might on some other platforms.
|
||||
#
|
||||
if (NOT MSVC AND NOT APPLE)
|
||||
cmake_push_check_state ()
|
||||
check_cxx_source_runs(
|
||||
"#include <atomic>
|
||||
#include <cstdint>
|
||||
std::atomic<uint64_t> x {0};
|
||||
int main() {
|
||||
uint64_t i = x.load(std::memory_order_relaxed);
|
||||
return 0;
|
||||
}"
|
||||
COMPILER_SUPPORTS_ATOMIC_WITHOUT_LIBATOMIC)
|
||||
cmake_pop_check_state ()
|
||||
if (NOT COMPILER_SUPPORTS_ATOMIC_WITHOUT_LIBATOMIC)
|
||||
check_library_exists (atomic __atomic_load_8 "" LIBATOMIC_WORKS)
|
||||
if (LIBATOMIC_WORKS)
|
||||
list (APPEND GCC_ATOMIC_LIBRARIES "-latomic")
|
||||
message (STATUS "Compiler needs libatomic, added")
|
||||
else ()
|
||||
message (FATAL_ERROR "Compiler needs libatomic, but not found")
|
||||
endif ()
|
||||
else ()
|
||||
if (VERBOSE)
|
||||
message (STATUS "Compiler supports std::atomic, no libatomic necessary")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Code coverage options
|
||||
#
|
||||
option (CODECOV "Build code coverage tests" OFF)
|
||||
if (CODECOV AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||
message (STATUS "Compiling for code coverage analysis")
|
||||
add_definitions ("-ftest-coverage -fprofile-arcs -O0 -D${PROJ_NAME}_CODE_COVERAGE=1")
|
||||
add_compile_options ("-ftest-coverage -fprofile-arcs -O0")
|
||||
add_definitions ("-D${PROJ_NAME}_CODE_COVERAGE=1")
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage -fprofile-arcs")
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Sanitizer options
|
||||
#
|
||||
set (SANITIZE "" CACHE STRING "Build code using sanitizer (address, thread)")
|
||||
if (SANITIZE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||
message (STATUS "Compiling for sanitizer=${SANITIZE}")
|
||||
string (REPLACE "," ";" SANITIZE_FEATURE_LIST ${SANITIZE})
|
||||
foreach (feature ${SANITIZE_FEATURE_LIST})
|
||||
message (STATUS " sanitize feature: ${feature}")
|
||||
add_definitions (-fsanitize=${feature})
|
||||
add_compile_options (-fsanitize=${feature})
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${feature}")
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=${feature}")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=${feature}")
|
||||
endforeach()
|
||||
add_definitions (-g -fno-omit-frame-pointer)
|
||||
add_compile_options (-g -fno-omit-frame-pointer)
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set (SANITIZE_ON_LINUX 1)
|
||||
endif ()
|
||||
if (CMAKE_COMPILER_IS_GNUCC AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
add_definitions ("-fuse-ld=gold")
|
||||
add_compile_options ("-fuse-ld=gold")
|
||||
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fuse-ld=gold")
|
||||
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold")
|
||||
@@ -309,7 +379,22 @@ if (SANITIZE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||
add_definitions ("-D${PROJECT_NAME}_SANITIZE=1")
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# clang-tidy options
|
||||
#
|
||||
# clang-tidy is a static analyzer that is part of the LLVM tools. It has a
|
||||
# variety of the usual bug and security tests, linting, and also tests for
|
||||
# things like finding (and correcting!) use of older language constructs.
|
||||
#
|
||||
# If clang-tidy is found and enabled, a "clang-tidy" build target will be
|
||||
# enabled. The set of tests can be customized both here and through
|
||||
# the .clang-tidy file that is part of this project.
|
||||
#
|
||||
option (CLANG_TIDY "Enable clang-tidy" OFF)
|
||||
set (CLANG_TIDY_CHECKS "-*" CACHE STRING "clang-tidy checks to perform (none='-*')")
|
||||
set (CLANG_TIDY_ARGS "" CACHE STRING "clang-tidy args")
|
||||
option (CLANG_TIDY_FIX "Have clang-tidy fix source" OFF)
|
||||
if (CLANG_TIDY)
|
||||
find_program(CLANG_TIDY_EXE NAMES "clang-tidy"
|
||||
DOC "Path to clang-tidy executable")
|
||||
@@ -338,7 +423,26 @@ if (CLANG_TIDY)
|
||||
# Hint: run with CLANG_TIDY_ARGS=-list-checks to list all the checks
|
||||
endif ()
|
||||
|
||||
# clang-format
|
||||
|
||||
###########################################################################
|
||||
# clang-format options
|
||||
#
|
||||
# clang-format is a source code reformatter that is part of the LLVM tools.
|
||||
# It can be used to check adherence to project code formatting rules and
|
||||
# correct any deviations. If clang-format is found on the system, a
|
||||
# "clang-format" build target will trigger a reformatting.
|
||||
#
|
||||
set (CLANG_FORMAT_EXE_HINT "" CACHE PATH "clang-format executable's directory (will search if not specified")
|
||||
set (CLANG_FORMAT_INCLUDES "src/*.h" "src/*.cpp"
|
||||
CACHE STRING "Glob patterns to include for clang-format")
|
||||
set (CLANG_FORMAT_EXCLUDES "*pugixml*" "*SHA1*" "*/farmhash.cpp"
|
||||
"src/dpx.imageio/libdpx/*"
|
||||
"src/cineon.imageio/libcineon/*"
|
||||
"src/dds.imageio/squish/*"
|
||||
"src/gif.imageio/gif.h"
|
||||
"src/hdr.imageio/rgbe.cpp"
|
||||
"src/libutil/stb_sprintf.h"
|
||||
CACHE STRING "Glob patterns to exclude for clang-format")
|
||||
find_program (CLANG_FORMAT_EXE
|
||||
NAMES clang-format bin/clang-format
|
||||
HINTS ${CLANG_FORMAT_EXE_HINT} ENV CLANG_FORMAT_EXE_HINT
|
||||
@@ -365,43 +469,114 @@ else ()
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Another way to sneak in custom compiler and DSO linking flags.
|
||||
#
|
||||
set (EXTRA_CPP_ARGS "" CACHE STRING "Extra C++ command line definitions")
|
||||
if (EXTRA_CPP_ARGS)
|
||||
message (STATUS "Extra C++ args: ${EXTRA_CPP_ARGS}")
|
||||
add_definitions ("${EXTRA_CPP_ARGS}")
|
||||
add_compile_options ("${EXTRA_CPP_ARGS}")
|
||||
endif()
|
||||
set (EXTRA_DSO_LINK_ARGS "" CACHE STRING "Extra command line definitions when building DSOs")
|
||||
|
||||
|
||||
if (BUILDSTATIC)
|
||||
message (STATUS "Building static libraries")
|
||||
set (LIBRARY_BUILD_TYPE STATIC)
|
||||
add_definitions(-D${PROJ_NAME}_STATIC_BUILD=1)
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
# On Linux, the lack of -fPIC when building static libraries seems
|
||||
# incompatible with the dynamic library needed for the Python bindings.
|
||||
set (USE_PYTHON OFF)
|
||||
endif ()
|
||||
###########################################################################
|
||||
# Set the versioning for shared libraries.
|
||||
#
|
||||
if (${PROJECT_NAME}_SUPPORTED_RELEASE)
|
||||
# Supported releases guarantee ABI back-compatibility within the release
|
||||
# family, so SO versioning is major.minor.
|
||||
set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||
CACHE STRING "Set the SO version for dynamic libraries")
|
||||
else ()
|
||||
set (LIBRARY_BUILD_TYPE SHARED)
|
||||
endif()
|
||||
# Development master makes no ABI stability guarantee, so we make the
|
||||
# SO naming capture down to the major.minor.patch level.
|
||||
set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
|
||||
CACHE STRING "Set the SO version for dynamic libraries")
|
||||
endif ()
|
||||
if (VERBOSE)
|
||||
message(STATUS "Setting SOVERSION to: ${SOVERSION}")
|
||||
endif ()
|
||||
|
||||
# Use .a files if LINKSTATIC is enabled
|
||||
|
||||
###########################################################################
|
||||
# BUILD_SHARED_LIBS, if turned off, will disable building of .so/.dll
|
||||
# dynamic libraries and instead only build static libraries.
|
||||
#
|
||||
option (BUILD_SHARED_LIBS "Build shared libraries (set to OFF to build static libs)" ON)
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
add_definitions (-D${PROJ_NAME}_STATIC_DEFINE=1)
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# LINKSTATIC, if enabled, will cause us to favor linking static versions
|
||||
# of library dependencies, if they are available.
|
||||
#
|
||||
option (LINKSTATIC "Link with static external libraries when possible" OFF)
|
||||
if (LINKSTATIC)
|
||||
set (_orig_link_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
message (STATUS "Statically linking external libraries")
|
||||
#set (_orig_link_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
message (STATUS "Statically linking external libraries when possible")
|
||||
if (WIN32)
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
else ()
|
||||
set (CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif ()
|
||||
add_definitions (-DBoost_USE_STATIC_LIBS=1)
|
||||
set (Boost_USE_STATIC_LIBS 1)
|
||||
else ()
|
||||
if (MSVC)
|
||||
add_definitions (-DBOOST_ALL_DYN_LINK)
|
||||
add_definitions (-DOPENEXR_DLL)
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Any extra logic to be run only for CI builds goes here.
|
||||
#
|
||||
if (DEFINED ENV{TRAVIS} OR DEFINED ENV{APPVEYOR} OR DEFINED ENV{CI} OR DEFINED ENV{GITHUB_ACTIONS})
|
||||
add_definitions ("-D${PROJ_NAME}_CI=1" "-DBUILD_CI=1")
|
||||
if (APPLE)
|
||||
# Keep Mono framework from being incorrectly searched for include
|
||||
# files on GitHub Actions CI.
|
||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (DEFINED ENV{TRAVIS} OR DEFINED ENV{APPVEYOR} OR DEFINED ENV{CI})
|
||||
add_definitions ("-D${PROJ_NAME}_CI=1" "-DBUILD_CI=1")
|
||||
|
||||
###########################################################################
|
||||
# Rpath handling at the install step
|
||||
#
|
||||
set (MACOSX_RPATH ON)
|
||||
if (CMAKE_SKIP_RPATH)
|
||||
# We need to disallow the user from truly setting CMAKE_SKIP_RPATH, since
|
||||
# we want to run the generated executables from the build tree in order to
|
||||
# generate the manual page documentation. However, we make sure the
|
||||
# install rpath is unset so that the install tree is still free of rpaths
|
||||
# for linux packaging purposes.
|
||||
set (CMAKE_SKIP_RPATH FALSE)
|
||||
unset (CMAKE_INSTALL_RPATH)
|
||||
else ()
|
||||
if (NOT CMAKE_INSTALL_RPATH)
|
||||
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
endif ()
|
||||
# add the automatically determined parts of the RPATH that
|
||||
# point to directories outside the build tree to the install RPATH
|
||||
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
if (VERBOSE)
|
||||
message (STATUS "CMAKE_INSTALL_RPATH = ${CMAKE_INSTALL_RPATH}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Macro to install targets to the appropriate locations. Use this instead
|
||||
# of the install(TARGETS ...) signature. Note that it adds it to the
|
||||
# export targets list for when we generate config files.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# install_targets (target1 [target2 ...])
|
||||
#
|
||||
macro (install_targets)
|
||||
install (TARGETS ${ARGN}
|
||||
EXPORT ${PROJ_NAME}_EXPORTED_TARGETS
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT user
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT user
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT developer)
|
||||
endmacro()
|
||||
|
||||
+289
-564
@@ -1,92 +1,159 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
###########################################################################
|
||||
# Find libraries
|
||||
# Find external dependencies
|
||||
###########################################################################
|
||||
|
||||
# When not in VERBOSE mode, try to make things as quiet as possible
|
||||
if (NOT VERBOSE)
|
||||
set (Boost_FIND_QUIETLY true)
|
||||
set (DCMTK_FIND_QUIETLY true)
|
||||
set (FFmpeg_FIND_QUIETLY true)
|
||||
set (Field3D_FIND_QUIETLY true)
|
||||
set (Freetype_FIND_QUIETLY true)
|
||||
set (GIF_FIND_QUIETLY true)
|
||||
set (HDF5_FIND_QUIETLY true)
|
||||
set (IlmBase_FIND_QUIETLY true)
|
||||
set (JPEG_FIND_QUIETLY true)
|
||||
set (LIBHEIF_FIND_QUIETLY true)
|
||||
set (LibRaw_FIND_QUIETLY true)
|
||||
set (Nuke_FIND_QUIETLY true)
|
||||
set (OpenColorIO_FIND_QUIETLY true)
|
||||
set (OpenCV_FIND_QUIETLY true)
|
||||
set (OpenEXR_FIND_QUIETLY true)
|
||||
set (OpenGL_FIND_QUIETLY true)
|
||||
set (OpenJpeg_FIND_QUIETLY true)
|
||||
set (OPENVDB_FIND_QUIETLY true)
|
||||
set (PkgConfig_FIND_QUIETLY true)
|
||||
set (PNG_FIND_QUIETLY TRUE)
|
||||
set (PTex_FIND_QUIETLY TRUE)
|
||||
set (PugiXML_FIND_QUIETLY TRUE)
|
||||
set (PythonInterp_FIND_QUIETLY true)
|
||||
set (PythonLibs_FIND_QUIETLY true)
|
||||
set (Qt5_FIND_QUIETLY true)
|
||||
set (TBB_FIND_QUIETLY true)
|
||||
set (Threads_FIND_QUIETLY true)
|
||||
set (TIFF_FIND_QUIETLY true)
|
||||
set (WEBP_FIND_QUIETLY true)
|
||||
set (ZLIB_FIND_QUIETLY true)
|
||||
endif ()
|
||||
|
||||
message (STATUS "${ColorBoldWhite}")
|
||||
message (STATUS "* Checking for dependencies...")
|
||||
message (STATUS "* - Missing a dependency 'Package'?")
|
||||
message (STATUS "* Try cmake -DPackage_ROOT=path or set environment var Package_ROOT=path")
|
||||
message (STATUS "* For many dependencies, we supply src/build-scripts/build_Package.bash")
|
||||
message (STATUS "* - To exclude an optional dependency (even if found),")
|
||||
message (STATUS "* -DUSE_Package=OFF or set environment var USE_Package=OFF ")
|
||||
message (STATUS "${ColorReset}")
|
||||
|
||||
set (OIIO_LOCAL_DEPS_PATH "${CMAKE_SOURCE_DIR}/ext/dist" CACHE STRING
|
||||
"Local area for dependencies added to CMAKE_PREFIX_PATH")
|
||||
list (APPEND CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/ext/dist)
|
||||
|
||||
set (REQUIED_DEPS "" CACHE STRING
|
||||
"Additional dependencies to consider required (semicolon-separated list, or ALL)")
|
||||
set (OPTIONAL_DEPS "" CACHE STRING
|
||||
"Additional dependencies to consider optional (semicolon-separated list, or ALL)")
|
||||
|
||||
|
||||
# checked_find_package(pkgname ..) is a wrapper for find_package, with the
|
||||
# following extra features:
|
||||
# * If either `USE_pkgname` or the all-uppercase `USE_PKGNAME` (or
|
||||
# `ENABLE_pkgname` or `ENABLE_PKGNAME`) exists as either a CMake or
|
||||
# environment variable, is nonempty by contains a non-true/nonnzero
|
||||
# value, do not search for or use the package. The optional ENABLE <var>
|
||||
# arguments allow you to override the name of the enabling variable. In
|
||||
# other words, support for the dependency is presumed to be ON, unless
|
||||
# turned off explicitly from one of these sources.
|
||||
# * Print a message if the package is enabled but not found. This is based
|
||||
# on ${pkgname}_FOUND or $PKGNNAME_FOUND.
|
||||
# * Optional DEFINITIONS <string> are passed to add_definitions if the
|
||||
# package is found.
|
||||
# * Optional PRINT <list> is a list of variables that will be printed
|
||||
# if the package is found, if VERBOSE is on.
|
||||
# * Optional DEPS <list> is a list of hard dependencies; for each one, if
|
||||
# dep_FOUND is not true, disable this package with an error message.
|
||||
# * Optional ISDEPOF <downstream> names another package for which the
|
||||
# present package is only needed because it's a dependency, and
|
||||
# therefore if <downstream> is disabled, we don't bother with this
|
||||
# package either.
|
||||
#
|
||||
# N.B. This needs to be a macro, not a function, because the find modules
|
||||
# will set(blah val PARENT_SCOPE) and we need that to be the global scope,
|
||||
# not merely the scope for this function.
|
||||
macro (checked_find_package pkgname)
|
||||
cmake_parse_arguments(_pkg "REQUIRED" "ENABLE;ISDEPOF" "DEFINITIONS;PRINT;DEPS" ${ARGN})
|
||||
# Arguments: <prefix> noValueKeywords singleValueKeywords multiValueKeywords argsToParse
|
||||
string (TOUPPER ${pkgname} pkgname_upper)
|
||||
if (NOT VERBOSE)
|
||||
set (${pkgname}_FIND_QUIETLY true)
|
||||
set (${pkgname_upper}_FIND_QUIETLY true)
|
||||
endif ()
|
||||
if ("${pkgname}" IN_LIST REQUIRED_DEPS OR "ALL" IN_LIST REQUIRED_DEPS)
|
||||
set (_pkg_REQUIRED 1)
|
||||
endif ()
|
||||
if ("${pkgname}" IN_LIST OPTIONAL_DEPS OR "ALL" IN_LIST OPTIONAL_DEPS)
|
||||
set (_pkg_REQUIRED 0)
|
||||
endif ()
|
||||
set (_quietskip false)
|
||||
check_is_enabled (${pkgname} _enable)
|
||||
set (_disablereason "")
|
||||
foreach (_dep ${_pkg_DEPS})
|
||||
if (_enable AND NOT ${_dep}_FOUND)
|
||||
set (_enable false)
|
||||
set (ENABLE_${pkgname} OFF PARENT_SCOPE)
|
||||
set (_disablereason "(because ${_dep} was not found)")
|
||||
endif ()
|
||||
endforeach ()
|
||||
if (_pkg_ISDEPOF)
|
||||
check_is_enabled (${_pkg_ISDEPOF} _dep_enabled)
|
||||
if (NOT _dep_enabled)
|
||||
set (_enable false)
|
||||
set (_quietskip true)
|
||||
endif ()
|
||||
endif ()
|
||||
if (_enable OR _pkg_REQUIRED)
|
||||
find_package (${pkgname} ${_pkg_UNPARSED_ARGUMENTS})
|
||||
if (${pkgname}_FOUND OR ${pkgname_upper}_FOUND)
|
||||
foreach (_vervar ${pkgname_upper}_VERSION ${pkgname}_VERSION_STRING
|
||||
${pkgname_upper}_VERSION_STRING)
|
||||
if (NOT ${pkgname}_VERSION AND ${_vervar})
|
||||
set (${pkgname}_VERSION ${${_vervar}})
|
||||
endif ()
|
||||
endforeach ()
|
||||
message (STATUS "${ColorGreen}Found ${pkgname} ${${pkgname}_VERSION} ${ColorReset}")
|
||||
if (VERBOSE)
|
||||
set (_vars_to_print ${pkgname}_INCLUDES ${pkgname_upper}_INCLUDES
|
||||
${pkgname}_INCLUDE_DIR ${pkgname_upper}_INCLUDE_DIR
|
||||
${pkgname}_INCLUDE_DIRS ${pkgname_upper}_INCLUDE_DIRS
|
||||
${pkgname}_LIBRARIES ${pkgname_upper}_LIBRARIES
|
||||
${_pkg_PRINT})
|
||||
list (REMOVE_DUPLICATES _vars_to_print)
|
||||
foreach (_v IN LISTS _vars_to_print)
|
||||
if (NOT "${${_v}}" STREQUAL "")
|
||||
message (STATUS " ${_v} = ${${_v}}")
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
add_definitions (${_pkg_DEFINITIONS})
|
||||
else ()
|
||||
message (STATUS "${ColorRed}${pkgname} library not found ${ColorReset}")
|
||||
if (${pkgname}_ROOT)
|
||||
message (STATUS "${ColorRed} ${pkgname}_ROOT was: ${${pkgname}_ROOT} ${ColorReset}")
|
||||
elseif ($ENV{${pkgname}_ROOT})
|
||||
message (STATUS "${ColorRed} ENV ${pkgname}_ROOT was: ${${pkgname}_ROOT} ${ColorReset}")
|
||||
else ()
|
||||
message (STATUS "${ColorRed} Try setting ${pkgname}_ROOT ? ${ColorReset}")
|
||||
endif ()
|
||||
if (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname}.bash")
|
||||
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_${pkgname}.bash ${ColorReset}")
|
||||
endif ()
|
||||
if (_pkg_REQUIRED)
|
||||
message (FATAL_ERROR "${ColorRed}${pkgname} is required, aborting.${ColorReset}")
|
||||
endif ()
|
||||
endif()
|
||||
else ()
|
||||
if (NOT _quietskip)
|
||||
message (STATUS "${ColorRed}Not using ${pkgname} -- disabled ${_disablereason} ${ColorReset}")
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
|
||||
|
||||
|
||||
include (ExternalProject)
|
||||
|
||||
option (BUILD_MISSING_DEPS "Try to download and build any missing dependencies" OFF)
|
||||
|
||||
|
||||
###########################################################################
|
||||
# TIFF
|
||||
if (NOT TIFF_LIBRARIES OR NOT TIFF_INCLUDE_DIR)
|
||||
find_package (TIFF 3.9 REQUIRED)
|
||||
include_directories (${TIFF_INCLUDE_DIR})
|
||||
else ()
|
||||
message (STATUS "Custom TIFF_LIBRARIES ${TIFF_LIBRARIES}")
|
||||
message (STATUS "Custom TIFF_INCLUDE_DIR ${TIFF_INCLUDE_DIR}")
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Several packages need Zlib
|
||||
find_package (ZLIB REQUIRED)
|
||||
|
||||
|
||||
###########################################################################
|
||||
# PNG
|
||||
find_package (PNG REQUIRED)
|
||||
|
||||
|
||||
###########################################################################
|
||||
# IlmBase & OpenEXR setup
|
||||
|
||||
find_package (OpenEXR 2.0 REQUIRED)
|
||||
#OpenEXR 2.2 still has problems with importing ImathInt64.h unqualified
|
||||
#thus need for ilmbase/OpenEXR
|
||||
include_directories ("${OPENEXR_INCLUDE_DIR}"
|
||||
"${ILMBASE_INCLUDE_DIR}"
|
||||
"${ILMBASE_INCLUDE_DIR}/OpenEXR")
|
||||
if (NOT OpenEXR_FIND_QUIETLY)
|
||||
message (STATUS "OPENEXR_INCLUDE_DIR = ${OPENEXR_INCLUDE_DIR}")
|
||||
message (STATUS "OPENEXR_LIBRARIES = ${OPENEXR_LIBRARIES}")
|
||||
endif ()
|
||||
|
||||
|
||||
# OpenEXR setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Boost setup
|
||||
|
||||
if (LINKSTATIC)
|
||||
set (Boost_USE_STATIC_LIBS ON)
|
||||
set (Boost_USE_STATIC_LIBS ON)
|
||||
if (MSVC)
|
||||
add_definitions (-DBOOST_ALL_NO_LIB=1)
|
||||
endif ()
|
||||
else ()
|
||||
if (MSVC)
|
||||
add_definitions (-DBOOST_ALL_DYN_LINK=1)
|
||||
endif ()
|
||||
endif ()
|
||||
set (Boost_USE_MULTITHREADED ON)
|
||||
if (BOOST_CUSTOM)
|
||||
set (Boost_FOUND true)
|
||||
# N.B. For a custom version, the caller had better set up the variables
|
||||
@@ -96,17 +163,21 @@ else ()
|
||||
if (NOT USE_STD_REGEX)
|
||||
list (APPEND Boost_COMPONENTS regex)
|
||||
endif ()
|
||||
find_package (Boost 1.53 REQUIRED
|
||||
COMPONENTS ${Boost_COMPONENTS})
|
||||
# The FindBoost.cmake interface is broken if it uses boost's installed
|
||||
# cmake output (e.g. boost 1.70.0, cmake <= 3.14). Specifically it fails
|
||||
# to set the expected variables printed below. So until that's fixed
|
||||
# force FindBoost.cmake to use the original brute force path.
|
||||
set (Boost_NO_BOOST_CMAKE ON)
|
||||
checked_find_package (Boost 1.53 REQUIRED
|
||||
COMPONENTS ${Boost_COMPONENTS}
|
||||
PRINT Boost_INCLUDE_DIRS Boost_LIBRARIES
|
||||
)
|
||||
endif ()
|
||||
|
||||
message (STATUS "Boost version ${Boost_VERSION}")
|
||||
if (NOT Boost_FIND_QUIETLY)
|
||||
message (STATUS "Boost found ${Boost_FOUND} ")
|
||||
message (STATUS "BOOST_ROOT ${BOOST_ROOT}")
|
||||
message (STATUS "Boost include dirs ${Boost_INCLUDE_DIRS}")
|
||||
message (STATUS "Boost library dirs ${Boost_LIBRARY_DIRS}")
|
||||
message (STATUS "Boost libraries ${Boost_LIBRARIES}")
|
||||
# On Linux, Boost 1.55 and higher seems to need to link against -lrt
|
||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux"
|
||||
AND ${Boost_VERSION} VERSION_GREATER_EQUAL 105500)
|
||||
list (APPEND Boost_LIBRARIES "rt")
|
||||
endif ()
|
||||
|
||||
include_directories (SYSTEM "${Boost_INCLUDE_DIRS}")
|
||||
@@ -115,546 +186,200 @@ link_directories ("${Boost_LIBRARY_DIRS}")
|
||||
# end Boost setup
|
||||
###########################################################################
|
||||
|
||||
###########################################################################
|
||||
# OpenGL setup
|
||||
|
||||
if (USE_OPENGL)
|
||||
find_package (OpenGL)
|
||||
if (NOT OpenGL_FIND_QUIETLY)
|
||||
message (STATUS "OPENGL_FOUND=${OPENGL_FOUND} USE_OPENGL=${USE_OPENGL}")
|
||||
endif ()
|
||||
###########################################################################
|
||||
# Dependencies for required formats and features. These are so critical
|
||||
# that we will not complete the build if they are not found.
|
||||
|
||||
checked_find_package (ZLIB REQUIRED) # Needed by several packages
|
||||
checked_find_package (TIFF 3.0 REQUIRED)
|
||||
|
||||
# IlmBase & OpenEXR
|
||||
checked_find_package (OpenEXR 2.0 REQUIRED)
|
||||
# We use Imath so commonly, may as well include it everywhere.
|
||||
include_directories ("${OPENEXR_INCLUDES}" "${ILMBASE_INCLUDES}"
|
||||
"${ILMBASE_INCLUDES}/OpenEXR")
|
||||
if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3)
|
||||
# clang C++ >= 11 doesn't like 'register' keyword in old exr headers
|
||||
add_compile_options (-Wno-deprecated-register)
|
||||
endif ()
|
||||
|
||||
# end OpenGL setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# OpenColorIO Setup
|
||||
|
||||
if (USE_OCIO)
|
||||
# If 'OCIO_PATH' not set, use the env variable of that name if available
|
||||
if (NOT OCIO_PATH)
|
||||
if (NOT $ENV{OCIO_PATH} STREQUAL "")
|
||||
set (OCIO_PATH $ENV{OCIO_PATH})
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
find_package (OpenColorIO)
|
||||
|
||||
if (OCIO_FOUND)
|
||||
include_directories (${OCIO_INCLUDES})
|
||||
add_definitions ("-DUSE_OCIO=1")
|
||||
else ()
|
||||
message (STATUS "Skipping OpenColorIO support")
|
||||
endif ()
|
||||
|
||||
if (LINKSTATIC)
|
||||
find_library (TINYXML_LIBRARY NAMES tinyxml)
|
||||
if (TINYXML_LIBRARY)
|
||||
set (OCIO_LIBRARIES ${OCIO_LIBRARIES} ${TINYXML_LIBRARY})
|
||||
endif ()
|
||||
find_library (YAML_LIBRARY NAMES yaml-cpp)
|
||||
if (YAML_LIBRARY)
|
||||
set (OCIO_LIBRARIES ${OCIO_LIBRARIES} ${YAML_LIBRARY})
|
||||
endif ()
|
||||
find_library (LCMS2_LIBRARY NAMES lcms2)
|
||||
if (LCMS2_LIBRARY)
|
||||
set (OCIO_LIBRARIES ${OCIO_LIBRARIES} ${LCMS2_LIBRARY})
|
||||
endif ()
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "OpenColorIO disabled")
|
||||
endif ()
|
||||
|
||||
# end OpenColorIO setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Qt setup
|
||||
|
||||
if (USE_QT)
|
||||
set (qt5_modules Core Gui Widgets)
|
||||
if (USE_OPENGL)
|
||||
list (APPEND qt5_modules OpenGL)
|
||||
endif ()
|
||||
find_package (Qt5 COMPONENTS ${qt5_modules})
|
||||
endif ()
|
||||
if (USE_QT AND Qt5_FOUND)
|
||||
if (NOT Qt5_FIND_QUIETLY)
|
||||
message (STATUS "Qt5_FOUND=${Qt5_FOUND}")
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "No Qt5 -- skipping components that need Qt5.")
|
||||
if (USE_QT AND NOT Qt5_FOUND AND APPLE)
|
||||
message (STATUS "If you think you installed qt5 with Homebrew and it still doesn't work,")
|
||||
message (STATUS "try: export PATH=/usr/local/opt/qt5/bin:$PATH")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# end Qt setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# BZIP2 - used by ffmped and freetype
|
||||
find_package (BZip2) # Used by ffmpeg
|
||||
if (NOT BZIP2_FOUND)
|
||||
set (BZIP2_LIBRARIES "")
|
||||
if (MSVC AND NOT LINKSTATIC)
|
||||
add_definitions (-DOPENEXR_DLL) # Is this needed for new versions?
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# FFmpeg
|
||||
|
||||
if (USE_FFMPEG)
|
||||
find_package (FFmpeg 2.6)
|
||||
if (FFMPEG_INCLUDE_DIR AND FFMPEG_LIBRARIES)
|
||||
set (FFMPEG_FOUND TRUE)
|
||||
if (NOT FFmpeg_FIND_QUIETLY)
|
||||
message (STATUS "FFMPEG includes = ${FFMPEG_INCLUDE_DIR}")
|
||||
message (STATUS "FFMPEG library = ${FFMPEG_LIBRARIES}")
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "FFMPEG not found")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
# end FFmpeg setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Field3d
|
||||
|
||||
if (USE_FIELD3D)
|
||||
if (HDF5_CUSTOM)
|
||||
if (NOT HDF5_FIND_QUIETLY)
|
||||
message (STATUS "Using custom HDF5")
|
||||
endif ()
|
||||
set (HDF5_FOUND true)
|
||||
# N.B. For a custom version, the caller had better set up the
|
||||
# variables HDF5_INCLUDE_DIRS and HDF5_LIBRARIES.
|
||||
else ()
|
||||
find_library (HDF5_LIBRARIES
|
||||
NAMES hdf5
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
)
|
||||
if (HDF5_LIBRARIES)
|
||||
set (HDF5_FOUND true)
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT HDF5_FIND_QUIETLY)
|
||||
message (STATUS "HDF5_FOUND=${HDF5_FOUND}")
|
||||
message (STATUS "HDF5_LIBRARIES=${HDF5_LIBRARIES}")
|
||||
endif ()
|
||||
endif ()
|
||||
if (USE_FIELD3D AND HDF5_FOUND)
|
||||
if (NOT Field3D_FIND_QUIETLY)
|
||||
message (STATUS "FIELD3D_HOME=${FIELD3D_HOME}")
|
||||
endif ()
|
||||
if (FIELD3D_HOME)
|
||||
set (FIELD3D_INCLUDES "${FIELD3D_HOME}/include")
|
||||
else ()
|
||||
find_path (FIELD3D_INCLUDES Field3D/Field.h
|
||||
"${PROJECT_SOURCE_DIR}/src/include"
|
||||
"${FIELD3D_HOME}/include"
|
||||
)
|
||||
endif ()
|
||||
find_library (FIELD3D_LIBRARY
|
||||
NAMES Field3D
|
||||
PATHS "${FIELD3D_HOME}/lib"
|
||||
)
|
||||
if (FIELD3D_INCLUDES AND FIELD3D_LIBRARY)
|
||||
set (FIELD3D_FOUND TRUE)
|
||||
if (NOT Field3D_FIND_QUIETLY)
|
||||
message (STATUS "Field3D includes = ${FIELD3D_INCLUDES}")
|
||||
message (STATUS "Field3D library = ${FIELD3D_LIBRARY}")
|
||||
endif ()
|
||||
add_definitions ("-DUSE_FIELD3D=1")
|
||||
include_directories ("${FIELD3D_INCLUDES}")
|
||||
else ()
|
||||
message (STATUS "Field3D not found")
|
||||
add_definitions ("-UUSE_FIELD3D")
|
||||
set (FIELD3D_FOUND FALSE)
|
||||
endif ()
|
||||
else ()
|
||||
add_definitions ("-UUSE_FIELD3D")
|
||||
message (STATUS "Field3d will not be used")
|
||||
# JPEG -- prefer Turbo-JPEG to regular libjpeg
|
||||
checked_find_package (JPEGTurbo
|
||||
DEFINITIONS -DUSE_JPEG_TURBO=1
|
||||
PRINT JPEG_INCLUDES JPEG_LIBRARIES)
|
||||
if (NOT JPEG_FOUND) # Try to find the non-turbo version
|
||||
checked_find_package (JPEG REQUIRED)
|
||||
endif ()
|
||||
|
||||
# end Field3d setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Intel TBB
|
||||
if (USE_TBB)
|
||||
if (DEBUGMODE)
|
||||
set(TBB_USE_DEBUG_BUILD ON)
|
||||
endif ()
|
||||
find_package (TBB 2017) # 2017 min for VFX Platform 2018
|
||||
if (TBB_FOUND)
|
||||
if (NOT TBB_FIND_QUIETLY)
|
||||
message (STATUS "Intel TBB includes = ${TBB_INCLUDE_DIRS}")
|
||||
message (STATUS "Intel TBB library = ${TBB_LIBRARIES}")
|
||||
endif ()
|
||||
add_definitions ("-DUSE_TBB=1")
|
||||
else ()
|
||||
message (STATUS "Intel TBB not found, TBB_ROOT_DIR='${TBB_ROOT_DIR}'")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# end Intel TBB setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# OpenVDB
|
||||
if (USE_OPENVDB AND TBB_FOUND)
|
||||
find_package (OpenVDB 5.0) # 5.0 min for VFX Platform 2017
|
||||
if (OPENVDB_FOUND)
|
||||
if (NOT OPENVDB_FIND_QUIETLY)
|
||||
message (STATUS "OpenVDB includes = ${OPENVDB_INCLUDE_DIRS}")
|
||||
message (STATUS "OpenVDB libraries = ${OPENVDB_LIBRARIES}")
|
||||
endif ()
|
||||
add_definitions ("-DUSE_OPENVDB=1")
|
||||
else ()
|
||||
message (STATUS "OpenVDB not found, OPENVDB_ROOT_DIR='${OPENVDB_ROOT_DIR}'")
|
||||
endif ()
|
||||
else ()
|
||||
if (USE_OPENVDB AND NOT TBB_FOUND)
|
||||
set (oiio_vdb_why ", could not find Intel TBB")
|
||||
endif ()
|
||||
message (STATUS "OpenVDB will not be used${oiio_vdb_why}")
|
||||
endif ()
|
||||
|
||||
# end OpenVDB setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
|
||||
###########################################################################
|
||||
# JPEG
|
||||
|
||||
if (USE_JPEGTURBO)
|
||||
find_package (JPEGTurbo)
|
||||
endif ()
|
||||
if (JPEG_FOUND)
|
||||
add_definitions ("-DUSE_JPEG_TURBO=1")
|
||||
set (JPEG_TURBO_FOUND 1)
|
||||
else ()
|
||||
# Try to find the non-turbo version
|
||||
find_package (JPEG REQUIRED)
|
||||
endif ()
|
||||
include_directories (${JPEG_INCLUDE_DIR})
|
||||
|
||||
# end JPEG
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# OpenJpeg
|
||||
if (USE_OPENJPEG)
|
||||
find_package (OpenJpeg)
|
||||
endif()
|
||||
# end OpenJpeg setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# LibRaw
|
||||
if (USE_LIBRAW)
|
||||
if (NOT LibRaw_FIND_QUIETLY)
|
||||
message (STATUS "Looking for LibRaw with ${LIBRAW_PATH}")
|
||||
endif ()
|
||||
find_package (LibRaw)
|
||||
if (LibRaw_r_LIBRARIES AND LibRaw_INCLUDE_DIR)
|
||||
set (LIBRAW_FOUND TRUE)
|
||||
include_directories (${LibRaw_INCLUDE_DIR})
|
||||
if (NOT LibRaw_FIND_QUIETLY)
|
||||
message (STATUS "Found LibRaw, include ${LibRaw_INCLUDE_DIR}")
|
||||
endif ()
|
||||
else ()
|
||||
set (LIBRAW_FOUND FALSE)
|
||||
message (STATUS "LibRaw not found!")
|
||||
endif()
|
||||
|
||||
if (LINKSTATIC)
|
||||
find_package (Jasper)
|
||||
find_library (LCMS2_LIBRARIES NAMES lcms2)
|
||||
set (LibRaw_r_LIBRARIES ${LibRaw_r_LIBRARIES} ${JASPER_LIBRARIES} ${LCMS2_LIBRARIES})
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "Not using LibRaw")
|
||||
endif()
|
||||
|
||||
# end LibRaw setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# WebP setup
|
||||
|
||||
if (USE_WEBP)
|
||||
if (NOT WEBP_FIND_QUIETLY)
|
||||
message (STATUS "WEBP_HOME=${WEBP_HOME}")
|
||||
endif ()
|
||||
find_path (WEBP_INCLUDE_DIR webp/encode.h
|
||||
"${PROJECT_SOURCE_DIR}/src/include"
|
||||
"${WEBP_HOME}")
|
||||
find_library (WEBP_LIBRARY
|
||||
NAMES webp
|
||||
PATHS "${WEBP_HOME}")
|
||||
if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
|
||||
set (WEBP_FOUND TRUE)
|
||||
if (NOT WEBP_FIND_QUIETLY)
|
||||
message (STATUS "WEBP includes = ${WEBP_INCLUDE_DIR} ")
|
||||
message (STATUS "WEBP library = ${WEBP_LIBRARY} ")
|
||||
endif ()
|
||||
else()
|
||||
set (WEBP_FOUND FALSE)
|
||||
message (STATUS "WebP library not found")
|
||||
endif()
|
||||
else ()
|
||||
message (STATUS "Not using WebP")
|
||||
endif ()
|
||||
|
||||
# end Webp setup
|
||||
###########################################################################
|
||||
|
||||
###########################################################################
|
||||
# Pugixml setup. Normally we just use the version bundled with oiio, but
|
||||
# some linux distros are quite particular about having separate packages so we
|
||||
# allow this to be overridden to use the distro-provided package if desired.
|
||||
option (USE_EXTERNAL_PUGIXML "Use an externally built shared library version of the pugixml library" OFF)
|
||||
if (USE_EXTERNAL_PUGIXML)
|
||||
find_package (PugiXML REQUIRED)
|
||||
# insert include path to pugixml first, to ensure that the external
|
||||
# pugixml is found, and not the one in OIIO's include directory.
|
||||
include_directories (BEFORE ${PUGIXML_INCLUDE_DIR})
|
||||
add_definitions ("-DUSE_EXTERNAL_PUGIXML=1")
|
||||
checked_find_package (pugixml REQUIRED
|
||||
DEFINITIONS -DUSE_EXTERNAL_PUGIXML=1)
|
||||
endif()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# OpenCV setup
|
||||
|
||||
if (USE_OPENCV)
|
||||
find_package (OpenCV)
|
||||
if (OpenCV_FOUND)
|
||||
add_definitions ("-DUSE_OPENCV")
|
||||
else ()
|
||||
message (STATUS "OpenCV library not found")
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "Not using OpenCV")
|
||||
###########################################################################
|
||||
# Dependencies for optional formats and features. If these are not found,
|
||||
# we will continue building, but the related functionality will be disabled.
|
||||
|
||||
checked_find_package (PNG)
|
||||
|
||||
checked_find_package (BZip2) # Used by ffmpeg and freetype
|
||||
if (NOT BZIP2_FOUND)
|
||||
set (BZIP2_LIBRARIES "") # TODO: why does it break without this?
|
||||
endif ()
|
||||
|
||||
# end OpenCV setup
|
||||
###########################################################################
|
||||
checked_find_package (Freetype
|
||||
DEFINITIONS -DUSE_FREETYPE=1 )
|
||||
|
||||
checked_find_package (HDF5
|
||||
ISDEPOF Field3D)
|
||||
checked_find_package (OpenColorIO
|
||||
DEFINITIONS -DUSE_OCIO=1 -DUSE_OPENCOLORIO=1)
|
||||
checked_find_package (OpenCV
|
||||
DEFINITIONS -DUSE_OPENCV=1)
|
||||
|
||||
###########################################################################
|
||||
# Freetype setup
|
||||
# Intel TBB
|
||||
set (TBB_USE_DEBUG_BUILD OFF)
|
||||
checked_find_package (TBB 2017
|
||||
DEFINITIONS -DUSE_TBB=1
|
||||
ISDEPOF OpenVDB)
|
||||
|
||||
if (USE_FREETYPE)
|
||||
find_package (Freetype)
|
||||
if (FREETYPE_FOUND)
|
||||
add_definitions ("-DUSE_FREETYPE")
|
||||
if (NOT Freetype_FIND_QUIETLY)
|
||||
message (STATUS "Freetype includes = ${FREETYPE_INCLUDE_DIRS} ")
|
||||
message (STATUS "Freetype libs = ${FREETYPE_LIBRARIES} ")
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "Freetype library not found")
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "Not using Freetype")
|
||||
checked_find_package (DCMTK 3.6.1) # For DICOM images
|
||||
checked_find_package (FFmpeg 2.6)
|
||||
checked_find_package (Field3D
|
||||
DEPS HDF5
|
||||
DEFINITIONS -DUSE_FIELD3D=1)
|
||||
checked_find_package (GIF 4)
|
||||
checked_find_package (Libheif 1.3) # For HEIF/HEIC format
|
||||
checked_find_package (LibRaw
|
||||
PRINT LibRaw_r_LIBRARIES)
|
||||
checked_find_package (OpenJpeg 2.0)
|
||||
checked_find_package (OpenVDB 5.0
|
||||
DEPS TBB
|
||||
DEFINITIONS -DUSE_OPENVDB=1)
|
||||
checked_find_package (PTex)
|
||||
checked_find_package (Webp)
|
||||
|
||||
option (USE_R3DSDK "Enable R3DSDK (RED camera) support" OFF)
|
||||
checked_find_package (R3DSDK) # RED camera
|
||||
|
||||
set (NUKE_VERSION "7.0" CACHE STRING "Nuke version to target")
|
||||
checked_find_package (Nuke)
|
||||
|
||||
checked_find_package (OpenGL) # used for iv
|
||||
|
||||
# Qt -- used for iv
|
||||
set (qt5_modules Core Gui Widgets)
|
||||
if (OPENGL_FOUND)
|
||||
list (APPEND qt5_modules OpenGL)
|
||||
endif ()
|
||||
option (USE_QT "Use Qt if found" ON)
|
||||
checked_find_package (Qt5 COMPONENTS ${qt5_modules})
|
||||
if (USE_QT AND NOT Qt5_FOUND AND APPLE)
|
||||
message (STATUS " If you think you installed qt5 with Homebrew and it still doesn't work,")
|
||||
message (STATUS " try: export PATH=/usr/local/opt/qt5/bin:$PATH")
|
||||
endif ()
|
||||
|
||||
# end Freetype setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# GIF
|
||||
if (USE_GIF)
|
||||
find_package (GIF)
|
||||
endif()
|
||||
# end GIF setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# PTex
|
||||
if (USE_PTEX)
|
||||
find_package (PTex)
|
||||
if (NOT PTEX_FOUND)
|
||||
set (PTEX_INCLUDE_DIR "")
|
||||
set (PTEX_LIBRARIES "")
|
||||
endif ()
|
||||
endif()
|
||||
# end PTEX setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# DCMTK
|
||||
if (USE_DICOM)
|
||||
find_package (DCMTK 3.6.1)
|
||||
if (NOT DCMTK_FOUND)
|
||||
set (DCMTK_INCLUDE_DIR "")
|
||||
set (DCMTK_LIBRARIES "")
|
||||
endif ()
|
||||
endif()
|
||||
# end DCMTK setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# HEIF
|
||||
if (USE_HEIF)
|
||||
find_package (Libheif 1.3)
|
||||
endif()
|
||||
# end HEIF setup
|
||||
###########################################################################
|
||||
|
||||
|
||||
###########################################################################
|
||||
# pybind11
|
||||
|
||||
option (BUILD_PYBIND11_FORCE "Force local download/build of Pybind11 even if installed" OFF)
|
||||
option (BUILD_MISSING_PYBIND11 "Local download/build of Pybind11 if not installed" ON)
|
||||
set (BUILD_PYBIND11_VERSION "v2.2.4" CACHE STRING "Preferred pybind11 version, of downloading/building our own")
|
||||
set (PYBIND11_HOME "" CACHE STRING "Installed pybind11 location hint")
|
||||
set (BUILD_PYBIND11_MINIMUM_VERSION "2.2.0")
|
||||
|
||||
macro (find_or_download_pybind11)
|
||||
# If we weren't told to force our own download/build of pybind11, look
|
||||
# for an installed version. Still prefer a copy that seems to be
|
||||
# locally installed in this tree.
|
||||
if (NOT BUILD_PYBIND11_FORCE)
|
||||
find_path (PYBIND11_INCLUDE_DIR pybind11/pybind11.h
|
||||
"${PROJECT_SOURCE_DIR}/ext/pybind11/include"
|
||||
"${PYBIND11_HOME}"
|
||||
"$ENV{PYBIND11_HOME}"
|
||||
)
|
||||
endif ()
|
||||
# Check the version -- if it's too old, download a local copy.
|
||||
if (PYBIND11_INCLUDE_DIR)
|
||||
set (PYBIND11_COMMON_FILE "${PYBIND11_INCLUDE_DIR}/pybind11/detail/common.h")
|
||||
IF (NOT EXISTS ${PYBIND11_COMMON_FILE})
|
||||
set (PYBIND11_COMMON_FILE "${PYBIND11_INCLUDE_DIR}/pybind11/common.h")
|
||||
endif ()
|
||||
file(STRINGS "${PYBIND11_COMMON_FILE}" TMP REGEX "^#define PYBIND11_VERSION_MAJOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+$" PYBIND11_VERSION_MAJOR ${TMP})
|
||||
file(STRINGS "${PYBIND11_COMMON_FILE}" TMP REGEX "^#define PYBIND11_VERSION_MINOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+$" PYBIND11_VERSION_MINOR ${TMP})
|
||||
set (PYBIND11_VERSION "${PYBIND11_VERSION_MAJOR}.${PYBIND11_VERSION_MINOR}")
|
||||
if ("${PYBIND11_VERSION}" VERSION_LESS BUILD_PYBIND11_MINIMUM_VERSION)
|
||||
message (WARNING "pybind11 from ${PYBIND11_INCLUDE_DIR} is too old (${PYBIND11_VERSION}), minimum is ${BUILD_PYBIND11_MINIMUM_VERSION}, downloading our own.")
|
||||
set (PYBIND11_INCLUDE_DIR "")
|
||||
endif ()
|
||||
endif ()
|
||||
# If an external copy wasn't found and we requested that missing
|
||||
# packages be built, or we we are forcing a local copy to be built, then
|
||||
# download and build it.
|
||||
if ((BUILD_MISSING_PYBIND11 AND NOT PYBIND11_INCLUDE_DIR) OR BUILD_PYBIND11_FORCE)
|
||||
message (STATUS "Building local Pybind11")
|
||||
set (PYBIND11_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/pybind11")
|
||||
set (PYBIND11_GIT_REPOSITORY "https://github.com/pybind/pybind11")
|
||||
if (NOT IS_DIRECTORY ${PYBIND11_INSTALL_DIR}/include)
|
||||
find_package (Git REQUIRED)
|
||||
execute_process(COMMAND
|
||||
${GIT_EXECUTABLE} clone ${PYBIND11_GIT_REPOSITORY}
|
||||
--branch ${BUILD_PYBIND11_VERSION}
|
||||
${PYBIND11_INSTALL_DIR}
|
||||
)
|
||||
if (IS_DIRECTORY ${PYBIND11_INSTALL_DIR}/include)
|
||||
message (STATUS "DOWNLOADED pybind11 to ${PYBIND11_INSTALL_DIR}.\n"
|
||||
"Remove that dir to get rid of it.")
|
||||
else ()
|
||||
message (FATAL_ERROR "Could not download pybind11")
|
||||
endif ()
|
||||
endif ()
|
||||
set (PYBIND11_INCLUDE_DIR "${PYBIND11_INSTALL_DIR}/include")
|
||||
set (PYBIND11_COMMON_FILE "${PYBIND11_INCLUDE_DIR}/pybind11/detail/common.h")
|
||||
IF (NOT EXISTS ${PYBIND11_COMMON_FILE})
|
||||
set (PYBIND11_COMMON_FILE "${PYBIND11_INCLUDE_DIR}/pybind11/common.h")
|
||||
endif ()
|
||||
file(STRINGS "${PYBIND11_COMMON_FILE}" TMP REGEX "^#define PYBIND11_VERSION_MAJOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+$" PYBIND11_VERSION_MAJOR ${TMP})
|
||||
file(STRINGS "${PYBIND11_COMMON_FILE}" TMP REGEX "^#define PYBIND11_VERSION_MINOR .*$")
|
||||
string (REGEX MATCHALL "[0-9]+$" PYBIND11_VERSION_MINOR ${TMP})
|
||||
set (PYBIND11_VERSION "${PYBIND11_VERSION_MAJOR}.${PYBIND11_VERSION_MINOR}")
|
||||
endif ()
|
||||
|
||||
if ("${PYBIND11_VERSION}" VERSION_LESS BUILD_PYBIND11_MINIMUM_VERSION)
|
||||
message (WARNING "pybind11 from ${PYBIND11_INCLUDE_DIR} is too old (${PYBIND11_VERSION}), minimum is ${BUILD_PYBIND11_MINIMUM_VERSION}.")
|
||||
set (PYBIND11_INCLUDE_DIR "")
|
||||
endif ()
|
||||
if (PYBIND11_INCLUDE_DIR)
|
||||
message (STATUS "pybind11 ${PYBIND11_VERSION}, include dir: ${PYBIND11_INCLUDE_DIR}")
|
||||
else ()
|
||||
message (FATAL_ERROR "pybind11 is missing! If it's not on your "
|
||||
"system, you need to install it, or build with either "
|
||||
"-DBUILD_MISSING_DEPS=ON or -DBUILD_PYBIND11_FORCE=ON. "
|
||||
"Or build with -DUSE_PYTHON=OFF.")
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
###########################################################################
|
||||
# Tessil/robin-map
|
||||
|
||||
option (BUILD_ROBINMAP_FORCE "Force local download/build of robin-map even if installed" OFF)
|
||||
option (BUILD_MISSING_ROBINMAP "Local download/build of robin-map if not installed" ON)
|
||||
set (BUILD_ROBINMAP_VERSION "1e59f1993c7b6eace15032f38b5acb0bc34f530b" CACHE STRING "Preferred Tessil/robin-map version, of downloading/building our own")
|
||||
set (ROBINMAP_HOME "" CACHE STRING "Installed robin-map location hint")
|
||||
set (BUILD_ROBINMAP_VERSION "v0.6.2" CACHE STRING "Preferred Tessil/robin-map version, of downloading/building our own")
|
||||
|
||||
macro (find_or_download_robin_map)
|
||||
# If we weren't told to force our own download/build of robin-map, look
|
||||
# for an installed version. Still prefer a copy that seems to be
|
||||
# locally installed in this tree.
|
||||
if (NOT BUILD_ROBINMAP_FORCE)
|
||||
find_path (ROBINMAP_INCLUDE_DIR tsl/robin_map.h
|
||||
"${PROJECT_SOURCE_DIR}/ext/robin-map/tsl/"
|
||||
"${ROBINMAP_HOME}"
|
||||
"$ENV{ROBINMAP_HOME}"
|
||||
)
|
||||
find_package (Robinmap QUIET)
|
||||
endif ()
|
||||
# If an external copy wasn't found and we requested that missing
|
||||
# packages be built, or we we are forcing a local copy to be built, then
|
||||
# download and build it.
|
||||
# Download the headers from github
|
||||
if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_INCLUDE_DIR) OR BUILD_ROBINMAP_FORCE)
|
||||
if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE)
|
||||
message (STATUS "Downloading local Tessil/robin-map")
|
||||
set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map")
|
||||
set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map")
|
||||
if (NOT IS_DIRECTORY ${ROBINMAP_INSTALL_DIR}/tsl)
|
||||
if (NOT IS_DIRECTORY ${ROBINMAP_INSTALL_DIR}/include/tsl)
|
||||
find_package (Git REQUIRED)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ROBINMAP_GIT_REPOSITORY} -n ${ROBINMAP_INSTALL_DIR})
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${BUILD_ROBINMAP_VERSION}
|
||||
WORKING_DIRECTORY ${ROBINMAP_INSTALL_DIR})
|
||||
if (IS_DIRECTORY ${ROBINMAP_INSTALL_DIR}/tsl)
|
||||
if (IS_DIRECTORY ${ROBINMAP_INSTALL_DIR}/include/tsl)
|
||||
message (STATUS "DOWNLOADED Tessil/robin-map to ${ROBINMAP_INSTALL_DIR}.\n"
|
||||
"Remove that dir to get rid of it.")
|
||||
else ()
|
||||
message (FATAL_ERROR "Could not download Tessil/robin-map")
|
||||
endif ()
|
||||
endif ()
|
||||
set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}")
|
||||
endif ()
|
||||
|
||||
if (ROBINMAP_INCLUDE_DIR)
|
||||
message (STATUS "robin-map include dir: ${ROBINMAP_INCLUDE_DIR}")
|
||||
else ()
|
||||
message (FATAL_ERROR "Tessil/robin-map is missing!")
|
||||
set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include")
|
||||
endif ()
|
||||
checked_find_package (Robinmap REQUIRED)
|
||||
endmacro()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# libsquish
|
||||
|
||||
option (USE_EMBEDDED_LIBSQUISH
|
||||
"Force use of embedded Libsquish, even if external is found" OFF)
|
||||
if (NOT USE_EMBEDDED_LIBSQUISH)
|
||||
checked_find_package (Libsquish)
|
||||
endif ()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# fmtlib
|
||||
|
||||
option (BUILD_FMT_FORCE "Force local download/build of fmt even if installed" OFF)
|
||||
option (BUILD_MISSING_FMT "Local download/build of fmt if not installed" ON)
|
||||
set (BUILD_FMT_VERSION "6.1.2" CACHE STRING "Preferred fmtlib/fmt version, when downloading/building our own")
|
||||
|
||||
macro (find_or_download_fmt)
|
||||
# If we weren't told to force our own download/build of fmt, look
|
||||
# for an installed version. Still prefer a copy that seems to be
|
||||
# locally installed in this tree.
|
||||
if (NOT BUILD_FMT_FORCE)
|
||||
find_package (fmt QUIET)
|
||||
endif ()
|
||||
# If an external copy wasn't found and we requested that missing
|
||||
# packages be built, or we we are forcing a local copy to be built, then
|
||||
# download and build it.
|
||||
if ((BUILD_MISSING_FMT AND NOT FMT_FOUND) OR BUILD_FMT_FORCE)
|
||||
message (STATUS "Downloading local fmtlib/fmt")
|
||||
set (FMT_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/fmt")
|
||||
set (FMT_GIT_REPOSITORY "https://github.com/fmtlib/fmt")
|
||||
if (NOT IS_DIRECTORY ${FMT_INSTALL_DIR}/include/fmt)
|
||||
find_package (Git REQUIRED)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${FMT_GIT_REPOSITORY} -n ${FMT_INSTALL_DIR})
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${BUILD_FMT_VERSION}
|
||||
WORKING_DIRECTORY ${FMT_INSTALL_DIR})
|
||||
if (IS_DIRECTORY ${FMT_INSTALL_DIR}/include/fmt)
|
||||
message (STATUS "DOWNLOADED fmtlib/fmt to ${FMT_INSTALL_DIR}.\n"
|
||||
"Remove that dir to get rid of it.")
|
||||
else ()
|
||||
message (FATAL_ERROR "Could not download fmtlib/fmt")
|
||||
endif ()
|
||||
endif ()
|
||||
set (FMT_INCLUDE_DIR "${FMT_INSTALL_DIR}/include")
|
||||
endif ()
|
||||
checked_find_package (fmt REQUIRED)
|
||||
endmacro()
|
||||
|
||||
find_or_download_fmt()
|
||||
include_directories (${FMT_INCLUDES})
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
###########################################################################
|
||||
# Rpath handling at the install step
|
||||
set (MACOSX_RPATH ON)
|
||||
if (CMAKE_SKIP_RPATH)
|
||||
# We need to disallow the user from truly setting CMAKE_SKIP_RPATH, since
|
||||
# we want to run the generated executables from the build tree in order to
|
||||
# generate the manual page documentation. However, we make sure the
|
||||
# install rpath is unset so that the install tree is still free of rpaths
|
||||
# for linux packaging purposes.
|
||||
set (CMAKE_SKIP_RPATH FALSE)
|
||||
unset (CMAKE_INSTALL_RPATH)
|
||||
else ()
|
||||
set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
# add the automatically determined parts of the RPATH that
|
||||
# point to directories outside the build tree to the install RPATH
|
||||
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
if (VERBOSE)
|
||||
message (STATUS "CMAKE_INSTALL_RPATH = ${CMAKE_INSTALL_RPATH}")
|
||||
endif ()
|
||||
endif ()
|
||||
@@ -1,7 +1,7 @@
|
||||
# Module to find DCMTK
|
||||
#
|
||||
# This module will first look into the directories defined by the variables:
|
||||
# - DCMTK_PATH, DCMTK_INCLUDE_PATH, DCMTK_LIBRARY_PATH
|
||||
# - DCMTK_ROOT, DCMTK_INCLUDE_PATH, DCMTK_LIBRARY_PATH
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
@@ -15,8 +15,8 @@ include (FindPackageHandleStandardArgs)
|
||||
include (FindPackageMessage)
|
||||
|
||||
if (NOT DCMTK_FIND_QUIETLY)
|
||||
if (DCMTK_PATH)
|
||||
message(STATUS "DCMTK path explicitly specified: ${DCMTK_PATH}")
|
||||
if (DCMTK_ROOT)
|
||||
message(STATUS "DCMTK path explicitly specified: ${DCMTK_ROOT}")
|
||||
endif()
|
||||
if (DCMTK_INCLUDE_PATH)
|
||||
message(STATUS "DCMTK INCLUDE_PATH explicitly specified: ${DCMTK_INCLUDE_PATH}")
|
||||
@@ -28,31 +28,21 @@ endif ()
|
||||
|
||||
find_path (DCMTK_INCLUDE_DIR
|
||||
dcmtk/dcmdata/dcuid.h
|
||||
PATHS
|
||||
${DCMTK_INCLUDE_PATH}
|
||||
${DCMTK_PATH}/include/
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
HINTS
|
||||
${DCMTK_INCLUDE_PATH} ENV DCMTK_INCLUDE_PATH
|
||||
DOC "The directory where DCMTK headers reside")
|
||||
|
||||
foreach (COMPONENT dcmimage dcmimgle dcmdata oflog ofstd iconv)
|
||||
find_library (DCMTK_${COMPONENT}_LIB ${COMPONENT}
|
||||
PATHS ${DCMTK_PATH}/lib/
|
||||
/usr/local/lib
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib64
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
HINTS
|
||||
${DCMTK_LIBRARY_PATH} ENV DCMTK_LIBRARY_PATH
|
||||
PATH_SUFFIXES lib lib64
|
||||
)
|
||||
if (DCMTK_${COMPONENT}_LIB)
|
||||
set (DCMTK_LIBRARIES ${DCMTK_LIBRARIES} ${DCMTK_${COMPONENT}_LIB})
|
||||
endif ()
|
||||
endforeach()
|
||||
|
||||
message (STATUS "DCMTK_INCLUDE_DIR = ${DCMTK_INCLUDE_DIR}")
|
||||
if (DCMTK_INCLUDE_DIR AND EXISTS "${DCMTK_INCLUDE_DIR}/dcmtk/config/osconfig.h")
|
||||
file(STRINGS "${DCMTK_INCLUDE_DIR}/dcmtk/config/osconfig.h" TMP REGEX "^#define PACKAGE_VERSION[ \t].*$")
|
||||
string(REGEX MATCHALL "[0-9.]+" DCMTK_VERSION ${TMP})
|
||||
@@ -60,25 +50,16 @@ if (DCMTK_INCLUDE_DIR AND EXISTS "${DCMTK_INCLUDE_DIR}/dcmtk/config/osconfig.h")
|
||||
string(REGEX MATCHALL "[0-9.]+" DCMTK_VERSION_NUMBER ${TMP})
|
||||
endif ()
|
||||
|
||||
if (DCMTK_INCLUDE_DIR AND DCMTK_LIBRARIES)
|
||||
set(DCMTK_FOUND TRUE)
|
||||
set(DCMTK_INCLUDES "${DCMTK_INCLUDE_DIR}")
|
||||
if (NOT DCMTK_FIND_QUIETLY)
|
||||
message(STATUS "Found DCMTK library ${DCMTK_LIBRARIES}")
|
||||
message(STATUS "Found DCMTK includes ${DCMTK_INCLUDES}")
|
||||
message(STATUS "Found DCMTK short version number ${DCMTK_VERSION_NUMBER}")
|
||||
endif ()
|
||||
else()
|
||||
set(DCMTK_FOUND FALSE)
|
||||
message(STATUS "DCMTK not found. Specify DCMTK_PATH to locate it")
|
||||
endif()
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (DCMTK
|
||||
REQUIRED_VARS DCMTK_INCLUDE_DIR DCMTK_LIBRARIES
|
||||
VERSION_VAR DCMTK_VERSION
|
||||
)
|
||||
|
||||
if (DCMTK_FOUND)
|
||||
set(DCMTK_INCLUDES "${DCMTK_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
mark_as_advanced (
|
||||
DCMTK_INCLUDE_DIR
|
||||
DCMTK_LIBRARIES
|
||||
|
||||
@@ -1,25 +1,29 @@
|
||||
# - Try to find ffmpeg libraries (libavcodec, libavformat and libavutil)
|
||||
# Once done this will define
|
||||
#
|
||||
# FFMPEG_FOUND - system has ffmpeg or libav
|
||||
# FFmpeg_FOUND - system has ffmpeg or libav
|
||||
# FFMPEG_INCLUDE_DIR - the ffmpeg include directory
|
||||
# FFMPEG_LIBRARIES - Link these to use ffmpeg
|
||||
# FFMPEG_LIBAVCODEC
|
||||
# FFMPEG_LIBAVFORMAT
|
||||
# FFMPEG_LIBAVUTIL
|
||||
#
|
||||
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
|
||||
# Modified for other libraries by Lasse Kärkkäinen <tronic>
|
||||
# Modified for Hedgewars by Stepik777
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# Original:
|
||||
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
|
||||
# Modified for other libraries by Lasse Kärkkäinen <tronic>
|
||||
# Modified for Hedgewars by Stepik777
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
#
|
||||
# Modifications:
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
if (FFMPEG_INCLUDES AND FFMPEG_LIBRARIES)
|
||||
set (FFmpeg_FOUND TRUE)
|
||||
else ()
|
||||
|
||||
if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
|
||||
# in cache already
|
||||
set(FFMPEG_FOUND TRUE)
|
||||
else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
find_package(PkgConfig)
|
||||
@@ -32,54 +36,46 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
|
||||
|
||||
find_path(FFMPEG_AVCODEC_INCLUDE_DIR
|
||||
NAMES libavcodec/version.h
|
||||
PATHS ${_FFMPEG_AVCODEC_INCLUDE_DIRS} /usr/include /usr/local/include /opt/local/include /sw/include
|
||||
HINTS ${_FFMPEG_AVCODEC_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES ffmpeg libav
|
||||
)
|
||||
|
||||
find_library(FFMPEG_LIBAVCODEC
|
||||
NAMES avcodec
|
||||
PATHS ${_FFMPEG_AVCODEC_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
)
|
||||
HINTS ${_FFMPEG_AVCODEC_LIBRARY_DIRS} )
|
||||
|
||||
find_library(FFMPEG_LIBAVFORMAT
|
||||
NAMES avformat
|
||||
PATHS ${_FFMPEG_AVFORMAT_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
)
|
||||
HINTS ${_FFMPEG_AVFORMAT_LIBRARY_DIRS} )
|
||||
|
||||
find_library(FFMPEG_LIBAVUTIL
|
||||
NAMES avutil
|
||||
PATHS ${_FFMPEG_AVUTIL_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
)
|
||||
HINTS ${_FFMPEG_AVUTIL_LIBRARY_DIRS} )
|
||||
|
||||
find_library(FFMPEG_LIBSWSCALE
|
||||
NAMES swscale
|
||||
PATHS ${_FFMPEG_SWSCALE_LIBRARY_DIRS} /usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
)
|
||||
HINTS ${_FFMPEG_SWSCALE_LIBRARY_DIRS} )
|
||||
|
||||
if (FFMPEG_LIBAVCODEC AND FFMPEG_LIBAVFORMAT AND FFMPEG_AVCODEC_INCLUDE_DIR)
|
||||
set(FFMPEG_FOUND TRUE)
|
||||
endif()
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (FFmpeg
|
||||
REQUIRED_VARS FFMPEG_LIBAVCODEC
|
||||
FFMPEG_LIBAVFORMAT
|
||||
FFMPEG_AVCODEC_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if (FFMPEG_FOUND)
|
||||
if (FFmpeg_FOUND)
|
||||
set(FFMPEG_INCLUDE_DIR ${FFMPEG_AVCODEC_INCLUDE_DIR})
|
||||
|
||||
set(FFMPEG_INCLUDES ${FFMPEG_AVCODEC_INCLUDE_DIR})
|
||||
set(FFMPEG_LIBRARIES
|
||||
${FFMPEG_LIBAVCODEC}
|
||||
${FFMPEG_LIBAVFORMAT}
|
||||
${FFMPEG_LIBAVUTIL}
|
||||
${FFMPEG_LIBSWSCALE}
|
||||
)
|
||||
endif ()
|
||||
|
||||
endif (FFMPEG_FOUND)
|
||||
endif ()
|
||||
|
||||
if (FFMPEG_FOUND)
|
||||
if (NOT FFmpeg_FIND_QUIETLY)
|
||||
message(STATUS "Found FFMPEG or Libav: ${FFMPEG_LIBRARIES}, ${FFMPEG_INCLUDE_DIR}")
|
||||
endif (NOT FFmpeg_FIND_QUIETLY)
|
||||
else (FFMPEG_FOUND)
|
||||
if (FFMPEG_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find libavcodec or libavformat or libavutil or libswscale")
|
||||
endif (FFMPEG_FIND_REQUIRED)
|
||||
endif (FFMPEG_FOUND)
|
||||
|
||||
endif (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
|
||||
mark_as_advanced (
|
||||
FFMPEG_INCLUDES FFMPEG_LIBRARIES
|
||||
)
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
# Module to find Field3D
|
||||
#
|
||||
# This module will first look into the directories defined by the variables:
|
||||
# - Field3D_ROOT, FIELD3D_INCLUDE_PATH, FIELD3D_LIBRARY_PATH
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# Field3D_FOUND True if Field3D was found.
|
||||
# FIELD3D_INCLUDES Where to find Field3D headers
|
||||
# FIELD3D_LIBRARIES List of libraries to link against when using Field3D
|
||||
# FIELD3D_VERSION Version of Field3D (e.g., 3.6.2)
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
find_path (FIELD3D_INCLUDE_DIR Field3D/Field.h
|
||||
HINTS
|
||||
${FIELD3D_INCLUDE_PATH}
|
||||
ENV FIELD3D_INCLUDE_PATH
|
||||
DOC "The directory where Field3D headers reside")
|
||||
|
||||
find_library (FIELD3D_LIBRARY Field3D
|
||||
HINTS
|
||||
${FIELD3D_LIBRARY_PATH}
|
||||
ENV FIELD3D_LIBRARY_PATH
|
||||
DOC "The Field3D libraries")
|
||||
|
||||
find_package_handle_standard_args (Field3D
|
||||
REQUIRED_VARS FIELD3D_INCLUDE_DIR FIELD3D_LIBRARY
|
||||
)
|
||||
|
||||
if (Field3D_FOUND)
|
||||
set (FIELD3D_INCLUDES ${FIELD3D_INCLUDE_DIR})
|
||||
set (FIELD3D_LIBRARIES ${FIELD3D_LIBRARY})
|
||||
|
||||
if (NOT TARGET Field3D::Field3D)
|
||||
add_library(Field3D::Field3D UNKNOWN IMPORTED)
|
||||
set_target_properties(Field3D::Field3D PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${FIELD3D_INCLUDES}")
|
||||
set_property(TARGET Field3D::Field3D APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${FIELD3D_LIBRARIES}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (
|
||||
FIELD3D_INCLUDE_DIR
|
||||
FIELD3D_LIBRARY
|
||||
)
|
||||
@@ -9,32 +9,35 @@
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
find_path(JPEG_INCLUDE_DIR turbojpeg.h
|
||||
PATHS ${JPEGTURBO_PATH}/include
|
||||
/usr/local/opt/jpeg-turbo/include)
|
||||
HINTS /usr/local/opt/jpeg-turbo/include
|
||||
PATH_SUFFIXES include)
|
||||
set(JPEG_NAMES ${JPEG_NAMES} jpeg libjpeg turbojpeg libturbojpeg)
|
||||
|
||||
find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES}
|
||||
PATHS ${JPEG_INCLUDE_DIR}/../lib
|
||||
${JPEGTURBO_PATH}/lib64
|
||||
${JPEGTURBO_PATH}/lib
|
||||
/usr/local/opt/jpeg-turbo/lib
|
||||
/opt/libjpeg-turbo/lib64
|
||||
/opt/libjpeg-turbo/lib
|
||||
NO_DEFAULT_PATH)
|
||||
find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES}
|
||||
HINTS ${JPEG_INCLUDE_DIR}/..
|
||||
/usr/local/opt/jpeg-turbo
|
||||
/opt/libjpeg-turbo
|
||||
PATH_SUFFIXES lib lib64
|
||||
NO_DEFAULT_PATH)
|
||||
if (NOT JPEG_LIBRARY)
|
||||
find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES}
|
||||
PATHS ${JPEG_INCLUDE_DIR}/../lib
|
||||
${JPEGTURBO_PATH}/lib
|
||||
/usr/local/opt/jpeg-turbo/lib)
|
||||
find_library(JPEG_LIBRARY NAMES ${JPEG_NAMES}
|
||||
HINTS ${JPEG_INCLUDE_DIR}/..
|
||||
/usr/local/opt/jpeg-turbo
|
||||
PATH_SUFFIXES lib lib64)
|
||||
endif ()
|
||||
|
||||
if (JPEG_INCLUDE_DIR AND JPEG_LIBRARY)
|
||||
set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR} CACHE PATH "JPEG include dirs")
|
||||
set (JPEG_LIBRARIES ${JPEG_LIBRARY} CACHE STRING "JPEG libraries")
|
||||
endif ()
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARIES JPEG_INCLUDE_DIRS)
|
||||
|
||||
if(JPEG_FOUND)
|
||||
set(JPEG_LIBRARIES ${JPEG_LIBRARY})
|
||||
endif()
|
||||
if (JPEG_FOUND)
|
||||
set (JPEGTURBO_FOUND true)
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR )
|
||||
mark_as_advanced(JPEG_LIBRARIES JPEG_INCLUDE_DIRS )
|
||||
|
||||
|
||||
@@ -14,46 +14,42 @@
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
find_package(PkgConfig)
|
||||
|
||||
IF(PKG_CONFIG_FOUND AND NOT LIBRAW_PATH)
|
||||
if(PKG_CONFIG_FOUND AND NOT LibRaw_ROOT AND NOT $ENV{LibRaw_ROOT})
|
||||
PKG_CHECK_MODULES(PC_LIBRAW QUIET libraw)
|
||||
SET(LibRaw_DEFINITIONS ${PC_LIBRAW_CFLAGS_OTHER})
|
||||
|
||||
PKG_CHECK_MODULES(PC_LIBRAW_R QUIET libraw_r)
|
||||
SET(LibRaw_r_DEFINITIONS ${PC_LIBRAW_R_CFLAGS_OTHER})
|
||||
ENDIF()
|
||||
SET(LibRaw_r_DEFINITIONS ${PC_LIBRAW_R_CFLAGS_OTHER})
|
||||
endif()
|
||||
|
||||
FIND_PATH(LibRaw_INCLUDE_DIR libraw/libraw.h
|
||||
find_path(LibRaw_INCLUDE_DIR libraw/libraw.h
|
||||
HINTS
|
||||
${LIBRAW_INCLUDEDIR_HINT}
|
||||
${LIBRAW_PATH}
|
||||
${PC_LIBRAW_INCLUDEDIR}
|
||||
${PC_LibRaw_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES libraw
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LibRaw_LIBRARIES NAMES raw libraw
|
||||
find_library(LibRaw_LIBRARIES NAMES raw libraw
|
||||
HINTS
|
||||
${LIBRAW_LIBDIR_HINT}
|
||||
${LIBRAW_PATH}
|
||||
${PC_LIBRAW_LIBDIR}
|
||||
${PC_LIBRAW_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LibRaw_r_LIBRARIES NAMES raw_r
|
||||
find_library(LibRaw_r_LIBRARIES NAMES raw_r
|
||||
HINTS
|
||||
${LIBRAW_LIBDIR_HINT}
|
||||
${LIBRAW_PATH}
|
||||
${PC_LIBRAW_R_LIBDIR}
|
||||
${PC_LIBRAW_R_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
IF(WIN32)
|
||||
if(WIN32)
|
||||
SET( LibRaw_r_LIBRARIES ${LibRaw_LIBRARIES} )
|
||||
ENDIF()
|
||||
endif()
|
||||
|
||||
IF(LibRaw_INCLUDE_DIR)
|
||||
if(LibRaw_INCLUDE_DIR)
|
||||
FILE(READ ${LibRaw_INCLUDE_DIR}/libraw/libraw_version.h _libraw_version_content)
|
||||
|
||||
STRING(REGEX MATCH "#define LIBRAW_MAJOR_VERSION[ \t]*([0-9]*)\n" _version_major_match ${_libraw_version_content})
|
||||
@@ -65,18 +61,18 @@ IF(LibRaw_INCLUDE_DIR)
|
||||
STRING(REGEX MATCH "#define LIBRAW_PATCH_VERSION[ \t]*([0-9]*)\n" _version_patch_match ${_libraw_version_content})
|
||||
SET(_libraw_version_patch "${CMAKE_MATCH_1}")
|
||||
|
||||
IF(_version_major_match AND _version_minor_match AND _version_patch_match)
|
||||
if(_version_major_match AND _version_minor_match AND _version_patch_match)
|
||||
SET(LibRaw_VERSION_STRING "${_libraw_version_major}.${_libraw_version_minor}.${_libraw_version_patch}")
|
||||
ELSE()
|
||||
IF(NOT LibRaw_FIND_QUIETLY)
|
||||
else()
|
||||
if(NOT LibRaw_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Failed to get version information from ${LibRaw_INCLUDE_DIR}/libraw/libraw_version.h")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibRaw
|
||||
REQUIRED_VARS LibRaw_LIBRARIES LibRaw_INCLUDE_DIR
|
||||
REQUIRED_VARS LibRaw_LIBRARIES LibRaw_r_LIBRARIES LibRaw_INCLUDE_DIR
|
||||
VERSION_VAR LibRaw_VERSION_STRING
|
||||
)
|
||||
|
||||
@@ -87,3 +83,10 @@ MARK_AS_ADVANCED(LibRaw_VERSION_STRING
|
||||
LibRaw_DEFINITIONS
|
||||
LibRaw_r_DEFINITIONS
|
||||
)
|
||||
|
||||
if (LINKSTATIC)
|
||||
# Necessary?
|
||||
find_package (Jasper)
|
||||
find_library (LCMS2_LIBRARIES NAMES lcms2)
|
||||
set (LibRaw_r_LIBRARIES ${LibRaw_r_LIBRARIES} ${JASPER_LIBRARIES} ${LCMS2_LIBRARIES})
|
||||
endif ()
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
# Module to find LIBHEIF
|
||||
#
|
||||
# This module will first look into the directories defined by the variables:
|
||||
# - LIBHEIF_PATH, LIBHEIF_INCLUDE_PATH, LIBHEIF_LIBRARY_PATH
|
||||
# - Libheif_ROOT, LIBHEIF_INCLUDE_PATH, LIBHEIF_LIBRARY_PATH
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# LIBHEIF_FOUND True if LIBHEIF was found.
|
||||
# Libheif_FOUND True if LIBHEIF was found.
|
||||
# LIBHEIF_INCLUDES Where to find LIBHEIF headers
|
||||
# LIBHEIF_LIBRARIES List of libraries to link against when using LIBHEIF
|
||||
# LIBHEIF_VERSION Version of LIBHEIF (e.g., 3.6.2)
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
include (FindPackageMessage)
|
||||
|
||||
find_path (LIBHEIF_INCLUDE_DIR
|
||||
libheif/heif_version.h
|
||||
PATHS
|
||||
${LIBHEIF_INCLUDE_PATH}
|
||||
${LIBHEIF_PATH}/include/
|
||||
HINTS
|
||||
${LIBHEIF_INCLUDE_PATH}
|
||||
ENV LIBHEIF_INCLUDE_PATH
|
||||
DOC "The directory where libheif headers reside")
|
||||
|
||||
find_library (LIBHEIF_LIBRARY heif
|
||||
PATHS ${LIBHEIF_PATH}/lib ${LIBHEIF_LIBRARY_PATH})
|
||||
HINTS
|
||||
${LIBHEIF_LIBRARY_PATH}
|
||||
ENV LIBHEIF_LIBRARY_PATH
|
||||
DOC "The directory where libheif libraries reside")
|
||||
|
||||
message (STATUS "LIBHEIF_INCLUDE_DIR = ${LIBHEIF_INCLUDE_DIR}")
|
||||
if (LIBHEIF_INCLUDE_DIR)
|
||||
file(STRINGS "${LIBHEIF_INCLUDE_DIR}/libheif/heif_version.h" TMP REGEX "^#define LIBHEIF_VERSION[ \t].*$")
|
||||
string(REGEX MATCHALL "[0-9.]+" LIBHEIF_VERSION ${TMP})
|
||||
endif ()
|
||||
|
||||
if (LIBHEIF_INCLUDE_DIR AND LIBHEIF_LIBRARY)
|
||||
set(LIBHEIF_FOUND TRUE)
|
||||
set(LIBHEIF_INCLUDES "${LIBHEIF_INCLUDE_DIR}")
|
||||
set(LIBHEIF_LIBRARIES "${LIBHEIF_LIBRARY}")
|
||||
if (NOT LIBHEIF_FIND_QUIETLY)
|
||||
message(STATUS "Found libheif ${LIBHEIF_VERSION} library ${LIBHEIF_LIBRARIES}")
|
||||
message(STATUS "Found libheif includes ${LIBHEIF_INCLUDES}")
|
||||
endif ()
|
||||
else()
|
||||
set(LIBHEIF_FOUND FALSE)
|
||||
message(STATUS "libheif not found. Specify LIBHEIF_PATH to locate it")
|
||||
endif()
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (LIBHEIF
|
||||
find_package_handle_standard_args (Libheif
|
||||
REQUIRED_VARS LIBHEIF_INCLUDE_DIR
|
||||
LIBHEIF_LIBRARIES
|
||||
VERSION_VAR LIBHEIF_VERSION
|
||||
LIBHEIF_LIBRARY
|
||||
)
|
||||
|
||||
if (Libheif_FOUND)
|
||||
set(LIBHEIF_INCLUDES "${LIBHEIF_INCLUDE_DIR}")
|
||||
set(LIBHEIF_LIBRARIES "${LIBHEIF_LIBRARY}")
|
||||
|
||||
if (NOT TARGET Libheif::Libheif)
|
||||
add_library(Libheif::Libheif UNKNOWN IMPORTED)
|
||||
set_target_properties(Libheif::Libheif PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBHEIF_INCLUDES}")
|
||||
set_property(TARGET Libheif::Libheif APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${LIBHEIF_LIBRARIES}")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
mark_as_advanced (
|
||||
LIBHEIF_INCLUDE_DIR
|
||||
LIBHEIF_INCLUDES
|
||||
LIBHEIF_LIBRARIES
|
||||
LIBHEIF_VERSION
|
||||
)
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
# Module to find Libsquish
|
||||
#
|
||||
# This module will first look into the directories defined by the variables:
|
||||
# - Libsquish_ROOT, LIBSQUISH_INCLUDE_PATH, LIBSQUISH_LIBRARY_PATH
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# Libsquish_FOUND True if Libsquish was found.
|
||||
# LIBSQUISH_INCLUDES Where to find Libsquish headers
|
||||
# LIBSQUISH_LIBRARIES List of libraries to link against when using Libsquish
|
||||
# LIBSQUISH_VERSION Version of Libsquish (e.g., 3.6.2)
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
find_path (LIBSQUISH_INCLUDE_DIR squish.h
|
||||
HINTS
|
||||
${LIBSQUISH_INCLUDE_PATH}
|
||||
ENV LIBSQUISH_INCLUDE_PATH
|
||||
DOC "The directory where Libsquish headers reside")
|
||||
|
||||
find_library (LIBSQUISH_LIBRARY squish
|
||||
HINTS
|
||||
${LIBSQUISH_LIBRARY_PATH}
|
||||
ENV LIBSQUISH_LIBRARY_PATH
|
||||
DOC "The Libsquish libraries")
|
||||
|
||||
find_package_handle_standard_args (Libsquish
|
||||
REQUIRED_VARS
|
||||
LIBSQUISH_INCLUDE_DIR
|
||||
LIBSQUISH_LIBRARY
|
||||
)
|
||||
|
||||
if (Libsquish_FOUND)
|
||||
set (LIBSQUISH_INCLUDES ${LIBSQUISH_INCLUDE_DIR})
|
||||
set (LIBSQUISH_LIBRARIES ${LIBSQUISH_LIBRARY})
|
||||
|
||||
if (NOT TARGET Libsquish::Libsquish)
|
||||
add_library(Libsquish::Libsquish UNKNOWN IMPORTED)
|
||||
set_target_properties(Libsquish::Libsquish PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LIBSQUISH_INCLUDES}")
|
||||
|
||||
set_property(TARGET Libsquish::Libsquish APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${LIBSQUISH_LIBRARIES}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (
|
||||
LIBSQUISH_INCLUDE_DIR
|
||||
LIBSQUISH_LIBRARY
|
||||
)
|
||||
@@ -12,9 +12,9 @@
|
||||
# Output variables:
|
||||
# NUKE_FOUND
|
||||
# NUKE_EXECUTABLE
|
||||
# NUKE_INCLUDE_DIRS
|
||||
# NUKE_LIBRARY_DIRS
|
||||
# NUKE_INCLUDES
|
||||
# NUKE_LIBRARIES
|
||||
# NUKE_LIBRARY_DIRS
|
||||
# NUKE_DDIMAGE_LIBRARY
|
||||
# NUKE_VERSION_MAJOR
|
||||
# NUKE_VERSION_MINOR
|
||||
@@ -130,12 +130,12 @@ find_library(NUKE_DDIMAGE_LIBRARY DDImage
|
||||
if(NUKE_DDIMAGE_LIBRARY)
|
||||
get_filename_component(NUKE_LIBRARY_DIRS ${NUKE_DDIMAGE_LIBRARY} PATH)
|
||||
|
||||
find_path(NUKE_INCLUDE_DIRS DDImage/Op.h "${NUKE_LIBRARY_DIRS}/include")
|
||||
find_path(NUKE_INCLUDE_DIR DDImage/Op.h "${NUKE_LIBRARY_DIRS}/include")
|
||||
|
||||
# Pull version information from header
|
||||
# (We could pull the DDImage path apart instead, but this avoids dealing
|
||||
# with platform-specific naming.)
|
||||
file(STRINGS "${NUKE_INCLUDE_DIRS}/DDImage/ddImageVersionNumbers.h" _nuke_DDIMAGE_VERSION_H)
|
||||
file(STRINGS "${NUKE_INCLUDE_DIR}/DDImage/ddImageVersionNumbers.h" _nuke_DDIMAGE_VERSION_H)
|
||||
string(REGEX REPLACE ".*#define kDDImageVersionMajorNum ([0-9]+).*" "\\1"
|
||||
NUKE_VERSION_MAJOR ${_nuke_DDIMAGE_VERSION_H})
|
||||
string(REGEX REPLACE ".*#define kDDImageVersionMinorNum ([0-9]+).*" "\\1"
|
||||
@@ -156,4 +156,9 @@ endif()
|
||||
# Finalize search
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Nuke DEFAULT_MSG
|
||||
NUKE_DDIMAGE_LIBRARY NUKE_INCLUDE_DIRS NUKE_LIBRARY_DIRS NUKE_EXECUTABLE)
|
||||
NUKE_DDIMAGE_LIBRARY NUKE_INCLUDE_DIR NUKE_LIBRARY_DIRS NUKE_EXECUTABLE)
|
||||
|
||||
if (NUKE_FOUND)
|
||||
set (NUKE_INCLUDES ${NUKE_INCLUDE_DIR})
|
||||
set (NUKE_LIBRARIES ${NUKE_DDIMAGE_LIBRARY})
|
||||
endif ()
|
||||
|
||||
@@ -2,31 +2,19 @@
|
||||
# Find the OpenCV library
|
||||
# This module defines
|
||||
# OpenCV_VERSION, the version string of OpenCV
|
||||
# OpenCV_INCLUDE_DIR, where to find header files
|
||||
# OpenCV_INCLUDES, where to find header files
|
||||
# OpenCV_LIBRARIES, the libraries needed to use OpenCV
|
||||
# OpenCV_DEFINITIONS, the definitions needed to use OpenCV
|
||||
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
|
||||
IF(PKG_CONFIG_FOUND AND NOT LIBRAW_PATH)
|
||||
PKG_CHECK_MODULES(PC_LIBRAW QUIET libraw)
|
||||
SET(LibRaw_DEFINITIONS ${PC_LIBRAW_CFLAGS_OTHER})
|
||||
|
||||
PKG_CHECK_MODULES(PC_LIBRAW_R QUIET libraw_r)
|
||||
SET(LibRaw_r_DEFINITIONS ${PC_LIBRAW_R_CFLAGS_OTHER})
|
||||
ENDIF()
|
||||
#
|
||||
# You can provide a location hint with OpenCV_ROOT (either a defined CMake
|
||||
# variable or an environment variable).
|
||||
|
||||
find_path (OpenCV_INCLUDE_DIR
|
||||
NAMES opencv4/opencv2/opencv.hpp opencv2/opencv.hpp
|
||||
PATHS
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
"${OpenCV_DIR}/include"
|
||||
"${OpenCV_DIR}/include/opencv4"
|
||||
"$ENV{OpenCV_DIR}/include"
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/usr/local/opt/opencv4/include
|
||||
/usr/local/opt/opencv3/include
|
||||
/opt/local/include
|
||||
/usr/local/opt/opencv4
|
||||
/usr/local/opt/opencv3
|
||||
PATH_SUFFIXES opencv4
|
||||
)
|
||||
|
||||
@@ -51,12 +39,9 @@ if (EXISTS "${_ocv_version_file}")
|
||||
else ()
|
||||
set (OpenCV_VERSION "${CV_VERSION_MAJOR}.${CV_VERSION_MINOR}.${CV_VERSION_REVISION}")
|
||||
endif ()
|
||||
message (STATUS "Found OpenCV ${OpenCV_VERSION} include in ${OpenCV_INCLUDE_DIR}")
|
||||
endif ()
|
||||
|
||||
set (libdirs "${PROJECT_SOURCE_DIR}/lib"
|
||||
"${OpenCV_DIR}/lib"
|
||||
"$ENV{OpenCV_DIR}/lib"
|
||||
"${_ocv_include_root}/../lib"
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
@@ -74,30 +59,22 @@ endif ()
|
||||
foreach (component ${opencv_components})
|
||||
find_library (${component}_lib
|
||||
NAMES ${component}
|
||||
PATHS ${libdirs}
|
||||
NO_DEFAULT_PATH)
|
||||
# If that didn't work, try again with default paths
|
||||
find_library (${component}_lib
|
||||
NAMES ${component}
|
||||
PATHS ${libdirs})
|
||||
HINTS ${libdirs})
|
||||
if (${component}_lib)
|
||||
set (OpenCV_LIBS ${OpenCV_LIBS} ${${component}_lib})
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
if (OpenCV_INCLUDE_DIR AND OpenCV_LIBS)
|
||||
set (OpenCV_FOUND TRUE)
|
||||
message (STATUS "Found OpenCV libs: ${OpenCV_LIBS}")
|
||||
endif ()
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS (OpenCV
|
||||
REQUIRED_VARS OpenCV_LIBS OpenCV_INCLUDE_DIR OpenCV_VERSION
|
||||
VERSION_VAR OpenCV_VERSION )
|
||||
|
||||
MARK_AS_ADVANCED (OpenCV_VERSION
|
||||
OpenCV_INCLUDE_DIR
|
||||
OpenCV_LIBS
|
||||
OpenCV_DEFINITIONS )
|
||||
if (OPENCV_FOUND)
|
||||
set (OpenCV_INCLUDES ${OpenCV_INCLUDE_DIR})
|
||||
set (OpenCV_LIBRARIES ${OpenCV_LIBS})
|
||||
endif ()
|
||||
|
||||
MARK_AS_ADVANCED (OpenCV_INCLUDE_DIR OpenCV_LIBS)
|
||||
unset (_ocv_version_file)
|
||||
unset (_ocv_include_root)
|
||||
|
||||
@@ -1,60 +1,84 @@
|
||||
# Module to find OpenColorIO
|
||||
#
|
||||
# This module will first look into the directories defined by the variables:
|
||||
# - OCIO_PATH, OCIO_INCLUDE_PATH, OCIO_LIBRARY_PATH
|
||||
# This module will first look into the directories hinted by the variables:
|
||||
# - OpenColorIO_ROOT, OPENCOLORIO_INCLUDE_PATH, OPENCOLORIO_LIBRARY_PATH
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# OCIO_FOUND - True if OpenColorIO was found.
|
||||
# OCIO_INCLUDES - where to find OpenColorIO.h
|
||||
# OCIO_LIBRARIES - list of libraries to link against when using OpenColorIO
|
||||
# OPENCOLORIO_FOUND - True if OpenColorIO was found.
|
||||
# OPENCOLORIO_INCLUDES - where to find OpenColorIO.h
|
||||
# OPENCOLORIO_LIBRARIES - list of libraries to link against when using OpenColorIO
|
||||
# OPENCOLORIO_DEFINITIONS - Definitions needed when using OpenColorIO
|
||||
|
||||
# Other standarnd issue macros
|
||||
include (FindPackageHandleStandardArgs)
|
||||
include (FindPackageMessage)
|
||||
|
||||
if (NOT OpenColorIO_FIND_QUIETLY)
|
||||
if (OCIO_PATH)
|
||||
message(STATUS "OCIO path explicitly specified: ${OCIO_PATH}")
|
||||
endif()
|
||||
if (OCIO_INCLUDE_PATH)
|
||||
message(STATUS "OCIO INCLUDE_PATH explicitly specified: ${OCIO_INCLUDE_PATH}")
|
||||
endif()
|
||||
if (OCIO_LIBRARY_PATH)
|
||||
message(STATUS "OCIO LIBRARY_PATH explicitly specified: ${OCIO_LIBRARY_PATH}")
|
||||
endif()
|
||||
endif ()
|
||||
FIND_PATH(OCIO_INCLUDES
|
||||
OpenColorIO/OpenColorIO.h
|
||||
PATHS
|
||||
${OCIO_INCLUDE_PATH}
|
||||
${OCIO_PATH}/include/
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
find_path (OPENCOLORIO_INCLUDE_DIR
|
||||
OpenColorIO/OpenColorIO.h
|
||||
HINTS
|
||||
${OPENCOLORIO_INCLUDE_PATH}
|
||||
ENV OPENCOLORIO_INCLUDE_PATH
|
||||
PATHS
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
DOC "The directory where OpenColorIO/OpenColorIO.h resides")
|
||||
FIND_LIBRARY(OCIO_LIBRARIES
|
||||
NAMES OCIO OpenColorIO
|
||||
PATHS
|
||||
${OCIO_LIBRARY_PATH}
|
||||
${OCIO_PATH}/lib/
|
||||
DOC "The directory where OpenColorIO/OpenColorIO.h resides")
|
||||
|
||||
find_library (OPENCOLORIO_LIBRARY
|
||||
NAMES OCIO OpenColorIO
|
||||
HINTS
|
||||
${OPENCOLORIO_LIBRARY_PATH}
|
||||
ENV OPENCOLORIO_LIBRARY_PATH
|
||||
PATHS
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib64
|
||||
/usr/local/lib
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
DOC "The OCIO library")
|
||||
DOC "The OCIO library")
|
||||
|
||||
if(OCIO_INCLUDES AND OCIO_LIBRARIES)
|
||||
set(OCIO_FOUND TRUE)
|
||||
if (NOT OpenColorIO_FIND_QUIETLY)
|
||||
message(STATUS "Found OCIO library ${OCIO_LIBRARIES}")
|
||||
message(STATUS "Found OCIO includes ${OCIO_INCLUDES}")
|
||||
endif ()
|
||||
else()
|
||||
set(OCIO_FOUND FALSE)
|
||||
message(STATUS "OCIO not found. Specify OCIO_PATH to locate it")
|
||||
endif()
|
||||
if (EXISTS "${OPENCOLORIO_INCLUDE_DIR}/OpenColorIO/OpenColorABI.h")
|
||||
file(STRINGS "${OPENCOLORIO_INCLUDE_DIR}/OpenColorIO/OpenColorABI.h" TMP
|
||||
REGEX "^#define OCIO_VERSION[ \t].*$")
|
||||
string (REGEX MATCHALL "[0-9]+[.0-9]+" OPENCOLORIO_VERSION ${TMP})
|
||||
endif ()
|
||||
|
||||
find_package_handle_standard_args (OpenColorIO
|
||||
REQUIRED_VARS OPENCOLORIO_INCLUDE_DIR OPENCOLORIO_LIBRARY
|
||||
FOUND_VAR OPENCOLORIO_FOUND
|
||||
VERSION_VAR OPENCOLORIO_VERSION
|
||||
)
|
||||
|
||||
if (OPENCOLORIO_FOUND)
|
||||
set (OPENCOLORIO_INCLUDES ${OPENCOLORIO_INCLUDE_DIR})
|
||||
set (OPENCOLORIO_LIBRARIES ${OPENCOLORIO_LIBRARY})
|
||||
set (OPENCOLORIO_DEFINITIONS "")
|
||||
if (NOT TARGET OpenColorIO::OpenColorIO)
|
||||
add_library(OpenColorIO::OpenColorIO UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenColorIO::OpenColorIO PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OPENCOLORIO_INCLUDES}")
|
||||
|
||||
set_property(TARGET OpenColorIO::OpenColorIO APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${OPENCOLORIO_LIBRARIES}")
|
||||
if (LINKSTATIC)
|
||||
set_target_properties(OpenColorIO::OpenColorIO PROPERTIES
|
||||
INTERFACE_COMPILE_DEFINITIONS "-DOpenColorIO_STATIC")
|
||||
endif()
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (OpenColorIO_FOUND AND LINKSTATIC)
|
||||
# Is this necessary?
|
||||
set (OPENCOLORIO_DEFINITIONS "-DOpenColorIO_STATIC")
|
||||
find_library (TINYXML_LIBRARY NAMES tinyxml)
|
||||
if (TINYXML_LIBRARY)
|
||||
set (OPENCOLORIO_LIBRARIES "${OPENCOLORIO_LIBRARIES};${TINYXML_LIBRARY}" CACHE STRING "" FORCE)
|
||||
endif ()
|
||||
find_library (YAML_LIBRARY NAMES yaml-cpp)
|
||||
if (YAML_LIBRARY)
|
||||
set (OPENCOLORIO_LIBRARIES "${OPENCOLORIO_LIBRARIES};${YAML_LIBRARY}" CACHE STRING "" FORCE)
|
||||
endif ()
|
||||
find_library (LCMS2_LIBRARY NAMES lcms2)
|
||||
if (LCMS2_LIBRARY)
|
||||
set (OPENCOLORIO_LIBRARIES "${OPENCOLORIO_LIBRARIES};${LCMS2_LIBRARY}" CACHE STRING "" FORCE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# This module will set
|
||||
# OPENEXR_FOUND true, if found
|
||||
# OPENEXR_INCLUDE_DIR directory where headers are found
|
||||
# OPENEXR_INCLUDES directory where headers are found
|
||||
# OPENEXR_LIBRARIES libraries for OpenEXR + IlmBase
|
||||
# ILMBASE_LIBRARIES libraries just IlmBase
|
||||
# OPENEXR_VERSION OpenEXR version (accurate for >= 2.0.0,
|
||||
@@ -25,23 +25,25 @@ endif ()
|
||||
# Attempt to find OpenEXR with pkgconfig
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
if (NOT ILMBASE_ROOT_DIR)
|
||||
if (NOT Ilmbase_ROOT AND NOT ILMBASE_ROOT
|
||||
AND NOT DEFINED ENV{Ilmbase_ROOT} AND NOT DEFINED ENV{ILMBASE_ROOT})
|
||||
pkg_check_modules(_ILMBASE QUIET IlmBase>=2.0.0)
|
||||
endif ()
|
||||
if (NOT OPENEXR_ROOT_DIR)
|
||||
if (NOT OpenEXR_ROOT AND NOT OPENEXR_ROOT
|
||||
AND NOT DEFINED ENV{OpenEXR_ROOT} AND NOT DEFINED ENV{OPENEXR_ROOT})
|
||||
pkg_check_modules(_OPENEXR QUIET OpenEXR>=2.0.0)
|
||||
endif ()
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
|
||||
# List of likely places to find the headers -- note priority override of
|
||||
# ${OPENEXR_ROOT_DIR}/include.
|
||||
# ${OPENEXR_ROOT}/include.
|
||||
# ILMBASE is needed in case ilmbase an openexr are installed in separate
|
||||
# directories, like NixOS does
|
||||
set (GENERIC_INCLUDE_PATHS
|
||||
${OPENEXR_ROOT_DIR}/include
|
||||
$ENV{OPENEXR_ROOT_DIR}/include
|
||||
${ILMBASE_ROOT_DIR}/include
|
||||
$ENV{ILMBASE_ROOT_DIR}/include
|
||||
${OPENEXR_ROOT}/include
|
||||
$ENV{OPENEXR_ROOT}/include
|
||||
${ILMBASE_ROOT}/include
|
||||
$ENV{ILMBASE_ROOT}/include
|
||||
${_ILMBASE_INCLUDEDIR}
|
||||
${_OPENEXR_INCLUDEDIR}
|
||||
/usr/local/include
|
||||
@@ -50,18 +52,13 @@ set (GENERIC_INCLUDE_PATHS
|
||||
/sw/include
|
||||
/opt/local/include )
|
||||
|
||||
# Find the include file locations. We call find_path twice -- first using
|
||||
# only the custom paths, then if that fails, try the default paths only.
|
||||
# This seems to be the most robust way I can find to not get confused when
|
||||
# both system and custom libraries are present.
|
||||
# Find the include file locations.
|
||||
find_path (ILMBASE_INCLUDE_PATH OpenEXR/IlmBaseConfig.h
|
||||
PATHS ${ILMBASE_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}
|
||||
${GENERIC_INCLUDE_PATHS} NO_DEFAULT_PATH)
|
||||
find_path (ILMBASE_INCLUDE_PATH OpenEXR/IlmBaseConfig.h)
|
||||
HINTS ${ILMBASE_INCLUDE_DIR} ${OPENEXR_INCLUDE_DIR}
|
||||
${GENERIC_INCLUDE_PATHS} )
|
||||
find_path (OPENEXR_INCLUDE_PATH OpenEXR/OpenEXRConfig.h
|
||||
PATHS ${OPENEXR_INCLUDE_DIR}
|
||||
${GENERIC_INCLUDE_PATHS} NO_DEFAULT_PATH)
|
||||
find_path (OPENEXR_INCLUDE_PATH OpenEXR/OpenEXRConfig.h)
|
||||
HINTS ${OPENEXR_INCLUDE_DIR}
|
||||
${GENERIC_INCLUDE_PATHS} )
|
||||
|
||||
# Try to figure out version number
|
||||
if (DEFINED _OPENEXR_VERSION AND NOT "${_OPENEXR_VERSION}" STREQUAL "")
|
||||
@@ -85,10 +82,10 @@ endif ()
|
||||
|
||||
|
||||
# List of likely places to find the libraries -- note priority override of
|
||||
# ${OPENEXR_ROOT_DIR}/lib.
|
||||
# ${OPENEXR_ROOT}/lib.
|
||||
set (GENERIC_LIBRARY_PATHS
|
||||
${OPENEXR_ROOT_DIR}/lib
|
||||
${ILMBASE_ROOT_DIR}/lib
|
||||
${OPENEXR_ROOT}/lib
|
||||
${ILMBASE_ROOT}/lib
|
||||
${OPENEXR_INCLUDE_PATH}/../lib
|
||||
${ILMBASE_INCLUDE_PATH}/../lib
|
||||
${_ILMBASE_LIBDIR}
|
||||
@@ -114,41 +111,22 @@ if (OpenEXR_USE_STATIC_LIBS)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Look for the libraries themselves, for all the components. Like with the
|
||||
# headers, we do two finds -- first for custom locations, then for default.
|
||||
# Look for the libraries themselves, for all the components.
|
||||
# This is complicated because the OpenEXR libraries may or may not be
|
||||
# built with version numbers embedded.
|
||||
set (_openexr_components IlmThread IlmImf Imath Iex Half)
|
||||
foreach (COMPONENT ${_openexr_components})
|
||||
string (TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
# First try with the version embedded
|
||||
set (FULL_COMPONENT_NAME ${COMPONENT}-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR})
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME}
|
||||
PATHS ${OPENEXR_LIBRARY_DIR} $ENV{OPENEXR_LIBRARY_DIR}
|
||||
${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH)
|
||||
# Again, with no directory restrictions
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME})
|
||||
# Try again without the version
|
||||
set (FULL_COMPONENT_NAME ${COMPONENT})
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME}
|
||||
PATHS ${OPENEXR_LIBRARY_DIR} $ENV{OPENEXR_LIBRARY_DIR}
|
||||
${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH)
|
||||
# One more time, with no restrictions
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME})
|
||||
find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY
|
||||
NAMES ${COMPONENT}-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}
|
||||
${COMPONENT}
|
||||
${COMPONENT}-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}_d
|
||||
${COMPONENT}_d
|
||||
HINTS ${OPENEXR_LIBRARY_DIR} $ENV{OPENEXR_LIBRARY_DIR}
|
||||
${GENERIC_LIBRARY_PATHS} )
|
||||
endforeach ()
|
||||
|
||||
# Set the FOUND, INCLUDE_DIR, and LIBRARIES variables.
|
||||
if (ILMBASE_INCLUDE_PATH AND OPENEXR_INCLUDE_PATH AND
|
||||
OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND
|
||||
OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
|
||||
set (OPENEXR_FOUND TRUE)
|
||||
set (ILMBASE_FOUND TRUE)
|
||||
set (ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH} CACHE STRING "The include paths needed to use IlmBase")
|
||||
set (OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATH} CACHE STRING "The include paths needed to use OpenEXR")
|
||||
set (ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase")
|
||||
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} ${ZLIB_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR")
|
||||
endif ()
|
||||
|
||||
find_package_handle_standard_args (OpenEXR
|
||||
REQUIRED_VARS ILMBASE_INCLUDE_PATH OPENEXR_INCLUDE_PATH
|
||||
OPENEXR_IMATH_LIBRARY OPENEXR_ILMIMF_LIBRARY
|
||||
@@ -156,11 +134,17 @@ find_package_handle_standard_args (OpenEXR
|
||||
VERSION_VAR OPENEXR_VERSION
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
ILMBASE_INCLUDE_DIR
|
||||
OPENEXR_INCLUDE_DIR
|
||||
ILMBASE_LIBRARIES
|
||||
OPENEXR_LIBRARIES
|
||||
if (OPENEXR_FOUND)
|
||||
set (ILMBASE_FOUND TRUE)
|
||||
set (ILMBASE_INCLUDES ${ILMBASE_INCLUDE_PATH})
|
||||
set (OPENEXR_INCLUDES ${OPENEXR_INCLUDE_PATH})
|
||||
set (ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH})
|
||||
set (OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATH})
|
||||
set (ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase")
|
||||
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} ${ZLIB_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR")
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(
|
||||
OPENEXR_ILMIMF_LIBRARY
|
||||
OPENEXR_IMATH_LIBRARY
|
||||
OPENEXR_IEX_LIBRARY
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
###########################################################################
|
||||
# OpenImageIO https://www.openimageio.org
|
||||
# Copyright 2008-2018 Larry Gritz et al. All rights reserved.
|
||||
# BSD 3-clause license:
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
#
|
||||
# For an up-to-date version of this file, see:
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/src/cmake/Modules/FindOpenImageIO.cmake
|
||||
#
|
||||
@@ -11,23 +12,41 @@
|
||||
# CMake module to find OpenImageIO
|
||||
#
|
||||
# This module will set
|
||||
# OPENIMAGEIO_FOUND True, if found
|
||||
# OPENIMAGEIO_INCLUDE_DIR directory where headers are found
|
||||
# OpenImageIO_FOUND True, if found
|
||||
# OPENIMAGEIO_INCLUDES directory where headers are found
|
||||
# OPENIMAGEIO_LIBRARIES libraries for OIIO
|
||||
# OPENIMAGEIO_LIBRARY_DIRS library dirs for OIIO
|
||||
# OPENIMAGEIO_VERSION Version ("major.minor.patch")
|
||||
# OPENIMAGEIO_VERSION Version ("major.minor.patch.tweak")
|
||||
# OPENIMAGEIO_VERSION_MAJOR Version major number
|
||||
# OPENIMAGEIO_VERSION_MINOR Version minor number
|
||||
# OPENIMAGEIO_VERSION_PATCH Version minor patch
|
||||
# OPENIMAGEIO_VERSION_TWEAK Version minor tweak
|
||||
# OIIOTOOL_BIN Path to oiiotool executable
|
||||
#
|
||||
# Imported targets:
|
||||
# OpenImageIO::OpenImageIO The libOpenImageIO library.
|
||||
# OpenImageIO::oiiotool The oiiotool executable.
|
||||
#
|
||||
# Special inputs:
|
||||
# OpenImageIO_ROOT - if using CMake >= 3.12, will automatically search
|
||||
# this area for OIIO components.
|
||||
# OPENIMAGEIO_ROOT_DIR - custom "prefix" location of OIIO installation
|
||||
# (expecting bin, lib, include subdirectories)
|
||||
# This is deprecated, but will work for a while.
|
||||
# OpenImageIO_FIND_QUIETLY - if set, print minimal console output
|
||||
# OIIO_LIBNAME_SUFFIX - if set, optional nonstandard library suffix
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# NOTE: This file is deprecated.
|
||||
#
|
||||
# In OIIO 2.1+, we generate OpenImageIOConfig.cmake files that are now the
|
||||
# preferred way for downstream projecs to find an installed OIIO. There
|
||||
# should be no need to copy this FindOpenImageIO.cmake file into downstream
|
||||
# projects, *unless* they need to work with a range of OIIO vesions that
|
||||
# may include <2.1, which would lack the generated config files.
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
|
||||
# If 'OPENIMAGE_HOME' not set, use the env variable of that name if available
|
||||
@@ -36,23 +55,16 @@ if (NOT OPENIMAGEIO_ROOT_DIR AND NOT $ENV{OPENIMAGEIO_ROOT_DIR} STREQUAL "")
|
||||
endif ()
|
||||
|
||||
|
||||
if (NOT OpenImageIO_FIND_QUIETLY)
|
||||
message ( STATUS "OPENIMAGEIO_ROOT_DIR = ${OPENIMAGEIO_ROOT_DIR}" )
|
||||
endif ()
|
||||
|
||||
find_library ( OPENIMAGEIO_LIBRARY
|
||||
NAMES OpenImageIO${OIIO_LIBNAME_SUFFIX}
|
||||
HINTS ${OPENIMAGEIO_ROOT_DIR}/lib
|
||||
PATH_SUFFIXES lib64 lib
|
||||
PATHS "${OPENIMAGEIO_ROOT_DIR}/lib" )
|
||||
HINTS ${OPENIMAGEIO_ROOT_DIR}
|
||||
PATH_SUFFIXES lib64 lib )
|
||||
find_path ( OPENIMAGEIO_INCLUDE_DIR
|
||||
NAMES OpenImageIO/imageio.h
|
||||
HINTS ${OPENIMAGEIO_ROOT_DIR}/include
|
||||
PATH_SUFFIXES include )
|
||||
HINTS ${OPENIMAGEIO_ROOT_DIR} )
|
||||
find_program ( OIIOTOOL_BIN
|
||||
NAMES oiiotool oiiotool.exe
|
||||
HINTS ${OPENIMAGEIO_ROOT_DIR}/bin
|
||||
PATH_SUFFIXES bin )
|
||||
NAMES oiiotool
|
||||
HINTS ${OPENIMAGEIO_ROOT_DIR} )
|
||||
|
||||
# Try to figure out version number
|
||||
set (OIIO_VERSION_HEADER "${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/oiioversion.h")
|
||||
@@ -63,33 +75,53 @@ if (EXISTS "${OIIO_VERSION_HEADER}")
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_MINOR ${TMP})
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_PATCH .*$")
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_PATCH ${TMP})
|
||||
set (OPENIMAGEIO_VERSION "${OPENIMAGEIO_VERSION_MAJOR}.${OPENIMAGEIO_VERSION_MINOR}.${OPENIMAGEIO_VERSION_PATCH}")
|
||||
file (STRINGS "${OIIO_VERSION_HEADER}" TMP REGEX "^#define OIIO_VERSION_TWEAK .*$")
|
||||
if (TMP)
|
||||
string (REGEX MATCHALL "[0-9]+" OPENIMAGEIO_VERSION_TWEAK ${TMP})
|
||||
else ()
|
||||
set (OPENIMAGEIO_VERSION_TWEAK 0)
|
||||
endif ()
|
||||
set (OPENIMAGEIO_VERSION "${OPENIMAGEIO_VERSION_MAJOR}.${OPENIMAGEIO_VERSION_MINOR}.${OPENIMAGEIO_VERSION_PATCH}.${OPENIMAGEIO_VERSION_TWEAK}")
|
||||
endif ()
|
||||
|
||||
set ( OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
|
||||
get_filename_component (OPENIMAGEIO_LIBRARY_DIRS "${OPENIMAGEIO_LIBRARY}" DIRECTORY CACHE)
|
||||
|
||||
if (NOT OpenImageIO_FIND_QUIETLY)
|
||||
message ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDE_DIR}" )
|
||||
message ( STATUS "OpenImageIO libraries = ${OPENIMAGEIO_LIBRARIES}" )
|
||||
message ( STATUS "OpenImageIO library_dirs = ${OPENIMAGEIO_LIBRARY_DIRS}" )
|
||||
message ( STATUS "OpenImageIO oiiiotool = ${OIIOTOOL_BIN}" )
|
||||
endif ()
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (OpenImageIO
|
||||
FOUND_VAR OPENIMAGEIO_FOUND
|
||||
REQUIRED_VARS OPENIMAGEIO_INCLUDE_DIR OPENIMAGEIO_LIBRARIES
|
||||
OPENIMAGEIO_LIBRARY_DIRS OPENIMAGEIO_VERSION
|
||||
FOUND_VAR OpenImageIO_FOUND
|
||||
REQUIRED_VARS OPENIMAGEIO_INCLUDE_DIR OPENIMAGEIO_LIBRARY
|
||||
OPENIMAGEIO_VERSION
|
||||
VERSION_VAR OPENIMAGEIO_VERSION
|
||||
)
|
||||
set (OPENIMAGEIO_FOUND ${OpenImageIO_FOUND}) # Old name
|
||||
|
||||
if (OpenImageIO_FOUND)
|
||||
set (OPENIMAGEIO_INCLUDES ${OPENIMAGEIO_INCLUDE_DIR})
|
||||
set (OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
|
||||
get_filename_component (OPENIMAGEIO_LIBRARY_DIRS "${OPENIMAGEIO_LIBRARY}" DIRECTORY)
|
||||
if (NOT OpenImageIO_FIND_QUIETLY)
|
||||
message ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDE_DIR}" )
|
||||
message ( STATUS "OpenImageIO libraries = ${OPENIMAGEIO_LIBRARIES}" )
|
||||
message ( STATUS "OpenImageIO library_dirs = ${OPENIMAGEIO_LIBRARY_DIRS}" )
|
||||
message ( STATUS "OpenImageIO oiiotool = ${OIIOTOOL_BIN}" )
|
||||
endif ()
|
||||
|
||||
if (NOT TARGET OpenImageIO::OpenImageIO)
|
||||
add_library(OpenImageIO::OpenImageIO UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenImageIO::OpenImageIO PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OPENIMAGEIO_INCLUDES}")
|
||||
|
||||
set_property(TARGET OpenImageIO::OpenImageIO APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${OPENIMAGEIO_LIBRARIES}")
|
||||
endif ()
|
||||
|
||||
if (NOT TARGET OpenImageIO::oiiotool AND EXISTS "${OIIOTOOL_BIN}")
|
||||
add_executable(OpenImageIO::oiiotool IMPORTED)
|
||||
set_target_properties(OpenImageIO::oiiotool PROPERTIES
|
||||
IMPORTED_LOCATION "${OIIOTOOL_BIN}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (
|
||||
OPENIMAGEIO_INCLUDE_DIR
|
||||
OPENIMAGEIO_LIBRARIES
|
||||
OPENIMAGEIO_LIBRARY_DIRS
|
||||
OPENIMAGEIO_VERSION
|
||||
OPENIMAGEIO_VERSION_MAJOR
|
||||
OPENIMAGEIO_VERSION_MINOR
|
||||
OPENIMAGEIO_VERSION_PATCH
|
||||
OPENIMAGEIO_LIBRARY
|
||||
)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# Module to find OpenJpeg.
|
||||
#
|
||||
# This module will first look into the directories defined by the variables:
|
||||
# - OPENJPEG_HOME
|
||||
# - OpenJpeg_ROOT
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# OPENJPEG_INCLUDE_DIR - where to find openjpeg.h
|
||||
# OPENJPEG_INCLUDES - where to find openjpeg.h
|
||||
# OPENJPEG_LIBRARIES - list of libraries to link against when using OpenJpeg.
|
||||
# OPENJPEG_FOUND - True if OpenJpeg was found.
|
||||
# OPENJPEG_VERSION - Set to the OpenJPEG version found
|
||||
@@ -17,7 +17,6 @@ macro (PREFIX_FIND_INCLUDE_DIR prefix includefile libpath_var)
|
||||
string (TOUPPER ${prefix}_INCLUDE_DIR tmp_varname)
|
||||
find_path(${tmp_varname} ${includefile}
|
||||
PATHS ${${libpath_var}}
|
||||
PATH_SUFFIXES include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
if (${tmp_varname})
|
||||
@@ -32,13 +31,11 @@ macro (PREFIX_FIND_LIB prefix libname libpath_var liblist_var cachelist_var)
|
||||
find_library(${tmp_prefix}_LIBRARY_RELEASE
|
||||
NAMES ${libname}
|
||||
PATHS ${${libpath_var}}
|
||||
PATH_SUFFIXES lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
find_library(${tmp_prefix}_LIBRARY_DEBUG
|
||||
NAMES ${libname}d ${libname}_d ${libname}debug ${libname}_debug
|
||||
PATHS ${${libpath_var}}
|
||||
PATH_SUFFIXES lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
# Properly define ${tmp_prefix}_LIBRARY (cached) and ${tmp_prefix}_LIBRARIES
|
||||
@@ -68,9 +65,7 @@ set (OpenJpeg_include_paths
|
||||
/usr/include/openjpeg-2.3
|
||||
/usr/include/openjpeg-2.2
|
||||
/usr/include/openjpeg-2.1
|
||||
/usr/include/openjpeg-1.5
|
||||
/usr/include/openjpeg
|
||||
/usr/local/include/openjpeg-1.5
|
||||
/usr/include
|
||||
/opt/local/include
|
||||
/opt/local/include/openjpeg-2.3
|
||||
@@ -85,20 +80,20 @@ set (OpenJpeg_library_paths
|
||||
/sw/lib
|
||||
/opt/local/lib)
|
||||
|
||||
if (OPENJPEG_HOME)
|
||||
if (OpenJpeg_ROOT)
|
||||
set (OpenJpeg_library_paths
|
||||
${OPENJPEG_HOME}/lib
|
||||
${OPENJPEG_HOME}/lib64
|
||||
${OPENJPEG_HOME}/bin
|
||||
${OpenJpeg_ROOT}/lib
|
||||
${OpenJpeg_ROOT}/lib64
|
||||
${OpenJpeg_ROOT}/bin
|
||||
${OpenJpeg_library_paths}
|
||||
)
|
||||
set (OpenJpeg_include_paths
|
||||
${OPENJPEG_HOME}/include/openjpeg-2.3
|
||||
${OPENJPEG_HOME}/include/openjpeg-2.2
|
||||
${OPENJPEG_HOME}/include/openjpeg-2.1
|
||||
${OPENJPEG_HOME}/include/openjpeg-2.0
|
||||
${OPENJPEG_HOME}/include/openjpeg
|
||||
${OPENJPEG_HOME}/include
|
||||
${OpenJpeg_ROOT}/include/openjpeg-2.3
|
||||
${OpenJpeg_ROOT}/include/openjpeg-2.2
|
||||
${OpenJpeg_ROOT}/include/openjpeg-2.1
|
||||
${OpenJpeg_ROOT}/include/openjpeg-2.0
|
||||
${OpenJpeg_ROOT}/include/openjpeg
|
||||
${OpenJpeg_ROOT}/include
|
||||
${OpenJpeg_include_paths}
|
||||
)
|
||||
endif()
|
||||
@@ -154,10 +149,12 @@ else ()
|
||||
endif ()
|
||||
|
||||
# Use the standard function to handle OPENJPEG_FOUND
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS (OpenJpeg DEFAULT_MSG
|
||||
OPENJPEG_INCLUDE_DIR ${OpenJpeg_libvars})
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS (OpenJpeg
|
||||
VERSION_VAR OPENJPEG_VERSION
|
||||
REQUIRED_VARS OPENJPEG_INCLUDE_DIR ${OpenJpeg_libvars})
|
||||
|
||||
if (OPENJPEG_FOUND)
|
||||
set (OPENJPEG_INCLUDES ${OPENJPEG_INCLUDE_DIR})
|
||||
set (OPENJPEG_LIBRARIES "")
|
||||
foreach (tmplib ${OpenJpeg_libvars})
|
||||
list (APPEND OPENJPEG_LIBRARIES ${${tmplib}})
|
||||
|
||||
@@ -4,14 +4,16 @@
|
||||
# OPENVDB_INCLUDE_DIRS, where to find openvdb.h, Set when
|
||||
# OPENVDB_INCLUDE_DIR is found.
|
||||
# OPENVDB_LIBRARIES, libraries to link against to use OPENVDB.
|
||||
# OPENVDB_ROOT_DIR, The base directory to search for OPENVDB.
|
||||
# OpenVDB_ROOT, The base directory to search for OPENVDB.
|
||||
# This can also be an environment variable.
|
||||
# OPENVDB_FOUND, If false, do not try to use OPENVDB.
|
||||
# OpenVDB_FOUND, If false, do not try to use OPENVDB.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# OPENVDB_LIBRARY, where to find the OPENVDB library.
|
||||
|
||||
#=============================================================================
|
||||
# Modified from one with this copyright notice:
|
||||
#
|
||||
# Copyright 2015 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
@@ -22,13 +24,9 @@
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If OPENVDB_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT OPENVDB_ROOT_DIR AND NOT $ENV{OPENVDB_ROOT_DIR} STREQUAL "")
|
||||
SET(OPENVDB_ROOT_DIR $ENV{OPENVDB_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_openvdb_SEARCH_DIRS
|
||||
${OPENVDB_ROOT_DIR}
|
||||
${OpenVDB_ROOT}
|
||||
ENV OpenVDB_ROOT
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
@@ -56,11 +54,11 @@ if (OPENVDB_INCLUDE_DIR)
|
||||
endif ()
|
||||
|
||||
LIST(INSERT oiio_vdblib_search 0 lib)
|
||||
IF (DEBUGMODE)
|
||||
LIST(INSERT oiio_vdblib_search 0 lib/debug)
|
||||
ENDIF ()
|
||||
if ($<CONFIG:Debug>)
|
||||
list (INSERT oiio_vdblib_search 0 lib/debug)
|
||||
endif ()
|
||||
|
||||
FIND_LIBRARY(OPENVDB_LIBRARY
|
||||
find_library(OPENVDB_LIBRARY
|
||||
NAMES
|
||||
openvdb
|
||||
HINTS
|
||||
@@ -69,18 +67,26 @@ FIND_LIBRARY(OPENVDB_LIBRARY
|
||||
${oiio_vdblib_search}
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set OPENVDB_FOUND to TRUE if
|
||||
# handle the QUIETLY and REQUIRED arguments and set OpenVDB_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENVDB
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenVDB
|
||||
REQUIRED_VARS OPENVDB_LIBRARY OPENVDB_INCLUDE_DIR
|
||||
VERSION_VAR OPENVDB_VERSION
|
||||
)
|
||||
|
||||
IF(OPENVDB_FOUND)
|
||||
SET(OPENVDB_LIBRARIES ${OPENVDB_LIBRARY})
|
||||
SET(OPENVDB_INCLUDE_DIRS ${OPENVDB_INCLUDE_DIR})
|
||||
ENDIF(OPENVDB_FOUND)
|
||||
if (OpenVDB_FOUND)
|
||||
set(OPENVDB_LIBRARIES ${OPENVDB_LIBRARY})
|
||||
set(OPENVDB_INCLUDES ${OPENVDB_INCLUDE_DIR})
|
||||
|
||||
if (NOT TARGET OpenVDB::OpenVDB)
|
||||
add_library(OpenVDB::OpenVDB UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenVDB::OpenVDB PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OPENVDB_INCLUDES}")
|
||||
set_property(TARGET OpenVDB::OpenVDB APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${OPENVDB_LIBRARIES}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENVDB_INCLUDE_DIR
|
||||
|
||||
@@ -127,7 +127,9 @@ find_package_handle_standard_args(PTex
|
||||
|
||||
if (PTEX_FOUND)
|
||||
set(PTEX_LIBRARIES ${PTEX_LIBRARY})
|
||||
endif(PTEX_FOUND)
|
||||
else ()
|
||||
set (PTEX_INCLUDE_DIR "")
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
PTEX_INCLUDE_DIR
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# Find the pugixml XML parsing library.
|
||||
#
|
||||
# Sets the usual variables expected for find_package scripts:
|
||||
#
|
||||
# PUGIXML_INCLUDE_DIR - header location
|
||||
# PUGIXML_LIBRARIES - library to link against
|
||||
# PUGIXML_FOUND - true if pugixml was found.
|
||||
|
||||
find_path (PUGIXML_INCLUDE_DIR
|
||||
NAMES pugixml.hpp
|
||||
PATHS ${PUGIXML_HOME}/include
|
||||
/usr/local/include
|
||||
/usr/local/include/pugixml-1.8)
|
||||
find_library (PUGIXML_LIBRARY
|
||||
NAMES pugixml
|
||||
PATHS ${PUGIXML_HOME}/lib
|
||||
/usr/local/lib
|
||||
/usr/local/lib/pugixml-1.8)
|
||||
|
||||
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
|
||||
include (FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS (PugiXML DEFAULT_MSG PUGIXML_LIBRARY
|
||||
PUGIXML_INCLUDE_DIR)
|
||||
|
||||
if (PUGIXML_FOUND)
|
||||
set (PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
|
||||
if (NOT PugiXML_FIND_QUIETLY)
|
||||
message (STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}")
|
||||
message (STATUS "PugiXML library = ${PUGIXML_LIBRARY}")
|
||||
endif ()
|
||||
else ()
|
||||
message (STATUS "No PugiXML found")
|
||||
endif()
|
||||
|
||||
mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
|
||||
@@ -0,0 +1,66 @@
|
||||
# - Try to find R3D SDK
|
||||
#
|
||||
# Set R3DSDK_ROOT Environment variable to root of the SDK
|
||||
# Otherwise it will try to guess some plausible paths.
|
||||
#
|
||||
# Once done, this will define
|
||||
#
|
||||
# R3DSDK_FOUND - system has R3D SDK
|
||||
# R3DSDK_INCLUDE_DIR - the include directory
|
||||
# R3DSDK_LIBRARIES - link these at build time.
|
||||
# R3DSDK_RUNTIME_LIBRARIES - Use this path (or copy the contents to a path)
|
||||
# for R3DSDK::InitializeSdk() at runtime.
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
# Assuming only C++11 and 64 bit support is needed.
|
||||
# Set R3DSDK_LIB_NAME before invoking this file to override.
|
||||
if (NOT DEFINED R3DSDK_LIB_NAME)
|
||||
set(R3DSDK_LIB_NAME R3DSDKPIC-cpp11)
|
||||
endif()
|
||||
|
||||
|
||||
if(DEFINED ENV{R3DSDK_ROOT})
|
||||
set(R3DSDK_ROOT $ENV{R3DSDK_ROOT})
|
||||
# message("Using R3D SDK Root: " ${R3DSDK_ROOT})
|
||||
else()
|
||||
# message("Looking for R3D SDK")
|
||||
|
||||
# The R3D SDK is supplied as a zip file that you can unpack anywhere.
|
||||
# So try some plausible locations and hope for the best.
|
||||
# Use a glob to try and avoid dealing with exact SDK version numbers.
|
||||
|
||||
file(GLOB R3DSDK_PATHS "/opt/R3DSDKv*"
|
||||
"C:/R3DSDKv*"
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../R3DSDKv*
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../R3DSDKv*
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../R3DSDKv*
|
||||
)
|
||||
find_path(R3DSDK_ROOT Include/R3DSDK.h
|
||||
PATHS ${R3DSDK_PATHS}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(R3DSDK_INCLUDE_DIR ${R3DSDK_ROOT}/Include)
|
||||
find_library(R3DSDK_LIBRARY NAMES ${R3DSDK_LIB_NAME}
|
||||
PATHS ${R3DSDK_ROOT}/Lib/linux64/
|
||||
${R3DSDK_ROOT}/Lib/win64/
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set R3DSDK_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(R3DSDK DEFAULT_MSG R3DSDK_LIBRARY R3DSDK_INCLUDE_DIR)
|
||||
|
||||
|
||||
# TODO : Ask somebody with a Mac to add support.
|
||||
if(R3DSDK_FOUND)
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set(R3DSDK_LIBRARIES ${R3DSDK_LIBRARY} dl)
|
||||
set(R3DSDK_RUNTIME_LIBRARIES ${R3DSDK_ROOT}/Redistributable/linux)
|
||||
else()
|
||||
set(R3DSDK_LIBRARIES ${R3DSDK_LIBRARY})
|
||||
set(R3DSDK_RUNTIME_LIBRARIES ${R3DSDK_ROOT}/Redistributable/win)
|
||||
endif()
|
||||
endif()
|
||||
mark_as_advanced(R3DSDK_LIBRARY R3DSDK_INCLUDE_DIR)
|
||||
@@ -0,0 +1,21 @@
|
||||
# Find Robinmap
|
||||
#
|
||||
# Sets the usual variables expected for find_package scripts:
|
||||
#
|
||||
# ROBINMAP_INCLUDES - header location
|
||||
# ROBINMAP_FOUND - true if robin-map was found.
|
||||
|
||||
find_path (ROBINMAP_INCLUDE_DIR tsl/robin_map.h
|
||||
HINTS "${PROJECT_SOURCE_DIR}/ext/robin-map"
|
||||
)
|
||||
|
||||
# Support the REQUIRED and QUIET arguments, and set ROBINMAP_FOUND if found.
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (Robinmap
|
||||
REQUIRED_VARS ROBINMAP_INCLUDE_DIR)
|
||||
|
||||
if (ROBINMAP_FOUND)
|
||||
set (ROBINMAP_INCLUDES ${ROBINMAP_INCLUDE_DIR})
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (ROBINMAP_INCLUDE_DIR)
|
||||
@@ -88,14 +88,10 @@ if(NOT TBB_FOUND)
|
||||
# Check the build type
|
||||
##################################
|
||||
|
||||
if(NOT DEFINED TBB_USE_DEBUG_BUILD)
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Debug|DEBUG|debug")
|
||||
set(TBB_USE_DEBUG_BUILD TRUE)
|
||||
else()
|
||||
set(TBB_USE_DEBUG_BUILD FALSE)
|
||||
endif()
|
||||
if (NOT DEFINED TBB_USE_DEBUG_BUILD)
|
||||
set(TBB_USE_DEBUG_BUILD $<CONFIG:Debug>)
|
||||
endif()
|
||||
|
||||
|
||||
##################################
|
||||
# Set the TBB search directories
|
||||
##################################
|
||||
@@ -140,8 +136,7 @@ if(NOT TBB_FOUND)
|
||||
|
||||
find_path(TBB_INCLUDE_DIRS tbb/tbb.h
|
||||
HINTS ${TBB_INCLUDE_DIR} ${TBB_SEARCH_DIR}
|
||||
PATHS ${TBB_DEFAULT_SEARCH_DIR}
|
||||
PATH_SUFFIXES include)
|
||||
PATHS ${TBB_DEFAULT_SEARCH_DIR})
|
||||
|
||||
##################################
|
||||
# Find TBB components
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# Module to find Webp
|
||||
#
|
||||
# This module will first look into the directories defined by the variables:
|
||||
# - Webp_ROOT, WEBP_INCLUDE_PATH, WEBP_LIBRARY_PATH
|
||||
#
|
||||
# This module defines the following variables:
|
||||
#
|
||||
# Webp_FOUND True if Webp was found.
|
||||
# WEBP_INCLUDES Where to find Webp headers
|
||||
# WEBP_LIBRARIES List of libraries to link against when using Webp
|
||||
# WEBP_VERSION Version of Webp (e.g., 3.6.2)
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
|
||||
find_path (WEBP_INCLUDE_DIR webp/encode.h
|
||||
HINTS
|
||||
${WEBP_INCLUDE_PATH}
|
||||
ENV WEBP_INCLUDE_PATH
|
||||
DOC "The directory where Webp headers reside")
|
||||
|
||||
find_library (WEBP_LIBRARY webp
|
||||
HINTS
|
||||
${WEBP_LIBRARY_PATH}
|
||||
ENV WEBP_LIBRARY_PATH
|
||||
DOC "The directory where Webp libraries reside")
|
||||
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (Webp
|
||||
REQUIRED_VARS WEBP_INCLUDE_DIR
|
||||
WEBP_LIBRARY
|
||||
)
|
||||
|
||||
if (Webp_FOUND)
|
||||
set (WEBP_INCLUDES "${WEBP_INCLUDE_DIR}")
|
||||
set (WEBP_LIBRARIES "${WEBP_LIBRARY}")
|
||||
|
||||
if (NOT TARGET Webp::Webp)
|
||||
add_library(Webp::Webp UNKNOWN IMPORTED)
|
||||
set_target_properties(Webp::Webp PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${WEBP_INCLUDES}")
|
||||
set_property(TARGET Webp::Webp APPEND PROPERTY
|
||||
IMPORTED_LOCATION "${WEBP_LIBRARIES}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (
|
||||
WEBP_INCLUDE_DIR
|
||||
WEBP_LIBRARY
|
||||
)
|
||||
@@ -0,0 +1,28 @@
|
||||
# Find fmt library
|
||||
#
|
||||
# Sets the usual variables expected for find_package scripts:
|
||||
#
|
||||
# FMT_INCLUDES - header location
|
||||
# FMT_FOUND - true if fmt was found.
|
||||
# FMT_VERSION - combined version number (e.g. 60102 for 6.1.2)
|
||||
|
||||
find_path (FMT_INCLUDE_DIR fmt/format.h
|
||||
HINTS "${PROJECT_SOURCE_DIR}/ext/fmt"
|
||||
)
|
||||
|
||||
if (FMT_INCLUDE_DIR)
|
||||
file(STRINGS "${FMT_INCLUDE_DIR}/fmt/core.h" TMP REGEX "^#define FMT_VERSION .*$")
|
||||
string (REGEX MATCHALL "[0-9]+[.0-9]+" FMT_VERSION ${TMP})
|
||||
endif ()
|
||||
|
||||
# Support the REQUIRED and QUIET arguments, and set FMT_FOUND if found.
|
||||
include (FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args (fmt
|
||||
REQUIRED_VARS FMT_INCLUDE_DIR
|
||||
VERSION_VAR FMT_VERSION)
|
||||
|
||||
if (FMT_FOUND)
|
||||
set (FMT_INCLUDES ${FMT_INCLUDE_DIR})
|
||||
endif ()
|
||||
|
||||
mark_as_advanced (FMT_INCLUDE_DIR)
|
||||
+144
-52
@@ -1,33 +1,28 @@
|
||||
# Macro to install targets to the appropriate locations. Use this instead of
|
||||
# the install(TARGETS ...) signature.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# oiio_install_targets (target1 [target2 ...])
|
||||
#
|
||||
macro (oiio_install_targets)
|
||||
install (TARGETS ${ARGN}
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT user
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT user
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT developer)
|
||||
endmacro ()
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
|
||||
# Macro to add a build target for an IO plugin.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# add_oiio_plugin ( source1 [source2 ...]
|
||||
# [ NAME targetname ... ]
|
||||
# [ SRC source1 ... ]
|
||||
# [ INCLUDE_DIRS include_dir1 ... ]
|
||||
# [ LINK_LIBRARIES external_lib1 ... ]
|
||||
# [ DEFINITIONS -DFOO=bar ... ])
|
||||
#
|
||||
# The plugin name is deduced from the name of the current directory and the
|
||||
# source is automatically linked against OpenImageIO. Additional include
|
||||
# directories (just for this target) may be specified after the optional
|
||||
# INCLUDE_DIRS keyword. Additional libraries (for example, libpng) may be
|
||||
# specified after the optionl LINK_LIBRARIES keyword. Additional
|
||||
# preprocessor definitions may be specified after the optional DEFINITIONS
|
||||
# keyword.
|
||||
# The plugin name can be specified with NAME, otherwise is inferred from the
|
||||
# subdirectory name. The source files of the binary can be specifeied with
|
||||
# SRC, otherwise are inferred to be all the .cpp files within the
|
||||
# subdirectory. Optional compile DEFINITIONS, private INCLUDE_DIRS, and
|
||||
# priviate LINK_LIBRARIES may also be specified. The source is automatically
|
||||
# linked against OpenImageIO.
|
||||
#
|
||||
# The plugin may be disabled individually using any of the usual
|
||||
# check_is_enabled() conventions (e.g. -DENABLE_<format>=OFF).
|
||||
#
|
||||
# What goes on under the covers is quite different depending on whether
|
||||
# EMBEDPLUGINS is 0 or 1. If EMBEDPLUGINS is 0 (in which case this is
|
||||
@@ -39,34 +34,107 @@ endmacro ()
|
||||
# be handed off too the setup of the later OpenImageIO target.
|
||||
#
|
||||
macro (add_oiio_plugin)
|
||||
cmake_parse_arguments (_plugin "" "" "INCLUDE_DIRS;LINK_LIBRARIES;DEFINITIONS" ${ARGN})
|
||||
cmake_parse_arguments (_plugin "" "NAME" "SRC;INCLUDE_DIRS;LINK_LIBRARIES;DEFINITIONS" ${ARGN})
|
||||
# Arguments: <prefix> <options> <one_value_keywords> <multi_value_keywords> args...
|
||||
if (EMBEDPLUGINS)
|
||||
set (_target_name OpenImageIO)
|
||||
# Add each source file to the libOpenImageIO_srcs, but it takes some
|
||||
# bending over backwards to change it in the parent scope.
|
||||
set (_plugin_all_source ${libOpenImageIO_srcs})
|
||||
foreach (_plugin_source_file ${_plugin_UNPARSED_ARGUMENTS})
|
||||
list (APPEND _plugin_all_source "${CMAKE_CURRENT_SOURCE_DIR}/${_plugin_source_file}")
|
||||
endforeach ()
|
||||
set (libOpenImageIO_srcs "${_plugin_all_source}" PARENT_SCOPE)
|
||||
set (format_plugin_definitions ${format_plugin_definitions} ${_plugin_DEFINITIONS} PARENT_SCOPE)
|
||||
set (format_plugin_include_dirs ${format_plugin_include_dirs} ${_plugin_INCLUDE_DIRS} PARENT_SCOPE)
|
||||
set (format_plugin_libs ${format_plugin_libs} ${_plugin_LINK_LIBRARIES} PARENT_SCOPE)
|
||||
get_filename_component (_plugin_name ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
|
||||
if (NOT _plugin_NAME)
|
||||
# If NAME is not supplied, infer target name (and therefore the
|
||||
# executable name) from the directory name.
|
||||
get_filename_component (_plugin_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
endif ()
|
||||
# if (NOT _plugin_SRC)
|
||||
# # If SRC is not supplied, assume local cpp files are its source.
|
||||
# file (GLOB _plugin_SRC *.cpp)
|
||||
# endif ()
|
||||
check_is_enabled (${_plugin_name} _enable_plugin)
|
||||
if (_enable_plugin)
|
||||
if (EMBEDPLUGINS)
|
||||
# Add each source file to the libOpenImageIO_srcs, but it takes some
|
||||
# bending over backwards to change it in the parent scope.
|
||||
set (_plugin_all_source ${libOpenImageIO_srcs})
|
||||
foreach (_plugin_source_file ${_plugin_UNPARSED_ARGUMENTS} )
|
||||
list (APPEND _plugin_all_source "${CMAKE_CURRENT_SOURCE_DIR}/${_plugin_source_file}")
|
||||
endforeach ()
|
||||
set (libOpenImageIO_srcs "${_plugin_all_source}" PARENT_SCOPE)
|
||||
set (format_plugin_definitions ${format_plugin_definitions} ${_plugin_DEFINITIONS} PARENT_SCOPE)
|
||||
set (format_plugin_include_dirs ${format_plugin_include_dirs} ${_plugin_INCLUDE_DIRS} PARENT_SCOPE)
|
||||
set (format_plugin_libs ${format_plugin_libs} ${_plugin_LINK_LIBRARIES} PARENT_SCOPE)
|
||||
else ()
|
||||
# Get the name of the current directory and use it as the target name.
|
||||
get_filename_component (_plugin_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
add_library (${_plugin_name} MODULE ${_plugin_UNPARSED_ARGUMENTS})
|
||||
target_compile_definitions (${_plugin_name} PRIVATE
|
||||
${_plugin_DEFINITIONS}
|
||||
OpenImageIO_EXPORTS)
|
||||
target_include_directories (${_plugin_name} PRIVATE ${_plugin_INCLUDE_DIRS})
|
||||
target_link_libraries (${_plugin_name} PUBLIC OpenImageIO
|
||||
PRIVATE ${_plugin_LINK_LIBRARIES})
|
||||
set_target_properties (${_plugin_name} PROPERTIES PREFIX "" FOLDER "Plugins")
|
||||
install_targets (${_plugin_name})
|
||||
endif ()
|
||||
else ()
|
||||
# Get the name of the current directory and use it as the target name.
|
||||
set (_target_name ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
get_filename_component (_target_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
add_library (${_target_name} SHARED ${_plugin_UNPARSED_ARGUMENTS})
|
||||
add_definitions (${_plugin_DEFINITIONS})
|
||||
include_directories (${_target_name} PRIVATE ${_plugin_INCLUDE_DIRS})
|
||||
target_link_libraries (${_target_name} OpenImageIO ${_plugin_LINK_LIBRARIES})
|
||||
set_target_properties (${_target_name} PROPERTIES PREFIX "" FOLDER "Plugins")
|
||||
oiio_install_targets (${_target_name})
|
||||
message (STATUS "${ColorRed}Disabling ${_plugin_name} ${ColorReset}")
|
||||
string (TOUPPER ${_plugin_name} _plugin_name_upper)
|
||||
set (format_plugin_definitions ${format_plugin_definitions} DISABLE_${_plugin_name_upper} PARENT_SCOPE)
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
|
||||
|
||||
# Macro to add an executable build target. The executable name can be
|
||||
# specified with NAME, otherwise is inferred from the subdirectory name. The
|
||||
# source files of the binary can be specifeied with SRC, otherwise are
|
||||
# inferred to be all the .cpp files within the subdirectory. Optional
|
||||
# compile DEFINITIONS, private INCLUDE_DIRS, and priviate LINK_LIBRARIES may
|
||||
# also be specified.
|
||||
#
|
||||
# The executable may be disabled individually using any of the usual
|
||||
# check_is_enabled() conventions (e.g. -DENABLE_<executable>=OFF).
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# fancy_add_executable ([ NAME targetname ... ]
|
||||
# [ SRC source1 ... ]
|
||||
# [ INCLUDE_DIRS include_dir1 ... ]
|
||||
# [ DEFINITIONS -DFOO=bar ... ])
|
||||
# [ LINK_LIBRARIES external_lib1 ... ]
|
||||
#
|
||||
macro (fancy_add_executable)
|
||||
cmake_parse_arguments (_target "" "NAME" "SRC;INCLUDE_DIRS;SYSTEM_INCLUDE_DIRS;LINK_LIBRARIES;DEFINITIONS" ${ARGN})
|
||||
# Arguments: <prefix> <options> <one_value_keywords> <multi_value_keywords> args...
|
||||
if (NOT _target_NAME)
|
||||
# If NAME is not supplied, infer target name (and therefore the
|
||||
# executable name) from the directory name.
|
||||
get_filename_component (_target_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
|
||||
endif ()
|
||||
if (NOT _target_SRC)
|
||||
# If SRC is not supplied, assume local cpp files are its source.
|
||||
file (GLOB _target_SRC *.cpp)
|
||||
endif ()
|
||||
check_is_enabled (${_target_NAME} _target_NAME_enabled)
|
||||
if (_target_NAME_enabled)
|
||||
add_executable (${_target_NAME} ${_target_SRC})
|
||||
if (_target_INCLUDE_DIRS)
|
||||
target_include_directories (${_target_NAME} PRIVATE ${_target_INCLUDE_DIRS})
|
||||
endif ()
|
||||
if (_target_SYSTEM_INCLUDE_DIRS)
|
||||
target_include_directories (${_target_NAME} SYSTEM PRIVATE ${_target_SYSTEM_INCLUDE_DIRS})
|
||||
endif ()
|
||||
if (_target_DEFINITIONS)
|
||||
target_compile_definitions (${_target_name} PRIVATE ${_target_DEFINITIONS})
|
||||
endif ()
|
||||
if (_target_LINK_LIBRARIES)
|
||||
target_link_libraries (${_target_NAME} PRIVATE ${_target_LINK_LIBRARIES})
|
||||
endif ()
|
||||
set_target_properties (${_target_NAME} PROPERTIES FOLDER "Tools")
|
||||
install_targets (${_target_NAME})
|
||||
else ()
|
||||
message (STATUS "${ColorRed}Disabling ${_target_NAME} ${ColorReset}")
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
|
||||
|
||||
# oiio_set_testenv() - add environment variables to a test
|
||||
#
|
||||
# Usage:
|
||||
@@ -93,22 +161,39 @@ endmacro ()
|
||||
# Usage:
|
||||
# oiio_add_tests ( test1 [ test2 ... ]
|
||||
# [ IMAGEDIR name_of_reference_image_directory ]
|
||||
# [ URL http://find.reference.cases.here.com ] )
|
||||
# [ URL http://find.reference.cases.here.com ]
|
||||
# [ FOUNDVAR variable_name ... ]
|
||||
# [ ENABLEVAR variable_name ... ]
|
||||
# )
|
||||
#
|
||||
# The optional argument IMAGEDIR is used to check whether external test images
|
||||
# (not supplied with OIIO) are present, and to disable the test cases if
|
||||
# they're not. If IMAGEDIR is present, URL should also be included to tell
|
||||
# the user where to find such tests.
|
||||
#
|
||||
# The optional FOUNDVAR introduces variables (typically Foo_FOUND) that if
|
||||
# not existing and true, will skip the test.
|
||||
#
|
||||
# The optional ENABLEVAR introduces variables (typically ENABLE_Foo) that
|
||||
# if existing and yet false, will skip the test.
|
||||
#
|
||||
macro (oiio_add_tests)
|
||||
cmake_parse_arguments (_ats "" "" "URL;IMAGEDIR;LABEL;FOUNDVAR;TESTNAME" ${ARGN})
|
||||
cmake_parse_arguments (_ats "" "" "URL;IMAGEDIR;LABEL;FOUNDVAR;ENABLEVAR;TESTNAME" ${ARGN})
|
||||
# Arguments: <prefix> <options> <one_value_keywords> <multi_value_keywords> args...
|
||||
set (_ats_testdir "${OIIO_TESTSUITE_IMAGEDIR}/${_ats_IMAGEDIR}")
|
||||
# If there was a FOUNDVAR param specified and that variable name is
|
||||
# not defined, mark the test as broken.
|
||||
if (_ats_FOUNDVAR AND NOT ${_ats_FOUNDVAR})
|
||||
set (_ats_LABEL "broken")
|
||||
endif ()
|
||||
foreach (_var ${_ats_FOUNDVAR})
|
||||
if (NOT ${_var})
|
||||
set (_ats_LABEL "broken")
|
||||
endif ()
|
||||
endforeach ()
|
||||
foreach (_var ${_ats_ENABLEVAR})
|
||||
if ((NOT "${${_var}}" STREQUAL "" AND NOT "${${_var}}") OR
|
||||
(NOT "$ENV{${_var}}" STREQUAL "" AND NOT "$ENV{${_var}}"))
|
||||
set (_ats_LABEL "broken")
|
||||
endif ()
|
||||
endforeach ()
|
||||
if (_ats_IMAGEDIR AND NOT EXISTS ${_ats_testdir})
|
||||
# If the directory containig reference data (images) for the test
|
||||
# isn't found, point the user at the URL.
|
||||
@@ -129,7 +214,7 @@ macro (oiio_add_tests)
|
||||
set (_testname "${_testname}-broken")
|
||||
endif ()
|
||||
|
||||
set (_runtest python "${CMAKE_SOURCE_DIR}/testsuite/runtest.py" ${_testdir})
|
||||
set (_runtest ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/testsuite/runtest.py" ${_testdir})
|
||||
if (MSVC_IDE)
|
||||
set (_runtest ${_runtest} --devenv-config $<CONFIGURATION>
|
||||
--solution-path "${CMAKE_BINARY_DIR}" )
|
||||
@@ -145,16 +230,23 @@ macro (oiio_add_tests)
|
||||
|
||||
# For texture tests, add a second test using batch mode as well.
|
||||
if (_testname MATCHES "texture")
|
||||
add_test ( NAME "${_testname}.batch"
|
||||
set (_testname ${_testname}.batch)
|
||||
set (_testdir ${_testdir}.batch)
|
||||
set (_runtest ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/testsuite/runtest.py" ${_testdir})
|
||||
if (MSVC_IDE)
|
||||
set (_runtest ${_runtest} --devenv-config $<CONFIGURATION>
|
||||
--solution-path "${CMAKE_BINARY_DIR}" )
|
||||
endif ()
|
||||
file (MAKE_DIRECTORY "${_testdir}")
|
||||
add_test ( NAME "${_testname}"
|
||||
COMMAND env TESTTEX_BATCH=1 ${_runtest} )
|
||||
|
||||
oiio_set_testenv("${_testname}.batch" "${_testsuite}"
|
||||
"${_testsrcdir}" "${_testdir}" "${_ats_testdir}")
|
||||
oiio_set_testenv("${_testname}" "${_testsuite}"
|
||||
"${_testsrcdir}" "${_testdir}.batch" "${_ats_testdir}")
|
||||
endif ()
|
||||
|
||||
#if (VERBOSE)
|
||||
# message (STATUS "TEST ${_testname}: ${_runtest}")
|
||||
# # message (STATUS "TEST ${_testname}: ${_runtest}")
|
||||
#endif ()
|
||||
endforeach ()
|
||||
if (VERBOSE)
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
###########################################################################
|
||||
# Figure out what platform we're on, and set some variables appropriately
|
||||
|
||||
# CMAKE_SYSTEM_PROCESSOR should not be used because it indicates the platform
|
||||
# we are building on, but when cross compiling or using a chroot this is not
|
||||
# what we want to use
|
||||
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||
set (SYSTEM_PROCESSOR "x86_64")
|
||||
else()
|
||||
set (SYSTEM_PROCESSOR "i686")
|
||||
endif()
|
||||
|
||||
if (VERBOSE)
|
||||
message (STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
|
||||
message (STATUS "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}")
|
||||
message (STATUS "SYSTEM_PROCESSOR = ${SYSTEM_PROCESSOR}")
|
||||
endif ()
|
||||
|
||||
if (UNIX)
|
||||
if (VERBOSE)
|
||||
message (STATUS "Unix! ${CMAKE_SYSTEM_NAME}")
|
||||
endif ()
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set (platform "linux")
|
||||
set (CXXFLAGS "${CXXFLAGS} -DLINUX")
|
||||
if (${SYSTEM_PROCESSOR} STREQUAL "x86_64")
|
||||
set (platform "linux64")
|
||||
set (CXXFLAGS "${CXXFLAGS} -DLINUX64")
|
||||
endif ()
|
||||
elseif (APPLE)
|
||||
set (platform "macosx")
|
||||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set (platform "FreeBSD")
|
||||
set (CXXFLAGS "${CXXFLAGS} -DFREEBSD")
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386")
|
||||
# minimum arch of i586 is needed for atomic cpu instructions
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i586")
|
||||
endif()
|
||||
else ()
|
||||
string (TOLOWER ${CMAKE_SYSTEM_NAME} platform)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
set (platform "windows")
|
||||
endif ()
|
||||
|
||||
if (platform)
|
||||
message (STATUS "platform = ${platform}")
|
||||
else ()
|
||||
message (FATAL_ERROR "'platform' not defined")
|
||||
endif ()
|
||||
|
||||
unset(SYSTEM_PROCESSOR)
|
||||
@@ -0,0 +1,127 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
# Python-related options.
|
||||
option (USE_PYTHON "Build the Python bindings" ON)
|
||||
set (PYTHON_VERSION "2.7" CACHE STRING "Target version of python to find")
|
||||
option (PYLIB_INCLUDE_SONAME "If ON, soname/soversion will be set for Python module library" OFF)
|
||||
option (PYLIB_LIB_PREFIX "If ON, prefix the Python module with 'lib'" OFF)
|
||||
set (PYMODULE_SUFFIX "" CACHE STRING "Suffix to add to Python module init namespace")
|
||||
|
||||
|
||||
# Find Python. This macro should only be called if python is required. If
|
||||
# Python cannot be found, it will be a fatal error.
|
||||
# Variables set by this macro:
|
||||
# PYTHON_INCLUDES_PATH - directory where python headers are found
|
||||
# PYTHON_LIBRARIES - python libraries to link
|
||||
# PYTHON_SITE_DIR - our own install dir where our python moduels go
|
||||
macro (find_python)
|
||||
if (NOT VERBOSE)
|
||||
set (PythonInterp_FIND_QUIETLY true)
|
||||
set (PythonLibs_FIND_QUIETLY true)
|
||||
endif ()
|
||||
|
||||
# Attempt to find the desired version, but fall back to other
|
||||
# additional versions.
|
||||
checked_find_package (PythonInterp ${PYTHON_VERSION} REQUIRED)
|
||||
|
||||
# The version that was found may not be the default or user
|
||||
# defined one.
|
||||
set (PYTHON_VERSION_FOUND ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
|
||||
if (NOT ${PYTHON_VERSION} VERSION_EQUAL ${PYTHON_VERSION_FOUND} )
|
||||
message (WARNING "The requested version ${PYTHON_VERSION} was not found.")
|
||||
message (WARNING "Using ${PYTHON_VERSION_FOUND} instead.")
|
||||
endif ()
|
||||
|
||||
checked_find_package (PythonLibs ${PYTHON_VERSION_FOUND} REQUIRED)
|
||||
if (VERBOSE)
|
||||
message (STATUS " Python include dirs ${PYTHON_INCLUDE_PATH}")
|
||||
message (STATUS " Python libraries ${PYTHON_LIBRARIES}")
|
||||
message (STATUS " Python site packages dir ${PYTHON_SITE_DIR}")
|
||||
message (STATUS " Python to include 'lib' prefix: ${PYLIB_LIB_PREFIX}")
|
||||
message (STATUS " Python to include SO version: ${PYLIB_INCLUDE_SONAME}")
|
||||
message (STATUS " Python version ${PYTHON_VERSION_STRING}")
|
||||
message (STATUS " Python version major: ${PYTHON_VERSION_MAJOR} minor: ${PYTHON_VERSION_MINOR}")
|
||||
endif ()
|
||||
|
||||
if (NOT DEFINED PYTHON_SITE_DIR)
|
||||
set (PYTHON_SITE_DIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_FOUND}/site-packages")
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
|
||||
###########################################################################
|
||||
# pybind11
|
||||
|
||||
macro (setup_python_module)
|
||||
cmake_parse_arguments (lib "" "TARGET;MODULE;LIBS" "SOURCES" ${ARGN})
|
||||
# Arguments: <prefix> <options> <one_value_keywords> <multi_value_keywords> args...
|
||||
|
||||
set (target_name ${lib_TARGET})
|
||||
|
||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
# Seems to be a problem on some systems, with pybind11 and python headers
|
||||
set_property (SOURCE ${lib_SOURCES} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-macro-redefined ")
|
||||
endif ()
|
||||
|
||||
# Add the library itself
|
||||
add_library (${target_name} MODULE ${lib_SOURCES})
|
||||
|
||||
# Set up include dirs for python & pybind11
|
||||
target_include_directories (${target_name} SYSTEM PRIVATE ${PYTHON_INCLUDE_PATH})
|
||||
|
||||
# Declare the libraries it should link against
|
||||
target_link_libraries (${target_name} PRIVATE
|
||||
pybind11::pybind11 ${lib_LIBS} ${SANITIZE_LIBRARIES})
|
||||
if (APPLE)
|
||||
set_target_properties (${target_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
|
||||
else ()
|
||||
target_link_libraries (${target_name} PRIVATE ${PYTHON_LIBRARIES})
|
||||
endif ()
|
||||
|
||||
# Exclude the 'lib' prefix from the name
|
||||
if (NOT PYLIB_LIB_PREFIX)
|
||||
target_compile_definitions(${target_name}
|
||||
PRIVATE "PYMODULE_NAME=${lib_MODULE}")
|
||||
set_target_properties (${target_name} PROPERTIES
|
||||
OUTPUT_NAME ${lib_MODULE}
|
||||
PREFIX "")
|
||||
else ()
|
||||
target_compile_definitions(${target_name}
|
||||
PRIVATE "PYMODULE_NAME=Py${lib_MODULE}")
|
||||
set_target_properties (${target_name} PROPERTIES
|
||||
OUTPUT_NAME Py${lib_MODULE}
|
||||
PREFIX lib)
|
||||
endif ()
|
||||
|
||||
if (PYLIB_INCLUDE_SONAME)
|
||||
if (VERBOSE)
|
||||
message(STATUS "Setting Py${lib_MODULE} SOVERSION to: ${SOVERSION}")
|
||||
endif ()
|
||||
set_target_properties(${target_name} PROPERTIES
|
||||
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||
SOVERSION ${SOVERSION} )
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set_target_properties (${target_name} PROPERTIES
|
||||
DEBUG_POSTFIX "_d"
|
||||
SUFFIX ".pyd")
|
||||
endif()
|
||||
|
||||
# In the build area, put it in lib/python so it doesn't clash with the
|
||||
# non-python libraries of the same name (which aren't prefixed by "lib"
|
||||
# on Windows).
|
||||
set_target_properties (${target_name} PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/python/site-packages
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/python/site-packages
|
||||
)
|
||||
|
||||
install (TARGETS ${target_name}
|
||||
RUNTIME DESTINATION ${PYTHON_SITE_DIR} COMPONENT user
|
||||
LIBRARY DESTINATION ${PYTHON_SITE_DIR} COMPONENT user)
|
||||
|
||||
endmacro ()
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
add_oiio_plugin (ddsinput.cpp squish/alpha.cpp squish/clusterfit.cpp
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
if (Libsquish_FOUND)
|
||||
# External libsquish was found -- use it
|
||||
add_oiio_plugin (ddsinput.cpp
|
||||
LINK_LIBRARIES Libsquish::Libsquish
|
||||
)
|
||||
else ()
|
||||
# No external libsquish was found -- use the embedded version.
|
||||
add_oiio_plugin (ddsinput.cpp squish/alpha.cpp squish/clusterfit.cpp
|
||||
squish/colourblock.cpp squish/colourfit.cpp squish/colourset.cpp
|
||||
squish/maths.cpp squish/rangefit.cpp squish/singlecolourfit.cpp
|
||||
squish/squish.cpp)
|
||||
squish/squish.cpp
|
||||
INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/squish")
|
||||
endif ()
|
||||
|
||||
@@ -1,38 +1,9 @@
|
||||
/*
|
||||
Copyright 2009 Larry Gritz and the other authors and contributors.
|
||||
All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the software's owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(This is the Modified BSD License)
|
||||
*/
|
||||
// Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <OpenImageIO/filesystem.h>
|
||||
#include <OpenImageIO/fmath.h>
|
||||
|
||||
|
||||
OIIO_PLUGIN_NAMESPACE_BEGIN
|
||||
|
||||
|
||||
@@ -1,45 +1,19 @@
|
||||
/*
|
||||
Copyright 2010 Larry Gritz and the other authors and contributors.
|
||||
All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the software's owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(This is the Modified BSD License)
|
||||
*/
|
||||
// Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "dds_pvt.h"
|
||||
|
||||
#include <OpenImageIO/dassert.h>
|
||||
#include <OpenImageIO/filesystem.h>
|
||||
#include <OpenImageIO/fmath.h>
|
||||
#include <OpenImageIO/imageio.h>
|
||||
#include <OpenImageIO/typedesc.h>
|
||||
|
||||
#include "squish/squish.h"
|
||||
#include "dds_pvt.h"
|
||||
#include "squish.h"
|
||||
|
||||
OIIO_PLUGIN_NAMESPACE_BEGIN
|
||||
|
||||
@@ -123,7 +97,7 @@ private:
|
||||
{
|
||||
size_t n = ::fread(buf, itemsize, nitems, m_file);
|
||||
if (n != nitems)
|
||||
error("Read error");
|
||||
errorf("Read error");
|
||||
return n == nitems;
|
||||
}
|
||||
};
|
||||
@@ -160,15 +134,15 @@ DDSInput::open(const std::string& name, ImageSpec& newspec)
|
||||
|
||||
m_file = Filesystem::fopen(name, "rb");
|
||||
if (!m_file) {
|
||||
error("Could not open file \"%s\"", name.c_str());
|
||||
errorf("Could not open file \"%s\"", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
// due to struct packing, we may get a corrupt header if we just load the
|
||||
// struct from file; to adress that, read every member individually
|
||||
// save some typing
|
||||
#define RH(memb) \
|
||||
if (!fread(&m_dds.memb, sizeof(m_dds.memb), 1)) \
|
||||
#define RH(memb) \
|
||||
if (!fread(&m_dds.memb, sizeof(m_dds.memb), 1)) \
|
||||
return false
|
||||
|
||||
RH(fourCC);
|
||||
@@ -249,7 +223,7 @@ DDSInput::open(const std::string& name, ImageSpec& newspec)
|
||||
&& m_dds.flags & DDS_DEPTH))
|
||||
|| (m_dds.caps.flags2 & DDS_CAPS2_CUBEMAP
|
||||
&& !(m_dds.caps.flags1 & DDS_CAPS1_COMPLEX))) {
|
||||
error("Invalid DDS header, possibly corrupt file");
|
||||
errorf("Invalid DDS header, possibly corrupt file");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -262,7 +236,7 @@ DDSInput::open(const std::string& name, ImageSpec& newspec)
|
||||
&& !((m_dds.fmt.flags & DDS_PF_RGB)
|
||||
| (m_dds.fmt.flags & DDS_PF_LUMINANCE)
|
||||
| (m_dds.fmt.flags & DDS_PF_ALPHA)))) {
|
||||
error("Image with no data");
|
||||
errorf("Image with no data");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -272,7 +246,7 @@ DDSInput::open(const std::string& name, ImageSpec& newspec)
|
||||
&& m_dds.fmt.fourCC != DDS_4CC_DXT2 && m_dds.fmt.fourCC != DDS_4CC_DXT3
|
||||
&& m_dds.fmt.fourCC != DDS_4CC_DXT4
|
||||
&& m_dds.fmt.fourCC != DDS_4CC_DXT5) {
|
||||
error("Unsupported compression type");
|
||||
errorf("Unsupported compression type");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
if (USE_DICOM AND DCMTK_FOUND)
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
if (DCMTK_FOUND)
|
||||
add_oiio_plugin (dicominput.cpp
|
||||
INCLUDE_DIRS ${DCMTK_INCLUDE_DIR}
|
||||
LINK_LIBRARIES ${DCMTK_LIBRARIES}
|
||||
|
||||
@@ -1,32 +1,6 @@
|
||||
/*
|
||||
Copyright 2016 Larry Gritz and the other authors and contributors.
|
||||
All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the software's owners nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(This is the Modified BSD License)
|
||||
*/
|
||||
// Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
// https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
#include <OpenImageIO/fmath.h>
|
||||
#include <OpenImageIO/imageio.h>
|
||||
@@ -63,7 +37,10 @@ public:
|
||||
DICOMInput() {}
|
||||
virtual ~DICOMInput() { close(); }
|
||||
virtual const char* format_name(void) const override { return "dicom"; }
|
||||
virtual int supports(string_view feature) const override { return false; }
|
||||
virtual int supports(string_view /*feature*/) const override
|
||||
{
|
||||
return false; // we don't support any optional features
|
||||
}
|
||||
virtual bool open(const std::string& name, ImageSpec& newspec) override;
|
||||
virtual bool open(const std::string& name, ImageSpec& newspec,
|
||||
const ImageSpec& config) override;
|
||||
@@ -121,7 +98,7 @@ DICOMInput::open(const std::string& name, ImageSpec& newspec)
|
||||
|
||||
bool
|
||||
DICOMInput::open(const std::string& name, ImageSpec& newspec,
|
||||
const ImageSpec& config)
|
||||
const ImageSpec& /*config*/)
|
||||
{
|
||||
m_filename = name;
|
||||
m_subimage = -1;
|
||||
@@ -180,7 +157,7 @@ DICOMInput::seek_subimage(int subimage, int miplevel)
|
||||
m_subimage = 0;
|
||||
if (m_img->getStatus() != EIS_Normal) {
|
||||
m_img.reset();
|
||||
error("Unable to open DICOM file %s", m_filename);
|
||||
errorf("Unable to open DICOM file %s", m_filename);
|
||||
return false;
|
||||
}
|
||||
m_framecount = m_img->getFrameCount();
|
||||
@@ -188,7 +165,7 @@ DICOMInput::seek_subimage(int subimage, int miplevel)
|
||||
}
|
||||
|
||||
if (subimage >= m_firstframe + m_framecount) {
|
||||
error("Unable to seek to subimage %d", subimage);
|
||||
errorf("Unable to seek to subimage %d", subimage);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -197,7 +174,7 @@ DICOMInput::seek_subimage(int subimage, int miplevel)
|
||||
m_img->processNextFrames(1);
|
||||
if (m_img->getStatus() != EIS_Normal) {
|
||||
m_img.reset();
|
||||
error("Unable to seek to subimage %d", subimage);
|
||||
errorf("Unable to seek to subimage %d", subimage);
|
||||
return false;
|
||||
}
|
||||
++m_subimage;
|
||||
@@ -237,7 +214,7 @@ DICOMInput::seek_subimage(int subimage, int miplevel)
|
||||
{ EPI_YBR_Full, "YBR_Full", 3 }, /// YCbCr full
|
||||
{ EPI_YBR_Full_422, "YBR_Full_422", 3 }, /// YCbCr full 4:2:2
|
||||
{ EPI_YBR_Partial_422, "YBR_Partial_422", 3 }, /// YCbCr partial 4:2:2
|
||||
{ EPI_Unknown, NULL }
|
||||
{ EPI_Unknown, NULL, 0 }
|
||||
};
|
||||
int nchannels = 1;
|
||||
const char* photoname = NULL;
|
||||
@@ -287,7 +264,7 @@ DICOMInput::read_metadata()
|
||||
DcmStack stack;
|
||||
while (dcm->nextObject(stack, OFTrue).good()) {
|
||||
DcmObject* object = stack.top();
|
||||
ASSERT(object);
|
||||
OIIO_ASSERT(object);
|
||||
DcmTag& tag = const_cast<DcmTag&>(object->getTag());
|
||||
std::string tagname = tag.getTagName();
|
||||
if (ignore_tags.find(tagname) != ignore_tags.end())
|
||||
@@ -346,7 +323,7 @@ DICOMInput::read_metadata()
|
||||
|
||||
|
||||
bool
|
||||
DICOMInput::read_native_scanline(int subimage, int miplevel, int y, int z,
|
||||
DICOMInput::read_native_scanline(int subimage, int miplevel, int y, int /*z*/,
|
||||
void* data)
|
||||
{
|
||||
lock_guard lock(m_mutex);
|
||||
@@ -355,7 +332,7 @@ DICOMInput::read_native_scanline(int subimage, int miplevel, int y, int z,
|
||||
if (y < 0 || y >= m_spec.height) // out of range scanline
|
||||
return false;
|
||||
|
||||
ASSERT(m_internal_data);
|
||||
OIIO_DASSERT(m_internal_data);
|
||||
size_t size = m_spec.scanline_bytes();
|
||||
memcpy(data, m_internal_data + y * size, size);
|
||||
|
||||
|
||||
@@ -2283,7 +2283,7 @@ Fixes, minor enhancements, and performance improvements:
|
||||
* oiiotool --stats of "deep" files prints a histogram of samples/pixel
|
||||
(1.5.6).
|
||||
* oiiotool -subimage has better error detection and reporting for
|
||||
requests for nonexistant subimages. #1005 (1.5.7)
|
||||
requests for nonexistent subimages. #1005 (1.5.7)
|
||||
* oiiotool --ch is a bit more flexible in its channel-shuffling syntax:
|
||||
you are now able to say newchannel=oldchannel, both shuffling and
|
||||
renaming channels simultaneously, thus removing a frequent necessity
|
||||
@@ -3310,7 +3310,7 @@ Fixes, minor enhancements, and performance improvements:
|
||||
* ImageBufAlgo improvements:
|
||||
* Internal overhaul of IBA::resize to greatly speed it up.
|
||||
* Improve IBA::resize to handle the image edge better -- instead of
|
||||
clamping, just don't consider nonexistant pixels.
|
||||
clamping, just don't consider nonexistent pixels.
|
||||
* More careful selection of filter when resizing (IBA::resize, oiiotool
|
||||
--resize and --fit, and maketx).
|
||||
* Fix IBA::paste() error when the foreground image runs off the end of
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
# Copyright 2008-present Contributors to the OpenImageIO project.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md
|
||||
|
||||
project(documentation)
|
||||
|
||||
set (public_docs
|
||||
openimageio.pdf
|
||||
"${OpenImageIO_SOURCE_DIR}/LICENSE.md"
|
||||
"${OpenImageIO_SOURCE_DIR}/LICENSE-THIRD-PARTY.md"
|
||||
"${OpenImageIO_SOURCE_DIR}/CHANGES.md"
|
||||
|
||||
+10
-26
@@ -254,12 +254,6 @@ TAB_SIZE = 4
|
||||
ALIASES = "rst=\verbatim embed:rst:leading-slashes"
|
||||
ALIASES += "endrst=\endverbatim"
|
||||
|
||||
# This tag can be used to specify a number of word-keyword mappings (TCL only).
|
||||
# A mapping has the form "name=value". For example adding "class=itcl::class"
|
||||
# will allow you to use the command class in the itcl::class meaning.
|
||||
|
||||
TCL_SUBST =
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
|
||||
# only. Doxygen will then generate output that is more tailored for C. For
|
||||
# instance, some of the names that are used will be different. The list of all
|
||||
@@ -900,11 +894,7 @@ RECURSIVE = YES
|
||||
|
||||
EXCLUDE = ../../src/include/OpenImageIO/filter.h \
|
||||
../../src/include/OpenImageIO/plugin.h \
|
||||
../../src/include/OpenImageIO/pugixml.cpp \
|
||||
../../src/include/OpenImageIO/pugixml.hpp \
|
||||
../../src/include/OpenImageIO/SHA1.h \
|
||||
../../src/include/OpenImageIO/tinyformat.h \
|
||||
../../src/include/OpenImageIO/fmt \
|
||||
../../src/include/OpenImageIO/detail \
|
||||
../../src/doc \
|
||||
../../src/libOpenImageIO \
|
||||
../../src/libtexture \
|
||||
@@ -2167,9 +2157,17 @@ INCLUDE_FILE_PATTERNS = *.h
|
||||
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \
|
||||
OIIO_NO_SANITIZE_ADDRESS:= \
|
||||
OIIO_API:= \
|
||||
OIIO_HOSTDEVICE= \
|
||||
OIIO_NAMESPACE_BEGIN="namespace OIIO {" \
|
||||
OIIO_NAMESPACE_END="}" \
|
||||
OIIO_CONSTEXPR14=constexpr
|
||||
OIIO_CONSTEXPR14=constexpr \
|
||||
OIIO_CONSTEXPR20=constexpr \
|
||||
OIIO_PURE_FUNC= \
|
||||
OIIO_CONST_FUNC= \
|
||||
OIIO_MAYBE_UNUSED= \
|
||||
OIIO_NODISCARD=[[nodiscard]] \
|
||||
OIIO_FORCEINLINE=inline
|
||||
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
||||
# tag can be used to specify a list of macro names that should be expanded. The
|
||||
@@ -2236,11 +2234,6 @@ EXTERNAL_GROUPS = YES
|
||||
|
||||
EXTERNAL_PAGES = YES
|
||||
|
||||
# The PERL_PATH should be the absolute path and name of the perl script
|
||||
# interpreter (i.e. the result of 'which perl').
|
||||
# The default file (with absolute path) is: /usr/bin/perl.
|
||||
|
||||
PERL_PATH = /usr/bin/perl
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
@@ -2255,15 +2248,6 @@ PERL_PATH = /usr/bin/perl
|
||||
|
||||
CLASS_DIAGRAMS = YES
|
||||
|
||||
# You can define message sequence charts within doxygen comments using the \msc
|
||||
# command. Doxygen will then run the mscgen tool (see:
|
||||
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
|
||||
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
|
||||
# the mscgen tool resides. If left empty the tool is assumed to be found in the
|
||||
# default search path.
|
||||
|
||||
MSCGEN_PATH =
|
||||
|
||||
# You can include diagrams made with dia in doxygen documentation. Doxygen will
|
||||
# then run dia to produce the diagram and insert it in the documentation. The
|
||||
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
|
||||
|
||||
+6
-3
@@ -3,10 +3,10 @@
|
||||
include ../make/detectplatform.mk
|
||||
BUILDDIR := ../../build/${platform}
|
||||
ifeq (${OIIOTOOL},)
|
||||
ifneq (${shell ls ${BUILDDIR}/src/oiiotool/oiiotool},)
|
||||
OIIOTOOL := "${BUILDDIR}/src/oiiotool/oiiotool"
|
||||
ifneq (${shell ls ${BUILDDIR}/bin/oiiotool},)
|
||||
OIIOTOOL := "${BUILDDIR}/bin/oiiotool"
|
||||
else
|
||||
OIIOTOOL := "../../build/src/oiiotool/oiiotool"
|
||||
OIIOTOOL := "../../build/bin/oiiotool"
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -82,6 +82,9 @@ SPHINXBUILDDIR = ../../build/sphinx
|
||||
sphinx : Makefile conf.py
|
||||
# @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(SPHINXBUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(SPHINXBUILDDIR)" $(SPHINXOPTS)
|
||||
|
||||
sphinxpdf : Makefile conf.py
|
||||
# @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(SPHINXBUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
$(SPHINXBUILD) -b latex "$(SOURCEDIR)" "$(SPHINXBUILDDIR)/latex" $(SPHINXOPTS)
|
||||
$(MAKE) -C $(SPHINXBUILDDIR)/latex all-pdf
|
||||
# $(SPHINXBUILD) -b latexpdf "$(SOURCEDIR)" "$(SPHINXBUILDDIR)/latex" $(SPHINXOPTS)
|
||||
|
||||
+109
-22
@@ -148,7 +148,7 @@ DPX files use the file extension :file:`.dpx`.
|
||||
**Configuration settings for DPX input**
|
||||
|
||||
When opening a DPX ImageInput with a *configuration* (see
|
||||
Section~\ref{sec:inputwithconfig}), the following special configuration
|
||||
Section :ref:`sec-inputwithconfig`), the following special configuration
|
||||
options are supported:
|
||||
|
||||
.. list-table::
|
||||
@@ -375,7 +375,7 @@ Field3d files, and does not write them.
|
||||
Fields are comprised of multiple *layers* (which appear to OpenImageIO
|
||||
as subimages). Each layer/subimage may have a different name, resolution,
|
||||
and coordinate mapping. Layers may be scalar (1 channel) or vector (3
|
||||
channel) fields, and the data may be ``half``, ``float``, or ``double``.
|
||||
channel) fields, and the data may be ``half``, `float`, or ``double``.
|
||||
|
||||
OpenImageIO always reports Field3D files as tiled. If the Field3d file has
|
||||
a "block size", the block size will be reported as the tile size. Otherwise,
|
||||
@@ -551,10 +551,10 @@ preferred except when legacy file access is required.
|
||||
- RGBE header data or explanation
|
||||
* - ``Orientation``
|
||||
- int
|
||||
- encodes the orientation (see Section \ref{metadata:orientation})
|
||||
- encodes the orientation (see Section :ref:`sec-metadata-orientation`)
|
||||
* - ``oiio:ColorSpace``
|
||||
- string
|
||||
- Color space (see Section `Color information metadata`_).
|
||||
- Color space (see Section :ref:`sec-metadata-color`).
|
||||
* - ``oiio:Gamma``
|
||||
- float
|
||||
- the gamma correction specified in the RGBE header (if it's gamma corrected).
|
||||
@@ -726,14 +726,14 @@ anywhere near the acceptance of the original JPEG/JFIF format.
|
||||
-
|
||||
- Extensive Exif, IPTC, XMP, and GPS data are supported by the
|
||||
reader/writer, and you should assume that nearly everything described
|
||||
Appendix~\ref{chap:stdmetadata} is properly translated when using
|
||||
Appendix :ref:`chap-stdmetadata` is properly translated when using
|
||||
JPEG files.
|
||||
|
||||
|
||||
**Limitations**
|
||||
|
||||
* JPEG/JFIF only supports 1- (grayscale) and 3-channel (RGB) images. As a
|
||||
special case, OpenImageIO's JPEG writer will accept $n$-channel image
|
||||
special case, OpenImageIO's JPEG writer will accept n-channel image
|
||||
data, but will only output the first 3 channels (if n >= 3) or the first
|
||||
channel (if n <= 2), silently drop any extra channels from the output.
|
||||
* Since JPEG/JFIF only supports 8 bits per channel, OpenImageIO's
|
||||
@@ -819,6 +819,12 @@ Some special attributes are used for movie files:
|
||||
* - ``oiio:Movie``
|
||||
- int
|
||||
- Nonzero value for movie files
|
||||
* - ``oiio:subimages``
|
||||
- int
|
||||
- The number of frames in the movie, positive if it can be known
|
||||
without reading the entire file. Zero or not present if the number
|
||||
of frames cannot be determinend from reading from just the file
|
||||
header.
|
||||
* - ``FramesPerSecond``
|
||||
- int[2] (rational)
|
||||
- Frames per second
|
||||
@@ -877,7 +883,7 @@ OpenEXR
|
||||
|
||||
OpenEXR is an image file format developed by Industrial Light & Magic,
|
||||
and subsequently open-sourced. OpenEXR's strengths include support of
|
||||
high dynamic range imagery (``half`` and ``float`` pixels), tiled
|
||||
high dynamic range imagery (``half`` and `float` pixels), tiled
|
||||
images, explicit support of MIPmaps and cubic environment maps,
|
||||
arbitrary metadata, and arbitrary numbers of color channels. OpenEXR
|
||||
files use the file extension :file:`.exr`.
|
||||
@@ -903,6 +909,9 @@ The official OpenEXR site is http://www.openexr.com/.
|
||||
- matrix
|
||||
- worldToCamera
|
||||
* - ``worldtoscreen``
|
||||
- matrix
|
||||
- worldToScreen
|
||||
* - ``worldtoNDC``
|
||||
- matrix
|
||||
- worldToNDC
|
||||
* - ``ImageDescription``
|
||||
@@ -973,7 +982,7 @@ The official OpenEXR site is http://www.openexr.com/.
|
||||
**Configuration settings for OpenEXR input**
|
||||
|
||||
When opening an OpenEXR ImageInput with a *configuration* (see
|
||||
Section~\ref{sec:inputwithconfig}), the following special configuration
|
||||
Section :ref:`sec-inputwithconfig`), the following special configuration
|
||||
attributes are supported:
|
||||
|
||||
.. list-table::
|
||||
@@ -1024,7 +1033,7 @@ control aspects of the writing itself:
|
||||
|
||||
OpenEXR input and output both support the "custom I/O" feature via the
|
||||
special ``"oiio:ioproxy"`` attributes (see
|
||||
Sections~\ref{sec:imageoutput:ioproxy} and \ref{sec:imageinput:ioproxy}).
|
||||
Sections :ref:`sec-imageoutput-ioproxy` and :ref:`sec-imageinput-ioproxy`).
|
||||
|
||||
**A note on channel names**
|
||||
|
||||
@@ -1061,7 +1070,7 @@ does not write them.
|
||||
Volumes are comprised of multiple *layers* (which appear to OpenImageIO as
|
||||
subimages). Each layer/subimage may have a different name, resolution, and
|
||||
coordinate mapping. Layers may be scalar (1 channel) or vector (3 channel)
|
||||
fields, and the voxel data are always ``float``. OpenVDB files always
|
||||
fields, and the voxel data are always `float`. OpenVDB files always
|
||||
report as tiled, using the leaf dimension size.
|
||||
|
||||
.. list-table::
|
||||
@@ -1130,7 +1139,7 @@ files use the file extension :file:`.png`.
|
||||
- resolution and units from the PNG header.
|
||||
* - ``oiio:ColorSpace``
|
||||
- string
|
||||
- Color space (see Section `Color information metadata`_).
|
||||
- Color space (see Section :ref:`sec-metadata-color`).
|
||||
* - ``oiio:Gamma``
|
||||
- float
|
||||
- the gamma correction value (if specified).
|
||||
@@ -1141,7 +1150,7 @@ files use the file extension :file:`.png`.
|
||||
**Configuration settings for PNG input**
|
||||
|
||||
When opening an PNG ImageInput with a *configuration* (see
|
||||
Section~\ref{sec:inputwithconfig}), the following special configuration
|
||||
Section :ref:`sec-inputwithconfig`), the following special configuration
|
||||
attributes are supported:
|
||||
|
||||
.. list-table::
|
||||
@@ -1173,6 +1182,19 @@ control aspects of the writing itself:
|
||||
* - Output Configuration Attribute
|
||||
- Type
|
||||
- Meaning
|
||||
* - ``png:compressionLevel``
|
||||
- int
|
||||
- Compression level for zip/deflate compression, on a scale from 0
|
||||
(fastest, minimal compression) to 9 (slowest, maximal compression).
|
||||
The default is 6. PNG compression is always lossless.
|
||||
* - ``png:filter``
|
||||
- int
|
||||
- Controls the "row filters" that prepare the image for optimal
|
||||
compression. The default is 0 (``PNG_NO_FILTERS``), but other values
|
||||
(which may be "or-ed" or summed to combine their effects) are 8
|
||||
(``PNG_FILTER_NONE``), 16 (``PNG_FILTER_SUB``), 32
|
||||
(``PNG_FILTER_UP``), 64 (``PNG_FILTER_AVG``), or 128
|
||||
(``PNG_FILTER_PAETH``).
|
||||
* - ``oiio:ioproxy``
|
||||
- ptr
|
||||
- Pointer to a ``Filesystem::IOProxy`` that will handle the I/O, for
|
||||
@@ -1185,7 +1207,7 @@ control aspects of the writing itself:
|
||||
**Custom I/O Overrides**
|
||||
|
||||
PNG output supports the "custom I/O" feature via the special
|
||||
``"oiio:ioproxy"`` attributes (see Section~\ref{sec:imageoutput:ioproxy}).
|
||||
``"oiio:ioproxy"`` attributes (see Section :ref:`sec-imageoutput-ioproxy`).
|
||||
|
||||
**Limitations**
|
||||
|
||||
@@ -1261,7 +1283,7 @@ write PSD files.
|
||||
**Configuration settings for PSD input**
|
||||
|
||||
When opening an ImageInput with a *configuration* (see
|
||||
Section~\ref{sec:inputwithconfig}), the following special configuration
|
||||
Section :ref:`sec-inputwithconfig`), the following special configuration
|
||||
options are supported:
|
||||
|
||||
.. list-table::
|
||||
@@ -1337,7 +1359,7 @@ plugin that is based on the LibRaw library (http://www.libraw.org/).
|
||||
**Configuration settings for RAW input**
|
||||
|
||||
When opening an ImageInput with a *configuration* (see
|
||||
Section~\ref{sec:inputwithconfig}), the following special configuration
|
||||
Section :ref:`sec-inputwithconfig`), the following special configuration
|
||||
options are supported:
|
||||
|
||||
.. list-table::
|
||||
@@ -1370,6 +1392,13 @@ options are supported:
|
||||
decoding the raw image. The default (1,1) means to perform no
|
||||
correction. This is an overall spatial scale, sensible values will be
|
||||
very close to 1.0.
|
||||
* - ``raw:half_size``
|
||||
- int
|
||||
- If nonzero, outputs the image in half size. (Default: 0)
|
||||
* - ``raw:user_mul``
|
||||
- float[4]
|
||||
- Sets user white balance coefficients. Only applies if ``raw:use_camera_wb``
|
||||
is not equal to 0.
|
||||
* - ``raw:ColorSpace``
|
||||
- string
|
||||
- Which color primaries to use: ``raw``, ``sRGB``, ``Adobe``, ``Wide``,
|
||||
@@ -1476,7 +1505,7 @@ software developed at Wavefront. RLA files commonly use the file extension
|
||||
- white point XY (vec2) or XYZ (vec3) coordinates.
|
||||
* - ``oiio:ColorSpace``
|
||||
- string
|
||||
- Color space (see Section `Color information metadata`_).
|
||||
- Color space (see Section :ref:`sec-metadata-color`).
|
||||
* - ``oiio:Gamma``
|
||||
- float
|
||||
- the gamma correction value (if specified).
|
||||
@@ -1499,7 +1528,7 @@ SGI
|
||||
|
||||
The SGI image format was a simple raster format used long ago on SGI
|
||||
machines. SGI files use the file extensions ``sgi``, ``rgb``, ``rgba``,
|
||||
``bw``, ``int``, and ``inta``.
|
||||
``bw``, `int`, and ``inta``.
|
||||
|
||||
The SGI format is sometimes used for legacy apps, but has little merit
|
||||
otherwise: no support for tiles, no MIPmaps, no multi-subimage, only 8- and
|
||||
@@ -1610,7 +1639,7 @@ http://www.dca.fee.unicamp.br/~martino/disciplinas/ea978/tgaffs.pdf
|
||||
- the true bits per sample of the PIC file.
|
||||
* - ``oiio:ColorSpace``
|
||||
- string
|
||||
- Color space (see Section `Color information metadata`_).
|
||||
- Color space (see Section :ref:`sec-metadata-color`).
|
||||
* - ``oiio:Gamma``
|
||||
- float
|
||||
- the gamma correction value (if specified).
|
||||
@@ -1636,6 +1665,64 @@ is the total number of channel samples in the thumbnail).
|
||||
than 4 color channels.
|
||||
|
||||
|
||||
|
|
||||
|
||||
.. _sec-bundledplugins-term:
|
||||
|
||||
Term (Terminal)
|
||||
===============================================
|
||||
|
||||
This *experimental* output-only "format" is actually a procedural output
|
||||
that writes a low-res representation of the image to the console output. It
|
||||
requires a terminal application that supports Unicode and 24 bit color
|
||||
extensions.
|
||||
|
||||
The `term` ImageOutput supports the following special metadata tokens to
|
||||
control aspects of the writing itself:
|
||||
|
||||
.. list-table::
|
||||
:widths: 30 10 65
|
||||
:header-rows: 1
|
||||
|
||||
* - Output Configuration Attribute
|
||||
- Type
|
||||
- Meaning
|
||||
* - ``term:method``
|
||||
- string
|
||||
- May be one of `iterm2`, `24bit` (default), `24bit-space`, `256color`,
|
||||
or `dither`.
|
||||
* - ``term:fit``
|
||||
- int
|
||||
- If 1 (the default), the image will be resized to fit on the console
|
||||
window.
|
||||
|
||||
|
||||
|
||||
The `iterm2` mode is the best quality and is the default mode when actually
|
||||
running on a Mac and launching using iTerm2 as the terminal. This mode uses
|
||||
iTerm2's nonstandard extension to directly output an pixel array to be
|
||||
visible in the terminal.
|
||||
|
||||
The default in other circumstances is the `24bit` mode, which displays two
|
||||
approximately square pixels vertically in each character cell, by outputting
|
||||
the Unicode "upper half block" glyph (`\u2508`) with the foreground color
|
||||
set to the top pixel's color and the background color set to the bottom
|
||||
pixel's color.
|
||||
|
||||
If this doesn't look right, or your terminal doesn't support Unicode,
|
||||
the `24bit-space` is an alternate mode that displays one elongated pixel
|
||||
in each character cell, writing a space character with the correct color.
|
||||
|
||||
There's also a `256color` method that just uses the 6x6x6 color space in the
|
||||
256 color palette -- which looks horrible -- and an experimental `dither`
|
||||
which does a half-assed Floyd-Steinberg dithering, horizontally only, and
|
||||
frankly is not an improvement unless you squint really hard. These may
|
||||
change or be eliminted in the future.
|
||||
|
||||
In all cases, the image will automatically be resized to fit in the terminal
|
||||
and keep approximately the correct aspect ratio, as well as converted to
|
||||
sRGB so it looks kinda ok.
|
||||
|
||||
|
|
||||
|
||||
.. _sec-bundledplugins-tiff:
|
||||
@@ -1677,7 +1764,7 @@ metadata if present.
|
||||
**Configuration settings for TIFF input**
|
||||
|
||||
When opening an ImageInput with a *configuration* (see
|
||||
Section~\ref{sec:inputwithconfig}), the following special configuration
|
||||
Section :ref:`sec-inputwithconfig`), the following special configuration
|
||||
options are supported:
|
||||
|
||||
.. list-table::
|
||||
@@ -1725,7 +1812,7 @@ aspects of the writing itself:
|
||||
is 1.)
|
||||
* - ``tiff:half``
|
||||
- int
|
||||
- If nonzero, allow writing TIFF files with `half' (16 bit float)
|
||||
- If nonzero, allow writing TIFF files with `half` (16 bit float)
|
||||
pixels. The default of 0 will automatically translate to float
|
||||
pixels, since most non-OIIO applications will not properly read half
|
||||
TIFF files despite their being legal.
|
||||
@@ -1901,10 +1988,10 @@ aware of:
|
||||
- SubfileType
|
||||
* - ``Exif:*``
|
||||
-
|
||||
- A wide variety of EXIF data are honored, and are all prefixed with ``Exif:}.
|
||||
- A wide variety of EXIF data are honored, and are all prefixed with `Exif`.
|
||||
* - ``oiio:BitsPerSample``
|
||||
- int
|
||||
- The actual bits per sample in the file (may differ from {\cf ImageSpec::format}).
|
||||
- The actual bits per sample in the file (may differ from `ImageSpec::format`).
|
||||
* - ``oiio:UnassociatedAlpha``
|
||||
- int
|
||||
- Nonzero if the alpha channel contained "unassociated" alpha.
|
||||
|
||||
+53
-10
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
@@ -14,23 +16,44 @@
|
||||
# import sys
|
||||
# sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
from __future__ import absolute_import
|
||||
import sys
|
||||
import os
|
||||
import shlex
|
||||
import subprocess
|
||||
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
default_role = 'code'
|
||||
|
||||
project = 'OpenImageIO'
|
||||
copyright = 'Contributors to OpenImageIO'
|
||||
copyright = '2008-present, Contributors to OpenImageIO'
|
||||
author = 'Larry Gritz'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
version = '2.1'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '2.1.1'
|
||||
|
||||
# LG addition: we search for it in the CMakeLists.txt so we don't need to
|
||||
# keep modifying this file:
|
||||
version = '0.0'
|
||||
release = '0.0.0'
|
||||
import re
|
||||
version_regex = re.compile(r'project .* VERSION ((\d+\.\d+)\.\d+)')
|
||||
f = open('../../CMakeLists.txt')
|
||||
for l in f:
|
||||
aa=re.search(version_regex, l)
|
||||
if aa is not None:
|
||||
release = aa.group(1)
|
||||
version = aa.group(2)
|
||||
break
|
||||
f.close()
|
||||
print ("OIIO docs version = {}, release = {}".format(version, release))
|
||||
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
@@ -38,13 +61,19 @@ release = '2.1.1'
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
|
||||
# add custom extensions directory to python path
|
||||
sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), 'extensions/sphinxtr'))
|
||||
sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), '../../ext/breathe'))
|
||||
#import html_mods
|
||||
#import latex_mods
|
||||
|
||||
extensions = [
|
||||
#'sphinx.ext.pngmath',
|
||||
#'sphinx.ext.todo',
|
||||
'breathe' ]
|
||||
'breathe',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
templates_path = ['templates']
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
@@ -57,7 +86,8 @@ exclude_patterns = []
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
# html_theme = 'alabaster'
|
||||
#html_theme = 'alabaster'
|
||||
#html_theme = 'astropy-sphinx-theme'
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
@@ -70,6 +100,19 @@ html_static_path = ['_static']
|
||||
breathe_projects = { "oiio": "../../build/doxygen/xml" }
|
||||
breathe_default_project = "oiio"
|
||||
breathe_domain_by_extension = {'h': 'cpp'}
|
||||
breathe_default_members = ()
|
||||
primary_domain = 'cpp'
|
||||
highlight_language = 'cpp'
|
||||
|
||||
|
||||
read_the_docs_build = os.getenv('READTHEDOCS') == 'True'
|
||||
|
||||
if read_the_docs_build:
|
||||
print ("cwd =", os.getcwd())
|
||||
print ("checkpoint -- rtd build")
|
||||
if not os.path.exists('../../build/doxygen') :
|
||||
os.makedirs ('../../build/doxygen')
|
||||
print ("checkpoint 2 -- rtd build")
|
||||
subprocess.call('echo "Calling Doxygen"', shell=True)
|
||||
subprocess.call(['doxygen'], shell=True)
|
||||
subprocess.call('echo "Ran Doxygen"', shell=True)
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
:orphan:
|
||||
|
||||
.. only:: not latex
|
||||
|
||||
Copyright Notice
|
||||
----------------
|
||||
|
||||
|
||||
The code that implements OpenImageIO is licensed under the BSD 3-clause
|
||||
(also sometimes known as "new BSD" or "modified BSD") license
|
||||
(https://github.com/OpenImageIO/oiio/blob/master/LICENSE.md):
|
||||
|
||||
|
|
||||
|
||||
.. include:: ../../LICENSE.md
|
||||
|
||||
|
||||
|
|
||||
|
||||
This manual and other text documentation about OpenImageIO
|
||||
are licensed under the Creative Commons Attribution 3.0
|
||||
Unported License.
|
||||
|
||||
.. image:: figures/CC-30BY.png
|
||||
|
||||
http://creativecommons.org/licenses/by/3.0/
|
||||
|
||||
|
|
||||
|
||||
OpenImageIO incorporates code from several other software packages with
|
||||
compatible licenses. Copies of their licenses are reproduced here:
|
||||
https://github.com/OpenImageIO/oiio/blob/master/LICENSE-THIRD-PARTY.md
|
||||
+1
-2
@@ -8,8 +8,7 @@ documentation are:
|
||||
|
||||
\vspace*{0.2in}
|
||||
|
||||
\noindent Copyright (c) 2008-2019 Larry Gritz, et al.
|
||||
All Rights Reserved.
|
||||
\noindent Copyright \textcopyright\ Contributors to the OpenImageIO project.
|
||||
|
||||
\vspace{0.5in}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user