forked from VictorYudin/saturn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
1662 lines (1557 loc) · 73.5 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (C) 2017 Victor Yudin - All Rights Reserved
#
# This is the build recipe for Pixar USD and its dependencies.
#
# ..\..\..\lib\cmake\bin\cmake.exe --build . --target install --config Debug
# set PATH=C:\Temp\saturn-build\jom\bin;%PATH%
# make MAKE_MODE=debug BOOST_LINK=shared CRT_LINKAGE=shared usd
# make BOOST_LINK=shared llvm_EXTERNAL=C:/usr/llvm usd
# make llvm_EXTERNAL=C:/usr/llvm usd
#
# linux:
# make SOURCES_ROOT=/home/victor/src BUILD_ROOT=/tmp/build PREFIX_ROOT=/home/victor/usr/saturn
SOURCES_ROOT=./src
BUILD_ROOT=./build
PREFIX_ROOT=./lib
ifeq "$(OS)" "Windows_NT"
CURRENT_OS := windows
else
CURRENT_OS := linux
endif
ABSOLUTE_SOURCES_ROOT := $(abspath $(SOURCES_ROOT))
ABSOLUTE_BUILD_ROOT := $(abspath $(BUILD_ROOT))
ABSOLUTE_PREFIX_ROOT := $(abspath $(PREFIX_ROOT))
ifeq "$(CURRENT_OS)" "windows"
WINDOWS_SOURCES_ROOT := $(shell cygpath -w $(ABSOLUTE_SOURCES_ROOT))
WINDOWS_BUILD_ROOT := $(shell cygpath -w $(ABSOLUTE_BUILD_ROOT))
WINDOWS_PREFIX_ROOT := $(subst \,/,$(shell cygpath -w $(ABSOLUTE_PREFIX_ROOT)))
WIN_SDK :=\
$(shell cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432Node/Microsoft/Microsoft\ SDKs/Windows/v10.0/ProductVersion)
else
WINDOWS_SOURCES_ROOT := $(ABSOLUTE_SOURCES_ROOT)
WINDOWS_BUILD_ROOT := $(ABSOLUTE_BUILD_ROOT)
WINDOWS_PREFIX_ROOT := $(ABSOLUTE_PREFIX_ROOT)
endif
MAKE_MODE := release
CRT_LINKAGE := static
ifeq "$(MAKE_MODE)" "debug"
CMAKE_BUILD_TYPE := Debug
else
ifeq "$(CURRENT_OS)" "windows"
CMAKE_BUILD_TYPE := MinSizeRel
else
CMAKE_BUILD_TYPE := Release
endif
endif
# Save the current directory
THIS_DIR := $(shell pwd)
TOP_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
ifeq "$(CURRENT_OS)" "windows"
WINDOWS_THIS_DIR := $(shell cygpath -w $(THIS_DIR))
else
WINDOWS_THIS_DIR := $(THIS_DIR)
endif
define PACKAGE_VARS =
ifeq "$($(1)_EXTERNAL)" ""
$(1)_VERSION := $(2)
$(1)_VERSION_FILE := $(ABSOLUTE_PREFIX_ROOT)/built_$(1)
$(1)_PREFIX := $(WINDOWS_PREFIX_ROOT)/$(1)
$(1)_UNIX_PREFIX := $(ABSOLUTE_PREFIX_ROOT)/$(1)
$(1)_SOURCE := $(3)
$(1)_FILE := $(ABSOLUTE_SOURCES_ROOT)/$$(notdir $$($(1)_SOURCE))
$(1): $$($(1)_VERSION_FILE)
$(1)-archive: $(1)-$$($(1)_VERSION).tar.xz
$(1)-$$($(1)_VERSION).tar.xz: $$($(1)_VERSION_FILE)
@echo Archiving $$@ && \
tar cfJ $$@ -C $(ABSOLUTE_PREFIX_ROOT) $(1)
else
$(1)_PREFIX := $($(1)_EXTERNAL)
$(1)_UNIX_PREFIX := $$(shell cygpath -u $$($(1)_PREFIX))
endif
endef
define GIT_DOWNLOAD =
$(call PACKAGE_VARS,$(1),$(2),$(3))
$$($(1)_FILE)/HEAD :
ifeq "$$(CURRENT_OS)" "windows"
@mkdir -p $(ABSOLUTE_SOURCES_ROOT) && \
echo Downloading $$($(1)_FILE)... && \
git clone -q --bare $$($(1)_SOURCE) `cygpath -w $$($(1)_FILE)`
else
@mkdir -p $(ABSOLUTE_SOURCES_ROOT) && \
echo Downloading $$($(1)_FILE)... && \
git clone -q --bare $$($(1)_SOURCE) $$($(1)_FILE)
endif
endef
define CURL_DOWNLOAD =
$(call PACKAGE_VARS,$(1),$(2),$(3))
$$($(1)_FILE) :
ifeq "$$(CURRENT_OS)" "windows"
@mkdir -p $(ABSOLUTE_SOURCES_ROOT) && \
echo Downloading $$($(1)_FILE)... && \
curl --tlsv1.2 --retry-connrefused --retry 20 -s -o $$@ -L $$($(1)_SOURCE)
else
@mkdir -p $(ABSOLUTE_SOURCES_ROOT) && \
echo Downloading $$($(1)_FILE)... && \
curl --tlsv1.2 -s -o $$@ -L $$($(1)_SOURCE)
endif
endef
define PYPI_INSTALL =
$(call CURL_DOWNLOAD,$(1),$(2),$(3))
$$($(1)_VERSION_FILE) : $$($(1)_FILE)
@echo Building $(1) $$($(1)_VERSION) && \
mkdir -p $$(ABSOLUTE_BUILD_ROOT) && cd $$(ABSOLUTE_BUILD_ROOT) && \
rm -rf $$(notdir $$(basename $$(basename $$($(1)_FILE)))) && \
tar -xf $$($(1)_FILE) && \
cd $$(notdir $$(basename $$(basename $$($(1)_FILE)))) && \
mkdir -p $$(ABSOLUTE_PREFIX_ROOT) && \
$$(PYTHON_BIN) setup.py \
install_lib \
--install-dir=$$($(1)_PREFIX)/python > $$(ABSOLUTE_PREFIX_ROOT)/log_$(1).txt 2>&1 && \
cd $$(THIS_DIR) && \
echo $$($(1)_VERSION) > $$@
endef
define QT_DOWNLOAD =
$(call GIT_DOWNLOAD,$(1),$(2),$(3))
$$($(1)_VERSION_FILE) : $$($(4)_VERSION_FILE) $$($(1)_FILE)/HEAD
@echo Building Qt5 $(1) $$($(1)_VERSION) && \
mkdir -p $$(ABSOLUTE_BUILD_ROOT) && cd $$(ABSOLUTE_BUILD_ROOT) && \
rm -rf $$(notdir $$(basename $$($(1)_FILE))) && \
git clone -q --no-checkout "$$(WINDOWS_SOURCES_ROOT)/$$(notdir $$($(1)_FILE))" $$(notdir $$(basename $$($(1)_FILE))) && \
cd $$(notdir $$(basename $$($(1)_FILE))) && \
git checkout -q $$($(1)_VERSION) && \
export PATH=$$(ABSOLUTE_PREFIX_ROOT)/perl/bin:$$(PYTHON_ABSOLUTE):$$$$PATH && \
$$(ABSOLUTE_PREFIX_ROOT)/qt5base/bin/qmake > $$(ABSOLUTE_PREFIX_ROOT)/log_$(1).txt 2>&1 && \
$$(NMAKE) $$(MAKE_FLAGS) >> $$(ABSOLUTE_PREFIX_ROOT)/log_$(1).txt 2>&1 && \
$$(NMAKE) install >> $$(ABSOLUTE_PREFIX_ROOT)/log_$(1).txt 2>&1 && \
cd $$(THIS_DIR) && \
echo $$($(1)_VERSION) > $$@
endef
QT_VERSION := v5.11.2
ifeq "$(CURRENT_OS)" "windows"
$(eval $(call CURL_DOWNLOAD,cmake,3.9.1,https://cmake.org/files/v$$(word 1,$$(subst ., ,$$(cmake_VERSION))).$$(word 2,$$(subst ., ,$$(cmake_VERSION)))/cmake-$$(cmake_VERSION)-win64-x64.zip))
else
$(eval $(call CURL_DOWNLOAD,cmake,3.9.1,https://cmake.org/files/v$$(word 1,$$(subst ., ,$$(cmake_VERSION))).$$(word 2,$$(subst ., ,$$(cmake_VERSION)))/cmake-$$(cmake_VERSION).tar.gz))
endif
$(eval $(call CURL_DOWNLOAD,boost,1_61_0,http://sourceforge.net/projects/boost/files/boost/$$(subst _,.,$$(boost_VERSION))/boost_$$(boost_VERSION).tar.gz))
$(eval $(call CURL_DOWNLOAD,cfe,8.0.0,http://releases.llvm.org/$$(cfe_VERSION)/cfe-$$(cfe_VERSION).src.tar.xz))
$(eval $(call CURL_DOWNLOAD,clangtoolsextra,8.0.0,http://releases.llvm.org/$$(clangtoolsextra_VERSION)/clang-tools-extra-$$(clangtoolsextra_VERSION).src.tar.xz))
$(eval $(call CURL_DOWNLOAD,compilerrt,8.0.0,http://releases.llvm.org/$$(compilerrt_VERSION)/compiler-rt-$$(compilerrt_VERSION).src.tar.xz))
$(eval $(call CURL_DOWNLOAD,freetype,2.8,http://download.savannah.gnu.org/releases/freetype/freetype-$$(freetype_VERSION).tar.gz))
$(eval $(call CURL_DOWNLOAD,glew,2.0.0,https://sourceforge.net/projects/glew/files/glew/$$(glew_VERSION)/glew-$$(glew_VERSION).tgz))
$(eval $(call CURL_DOWNLOAD,glut,3.0.0,https://sourceforge.net/projects/freeglut/files/freeglut/$$(glut_VERSION)/freeglut-$$(glut_VERSION).tar.gz))
$(eval $(call CURL_DOWNLOAD,hdf5,1.8.10,https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-$$(word 1,$$(subst ., ,$$(hdf5_VERSION))).$$(word 2,$$(subst ., ,$$(hdf5_VERSION)))/hdf5-$$(hdf5_VERSION)/src/hdf5-$$(hdf5_VERSION).tar.gz))
$(eval $(call CURL_DOWNLOAD,ilmbase,2.2.0,http://download.savannah.nongnu.org/releases/openexr/ilmbase-$$(ilmbase_VERSION).tar.gz))
$(eval $(call CURL_DOWNLOAD,llvm,8.0.0,http://releases.llvm.org/$$(llvm_VERSION)/llvm-$$(llvm_VERSION).src.tar.xz))
$(eval $(call CURL_DOWNLOAD,openexr,2.2.0,http://download.savannah.nongnu.org/releases/openexr/openexr-$$(openexr_VERSION).tar.gz))
$(eval $(call CURL_DOWNLOAD,perl,5.26.1,http://www.cpan.org/src/5.0/perl-$$(perl_VERSION).tar.gz))
$(eval $(call CURL_DOWNLOAD,png,1.6.34,https://sourceforge.net/projects/libpng/files/libpng16/$$(png_VERSION)/libpng-$$(png_VERSION).tar.gz))
$(eval $(call CURL_DOWNLOAD,tbb,2017_20161128oss,https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb$$(tbb_VERSION)_src.tgz))
$(eval $(call CURL_DOWNLOAD,tiff,4.0.10,http://download.osgeo.org/libtiff/tiff-$$(tiff_VERSION).tar.gz))
$(eval $(call GIT_DOWNLOAD,alembic,1.7.10,git://github.com/alembic/alembic.git))
$(eval $(call GIT_DOWNLOAD,cppzmq,v4.3.0,git://github.com/zeromq/cppzmq.git))
$(eval $(call GIT_DOWNLOAD,embree,v2.17.1,git://github.com/embree/embree.git))
$(eval $(call GIT_DOWNLOAD,ffmpeg,n4.1,git://github.com/FFmpeg/FFmpeg.git))
$(eval $(call GIT_DOWNLOAD,glfw,3.2.1,git://github.com/glfw/glfw.git))
$(eval $(call GIT_DOWNLOAD,jom,v1.1.2,git://github.com/qt-labs/jom.git))
$(eval $(call GIT_DOWNLOAD,jpeg,1.5.1,git://github.com/libjpeg-turbo/libjpeg-turbo.git))
$(eval $(call GIT_DOWNLOAD,jsoncpp,1.8.0,git://github.com/open-source-parsers/jsoncpp.git))
$(eval $(call GIT_DOWNLOAD,materialx,v1.36.0,git://github.com/materialx/MaterialX.git))
$(eval $(call GIT_DOWNLOAD,oiio,Release-2.0.6,git://github.com/OpenImageIO/oiio.git))
$(eval $(call GIT_DOWNLOAD,opensubd,v3_2_0,git://github.com/PixarAnimationStudios/OpenSubdiv.git))
$(eval $(call GIT_DOWNLOAD,osl,Release-1.10.3,git://github.com/imageworks/OpenShadingLanguage.git))
$(eval $(call GIT_DOWNLOAD,ptex,v2.3.0,git://github.com/wdas/ptex.git))
$(eval $(call GIT_DOWNLOAD,pyside,${QT_VERSION},git://code.qt.io/pyside/pyside-setup.git))
$(eval $(call GIT_DOWNLOAD,pysidetools,${QT_VERSION},git://code.qt.io/pyside/pyside-tools.git))
$(eval $(call GIT_DOWNLOAD,qt5base,${QT_VERSION},git://github.com/qt/qtbase.git))
$(eval $(call GIT_DOWNLOAD,usd,v19.05,git://github.com/PixarAnimationStudios/USD.git))
$(eval $(call GIT_DOWNLOAD,x264,master,http://git.videolan.org/git/x264.git))
$(eval $(call GIT_DOWNLOAD,zlib,v1.2.8,git://github.com/madler/zlib.git))
$(eval $(call GIT_DOWNLOAD,zmq,v4.3.0,git://github.com/zeromq/libzmq.git))
$(eval $(call PYPI_INSTALL,PyOpenGL,3.1.1,https://files.pythonhosted.org/packages/9c/1d/4544708aaa89f26c97cc09450bb333a23724a320923e74d73e028b3560f9/PyOpenGL-3.1.0.tar.gz))
$(eval $(call QT_DOWNLOAD,qt5creator,v4.5.1,git://github.com/qt-creator/qt-creator.git,qt5base))
$(eval $(call QT_DOWNLOAD,qt5declarative,${QT_VERSION},git://github.com/qt/qtdeclarative.git,qt5base))
$(eval $(call QT_DOWNLOAD,qt5graphicaleffects,${QT_VERSION},git://github.com/qt/qtgraphicaleffects.git,qt5declarative))
$(eval $(call QT_DOWNLOAD,qt5multimedia,${QT_VERSION},git://github.com/qt/qtmultimedia.git,qt5declarative))
$(eval $(call QT_DOWNLOAD,qt5qtxmlpatterns,${QT_VERSION},git://github.com/qt/qtxmlpatterns.git,qt5base))
$(eval $(call QT_DOWNLOAD,qt5quickcontrols,${QT_VERSION},https://github.com/qt/qtquickcontrols2,qt5declarative))
$(eval $(call QT_DOWNLOAD,qt5tools,${QT_VERSION},git://github.com/qt/qttools.git,qt5base))
$(eval $(call QT_DOWNLOAD,qt5webglplugin,${QT_VERSION},git://github.com/qt/qtwebglplugin.git,qt5websockets))
$(eval $(call QT_DOWNLOAD,qt5websockets,${QT_VERSION},git://github.com/qt/qtwebsockets.git,qt5qtxmlpatterns))
# Number or processors
JOB_COUNT := $(shell cat /proc/cpuinfo | grep processor | wc -l)
ifeq "$(CURRENT_OS)" "windows"
CC := $(shell where cl)
CXX := $(shell where cl)
NOENV := env -u MAKE -u MAKEFLAGS
NMAKE := $(NOENV) jom
CMD := $(NOENV) cmd /C
STATICLIB_EXT := .lib
DYNAMICLIB_EXT := .dll
BAT_EXT := .bat
# PySide2 on windows should be preinstalled
pyside_VERSION_FILE :=
pysidetools_VERSION_FILE :=
else
CC := gcc
CXX := g++
NMAKE := make
STATICLIB_EXT := .a
DYNAMICLIB_EXT := .so
endif
CMAKE := $(NOENV) $(cmake_PREFIX)/bin/cmake
BOOST_LINK := static
ifeq "$(BOOST_LINK)" "shared"
USE_STATIC_BOOST := OFF
BUILD_USD_MAYA_PLUGIN := ON
else
USE_STATIC_BOOST := ON
BUILD_USD_MAYA_PLUGIN := OFF
endif
DEFINES = -DBOOST_ALL_NO_LIB -DPTEX_STATIC
ifeq "$(BOOST_LINK)" "shared"
DEFINES += -DBOOST_ALL_DYN_LINK
else
DEFINES += -DBOOST_ALL_STATIC_LINK
endif
ifeq "$(CRT_LINKAGE)" "static"
CRT_FLAG := MT
STATIC_RUNTIME := ON
else
CRT_FLAG := MD
STATIC_RUNTIME := OFF
endif
ifeq "$(CURRENT_OS)" "windows"
ifeq "$(MAKE_MODE)" "debug"
FLAGS := /$(CRT_FLAG)d
else
FLAGS := /$(CRT_FLAG)
endif
else
FLAGS := -fPIC
MAKE_FLAGS := -j$(JOB_COUNT)
CMAKE_MAKE_FLAGS := -- $(MAKE_FLAGS)
endif
FLAGS += $(DEFINES)
COMMON_CMAKE_FLAGS :=\
-DCMAKE_BUILD_TYPE:STRING=$(CMAKE_BUILD_TYPE) \
-DCMAKE_CXX_FLAGS_DEBUG="$(FLAGS)" \
-DCMAKE_CXX_FLAGS_RELEASE="$(FLAGS)" \
-DCMAKE_CXX_FLAGS_MINSIZEREL="$(FLAGS)" \
-DCMAKE_C_FLAGS_DEBUG="$(FLAGS)" \
-DCMAKE_C_FLAGS_RELEASE="$(FLAGS)" \
-DCMAKE_C_FLAGS_MINSIZEREL="$(FLAGS)" \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
ifeq "$(CURRENT_OS)" "windows"
COMMON_CMAKE_FLAGS += -G "NMake Makefiles JOM"
else
COMMON_CMAKE_FLAGS += -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--no-undefined
endif
COMPILER_CONF :=\
CC="$(CC)" \
CXX="$(CXX)" \
CFLAGS="$(FLAGS)" \
CXXFLAGS="$(FLAGS)"
all: usd-archive
qtquick: qt5graphicaleffects qt5quickcontrols qt5multimedia
qtextras: qt5declarative qt5graphicaleffects qt5quickcontrols qt5tools qt5multimedia
.PHONY : all
.DEFAULT_GOAL := all
ifeq "$(CURRENT_OS)" "windows"
PYTHON_BIN := C:/Python27/python.exe
PYTHON_ROOT := $(subst \,,$(dir $(PYTHON_BIN)))
PYTHON_ABSOLUTE := $(shell cygpath -u $(PYTHON_ROOT))
PYTHON_BIN := $(subst \,,$(PYTHON_BIN))
PYTHON_INCLUDE := $(PYTHON_ROOT)include
PYTHON_LIBS := $(PYTHON_ROOT)libs
else
PYTHON_BIN := $(shell which python)
PYTHON_INCLUDE := $(shell $(PYTHON_BIN) -c "import sysconfig; print sysconfig.get_paths()['include']")
PYTHON_LIBS := $(shell $(PYTHON_BIN) -c "import sysconfig; print sysconfig.get_paths()['stdlib']")/..
endif
PYTHON_VERSION_SHORT := 2.7
ifeq "$(BOOST_VERSION)" "1_55_0"
BOOST_USERCONFIG := tools/build/v2/user-config.jam
else
BOOST_USERCONFIG := tools/build/src/user-config.jam
endif
ifeq "$(CURRENT_OS)" "windows"
BOOST_PLATFORM_FLAGS := runtime-link=$(CRT_LINKAGE) toolset=msvc-14.1
else
BOOST_PLATFORM_FLAGS := cflags="$(FLAGS)" cxxflags="$(FLAGS)" toolset=gcc-4.8
endif
$(boost_VERSION_FILE) : $(boost_FILE)
@echo Building boost $(boost_VERSION) link=$(BOOST_LINK) runtime-link=$(CRT_LINKAGE) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(BUILD_ROOT) && \
rm -rf boost_$(boost_VERSION) && \
tar -xf $(ABSOLUTE_SOURCES_ROOT)/boost_$(boost_VERSION).tar.gz && \
cd boost_$(boost_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
( test ! $(CURRENT_OS) == linux || echo 'using gcc : 4.8 : "$(CXX)" ;' >> $(BOOST_USERCONFIG) ) && \
( test ! $(CURRENT_OS) == windows || echo 'using msvc : 14.1 : "$(CXX)" ;' >> $(BOOST_USERCONFIG) ) && \
echo 'using python : $(PYTHON_VERSION_SHORT) : "$(PYTHON_BIN)" : "$(PYTHON_INCLUDE)" : "$(PYTHON_LIBS)" ;' >> $(BOOST_USERCONFIG) && \
( test ! $(CRT_LINKAGE) == static || printf '/handle-static-runtime/\n/EXIT/d\nw\nq' | ed -s Jamroot ) && \
( test ! $(BOOST_LINK) == static || printf '/BOOST_PYTHON_STATIC_LIB/s/BOOST_PYTHON_STATIC_LIB/disabled_PYTHON_STATIC_LIB/\nw\nq' | ed -s libs/python/build/Jamfile.v2 ) && \
( test ! $(BOOST_LINK) == static || printf '/BOOST_PYTHON_STATIC_LIB/s/BOOST_PYTHON_STATIC_LIB/disabled_PYTHON_STATIC_LIB/\nw\nq' | ed -s libs/python/build/Jamfile.v2 ) && \
( test ! $(CURRENT_OS) == windows || \
cmd /C bootstrap.bat msvc > $(ABSOLUTE_PREFIX_ROOT)/log_boost.txt 2>&1 ) && \
( test ! $(CURRENT_OS) == linux || \
$(COMPILER_CONF) TOOLSET=cc \
./bootstrap.sh > $(ABSOLUTE_PREFIX_ROOT)/log_boost.txt 2>&1 ) && \
echo Boost bootstrap is OK >> $(ABSOLUTE_PREFIX_ROOT)/log_boost.txt && \
./b2 \
--layout=system \
--prefix=$(boost_PREFIX) \
-d2 \
-j $(JOB_COUNT) \
-s NO_BZIP2=1 \
address-model=64 \
link=$(BOOST_LINK) \
threading=multi \
$(BOOST_PLATFORM_FLAGS) \
$(MAKE_MODE) \
stage \
install >> $(ABSOLUTE_PREFIX_ROOT)/log_boost.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(BOOST_VERSION) > $@
$(alembic_VERSION_FILE) : $(boost_VERSION_FILE) $(cmake_VERSION_FILE) $(ilmbase_VERSION_FILE) $(openexr_VERSION_FILE) $(zlib_VERSION_FILE) $(alembic_FILE)/HEAD
@echo Building Alembic $(alembic_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(alembic_FILE))) && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/$(notdir $(alembic_FILE))" $(notdir $(basename $(alembic_FILE))) && \
cd $(notdir $(basename $(alembic_FILE))) && \
git checkout -q $(alembic_VERSION) && \
( printf '/Werror/d\nw\nq' | ed -s CMakeLists.txt ) && \
( printf "/INSTALL/a\nFoundation.h\n.\nw\nq" | ed -s lib/Alembic/AbcCoreLayer/CMakeLists.txt ) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DALEMBIC_ILMBASE_LINK_STATIC:BOOL=ON \
-DALEMBIC_LIB_USES_BOOST:BOOL=ON \
-DALEMBIC_SHARED_LIBS:BOOL=OFF \
-DBOOST_ROOT:STRING="$(boost_PREFIX)" \
-DBoost_USE_STATIC_LIBS:BOOL=$(USE_STATIC_BOOST) \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX="$(alembic_PREFIX)" \
-DILMBASE_ROOT="$(ilmbase_PREFIX)" \
-DUSE_BOOSTREGEX:BOOL=ON \
-DUSE_HDF5:BOOL=OFF \
-DUSE_MAYA:BOOL=OFF \
-DUSE_STATIC_BOOST:BOOL=$(USE_STATIC_BOOST) \
-DUSE_TESTS:BOOL=OFF \
-DZLIB_ROOT:PATH="$(zlib_PREFIX)" \
. > $(ABSOLUTE_PREFIX_ROOT)/log_alembic.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_alembic.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(alembic_VERSION) > $@
#cppzmq
ifeq "$(CURRENT_OS)" "windows"
CPPZMQ_PLATFORM_FLAGS := -DZeroMQ_DIR="$(zmq_PREFIX)/CMake"
else
CPPZMQ_PLATFORM_FLAGS := -DZeroMQ_DIR="$(zmq_PREFIX)/share/cmake/ZeroMQ"
endif
$(cppzmq_VERSION_FILE) : $(cmake_VERSION_FILE) $(zmq_VERSION_FILE) $(cppzmq_FILE)/HEAD
@echo Building cppzmq $(cppzmq_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(cppzmq_FILE))) && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/$(notdir $(cppzmq_FILE))" $(notdir $(basename $(cppzmq_FILE))) && \
cd $(notdir $(basename $(cppzmq_FILE))) && \
git checkout -q $(cppzmq_VERSION) && \
( printf 'g/libzmq /s/libzmq /libzmq-static /g\nw\n' | ed -s CMakeLists.txt ) && \
( printf '/libzmq)/s/libzmq)/libzmq-static)/\nw\n' | ed -s CMakeLists.txt ) && \
mkdir -p build && cd build && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DCMAKE_INSTALL_PREFIX="$(cppzmq_PREFIX)" \
-DCPPZMQ_BUILD_TESTS=OFF \
-DENABLE_DRAFTS=OFF \
$(CPPZMQ_PLATFORM_FLAGS) \
.. > $(ABSOLUTE_PREFIX_ROOT)/log_cppzmq.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_cppzmq.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(cppzmq_VERSION) > $@
$(cmake_VERSION_FILE) : $(cmake_FILE)
ifeq "$(CURRENT_OS)" "windows"
@echo Unpacking cmake $(cmake_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf cmake-$(cmake_VERSION)-win64-x64 && \
rm -rf $(ABSOLUTE_PREFIX_ROOT)/cmake && \
unzip $(ABSOLUTE_SOURCES_ROOT)/cmake-$(cmake_VERSION)-win64-x64.zip > $(ABSOLUTE_PREFIX_ROOT)/log_cmake.txt 2>&1 && \
mv cmake-$(cmake_VERSION)-win64-x64 $(ABSOLUTE_PREFIX_ROOT)/cmake && \
chmod -R u+x $(ABSOLUTE_PREFIX_ROOT)/cmake/bin/*.exe && \
chmod -R u+x $(ABSOLUTE_PREFIX_ROOT)/cmake/bin/*.dll && \
cd $(THIS_DIR) && \
echo $(cmake_VERSION) > $@
else
@echo Building cmake $(cmake_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(cmake_FILE))) && \
tar -xf $(cmake_FILE) && \
cd $(notdir $(basename $(basename $(cmake_FILE)))) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(COMPILER_CONF) \
./configure \
--prefix="$(cmake_PREFIX)" \
--parallel=$(JOB_COUNT) \
--no-qt-gui \
--no-server \
--verbose > $(ABSOLUTE_PREFIX_ROOT)/log_cmake.txt 2>&1 && \
make -j$(JOB_COUNT) \
MAKE_MODE=$(MAKE_MODE) \
install >> $(ABSOLUTE_PREFIX_ROOT)/log_cmake.txt 2>&1 && \
cd .. && \
cd $(THIS_DIR) && \
echo $(cmake_VERSION) > $@
endif
$(freetype_VERSION_FILE) : $(cmake_VERSION_FILE) $(freetype_FILE)
@echo Building FreeType $(freetype_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(basename $(freetype_FILE)))) && \
tar -xf $(freetype_FILE) && \
cd $(notdir $(basename $(basename $(freetype_FILE)))) && \
mkdir -p build && cd build && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DCMAKE_INSTALL_PREFIX="$(freetype_PREFIX)" \
.. > $(ABSOLUTE_PREFIX_ROOT)/log_freetype.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_freetype.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(freetype_VERSION) > $@
#embree
$(embree_VERSION_FILE) : $(cmake_VERSION_FILE) $(glut_VERSION_FILE) $(tbb_VERSION_FILE) $(zlib_VERSION_FILE) $(embree_FILE)/HEAD
@echo Building embree $(embree_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf embree && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/$(notdir $(embree_FILE))" embree && \
cd embree && \
git checkout -q $(embree_VERSION) && \
( printf '/FIND_PACKAGE_HANDLE_STANDARD_ARGS/-\na\nSET(TBB_INCLUDE_DIR $(tbb_PREFIX)/include)\n.\nw\nq\n' | ed -s common/cmake/FindTBB.cmake ) && \
( printf '/FIND_PACKAGE_HANDLE_STANDARD_ARGS/-\na\nSET(TBB_LIBRARY $(tbb_PREFIX)/lib/tbb$(STATICLIB_EXT))\n.\nw\nq\n' | ed -s common/cmake/FindTBB.cmake ) && \
( test ! $(CURRENT_OS) == windows || printf '/FIND_PACKAGE_HANDLE_STANDARD_ARGS/-\na\nSET(TBB_LIBRARY_MALLOC $(tbb_PREFIX)/lib/tbbmalloc$(STATICLIB_EXT))\n.\nw\nq\n' | ed -s common/cmake/FindTBB.cmake ) && \
( printf '/INSTALL(PROGRAMS/d\nw\n' | ed -s common/cmake/FindTBB.cmake ) && \
( printf '/INSTALL(PROGRAMS/d\nw\n' | ed -s common/cmake/FindTBB.cmake ) && \
( printf 'g/WIN32/s/WIN32/0/g\nw\n' | ed -s tutorials/common/tutorial/CMakeLists.txt ) && \
( printf '/embree.rc/d\nw\n' | ed -s kernels/CMakeLists.txt ) && \
( printf '/embree.rc/d\nw\n' | ed -s kernels/CMakeLists.txt ) && \
( printf '/FLAGS_LOWEST/a\nmessage(victor \044{FLAGS_LOWEST})\n.\nw\n' | ed -s kernels/CMakeLists.txt ) && \
( printf 'set_target_properties(sys PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n' >> common/sys/CMakeLists.txt ) && \
( printf 'set_target_properties(algorithms PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n' >> common/algorithms/CMakeLists.txt ) && \
( printf 'set_target_properties(tasking PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n' >> common/tasking/CMakeLists.txt ) && \
( printf 'set_target_properties(image PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n' >> tutorials/common/image/CMakeLists.txt ) && \
( printf 'set_target_properties(scenegraph PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n' >> tutorials/common/scenegraph/CMakeLists.txt ) && \
( printf '/tutorial/a\nset_target_properties(tutorial PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n.\nw\n' | ed -s tutorials/common/tutorial/CMakeLists.txt ) && \
( printf '/tutorial_device/a\nset_target_properties(tutorial_device PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n.\nw\n' | ed -s tutorials/common/tutorial/CMakeLists.txt ) && \
( printf '/verify/a\nset_target_properties(verify PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n.\nw\n' | ed -s tutorials/verify/CMakeLists.txt ) && \
( printf '/SET_PROPERTY/a\nset_target_properties(\044{TUTORIAL_NAME} PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n.\nw\n' | ed -s common/cmake/tutorial.cmake ) && \
( printf '/bvh_access/a\nset_target_properties(bvh_access PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n.\nw\n' | ed -s tutorials/bvh_access/CMakeLists.txt ) && \
( printf '/convert/a\nset_target_properties(convert PROPERTIES COMPILE_FLAGS "\044{FLAGS_AVX2}")\n.\nw\n' | ed -s tutorials/convert/CMakeLists.txt ) && \
( printf '/define/a\n#define EMBREE_STATIC_LIB\n.\nw\n' | ed -s include/embree2/rtcore.h ) && \
rm -rf tutorials/common/freeglut && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DADDITIONAL_LIBRARIES:PATH=winmm.lib \
-DCMAKE_INSTALL_PREFIX="$(embree_PREFIX)" \
-DEMBREE_ISPC_SUPPORT:BOOL=OFF \
-DEMBREE_STATIC_LIB:BOOL=ON \
-DEMBREE_STATIC_RUNTIME:BOOL=$(STATIC_RUNTIME) \
-DEMBREE_TUTORIALS:BOOL=OFF \
-DGLUT_INCLUDE_DIR:PATH="$(glut_PREFIX)/include" \
-DGLUT_glut_LIBRARY:PATH="$(glut_PREFIX)/lib/freeglut_static.lib" \
-DTBB_INCLUDE_DIR="$(tbb_PREFIX)/include" \
-DTBB_LIBRARY="$(tbb_PREFIX)/lib/tbb$(TBB_SUFFIX).lib" \
-DTBB_LIBRARY_MALLOC="$(tbb_PREFIX)/lib/tbbmalloc.lib" \
. > $(ABSOLUTE_PREFIX_ROOT)/log_embree.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_embree.txt 2>&1 && \
( test ! $(CURRENT_OS) == windows || for i in embree_sse42 embree_avx embree_avx2 simd tasking lexers sys math; do cmd /C copy $$i$(STATICLIB_EXT) $(subst /,\\,$(embree_PREFIX)/lib); done ) && \
( test ! $(CURRENT_OS) == linux || for i in embree_sse42 embree_avx embree_avx2 simd tasking lexers sys math; do cp lib$$i$(STATICLIB_EXT) $(embree_PREFIX)/lib; done ) && \
cd $(THIS_DIR) && \
echo $(embree_VERSION) > $@
ifeq "$(CURRENT_OS)" "windows"
FFMPEG_PLATFORM_FLAGS := --enable-d3d11va --enable-dxva2 --target-os=win64 --toolchain=msvc --extra-ldflags="/NODEFAULTLIB:libcmt"
else
FFMPEG_PLATFORM_FLAGS :=
endif
ifeq "$(MAKE_MODE)" "debug"
FFMPEG_PLATFORM_FLAGS += --enable-debug
endif
$(ffmpeg_VERSION_FILE) : $(x264_VERSION_FILE) $(zlib_VERSION_FILE) $(ffmpeg_FILE)/HEAD
@echo Building ffmpeg $(ffmpeg_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(ffmpeg_FILE))) && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/$(notdir $(ffmpeg_FILE))" $(notdir $(basename $(ffmpeg_FILE))) && \
cd $(notdir $(basename $(ffmpeg_FILE))) && \
git config core.eol lf && \
git config core.autocrlf input && \
git checkout -qf $(ffmpeg_VERSION) && \
./configure --help > $(ABSOLUTE_PREFIX_ROOT)/log_ffmpeg.txt 2>&1 && \
echo Configure... >> $(ABSOLUTE_PREFIX_ROOT)/log_ffmpeg.txt 2>&1 && \
env PKG_CONFIG_PATH=$(x264_UNIX_PREFIX)/lib/pkgconfig:$(zlib_UNIX_PREFIX)/share/pkgconfig:$(zlib_UNIX_PREFIX)/lib/pkgconfig \
./configure \
--arch=x86_64 \
--enable-avisynth \
--enable-gpl \
--enable-libx264 \
--enable-version3 \
--enable-zlib \
--extra-cflags="$(FLAGS)" \
--prefix=$(ffmpeg_UNIX_PREFIX) \
$(FFMPEG_PLATFORM_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_ffmpeg.txt 2>&1 && \
echo Make... >> $(ABSOLUTE_PREFIX_ROOT)/log_ffmpeg.txt 2>&1 && \
make -j$(JOB_COUNT) >> $(ABSOLUTE_PREFIX_ROOT)/log_ffmpeg.txt 2>&1 && \
echo Install... >> $(ABSOLUTE_PREFIX_ROOT)/log_ffmpeg.txt 2>&1 && \
make install >> $(ABSOLUTE_PREFIX_ROOT)/log_ffmpeg.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(ffmpeg_VERSION) > $@
# glew
# Edits:
# - define GLEW_STATIC
# link glewinfo and visualinfo statically
$(glew_VERSION_FILE) : $(cmake_VERSION_FILE) $(glew_FILE)
@echo Building glew $(glew_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(glew_FILE))) && \
tar zxf $(ABSOLUTE_SOURCES_ROOT)/$(notdir $(glew_FILE)) && \
cd $(notdir $(basename $(glew_FILE))) && \
( printf "0a\n#define GLEW_STATIC\n.\nw\nq\n" | ed -s include/GL/glew.h ) && \
( printf "0a\n#define GLEW_STATIC\n.\nw\nq\n" | ed -s include/GL/wglew.h ) && \
( printf "/target_link_libraries.*glewinfo/s/glew)/glew_s)/\nw\nq" | ed -s build/cmake/CMakeLists.txt ) && \
( printf "/target_link_libraries.*visualinfo/s/glew)/glew_s)/\nw\nq" | ed -s build/cmake/CMakeLists.txt ) && \
( printf "/CMAKE_DEBUG_POSTFIX/d\nw\nq" | ed -s build/cmake/CMakeLists.txt ) && \
cd build && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DCMAKE_INSTALL_PREFIX="$(glew_PREFIX)" \
./cmake > $(ABSOLUTE_PREFIX_ROOT)/log_glew.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_glew.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(glew_VERSION) > $@
# glfw
$(glfw_VERSION_FILE) : $(cmake_VERSION_FILE) $(glfw_FILE)/HEAD
@echo Building glfw $(glfw_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(glfw_FILE))) && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/$(notdir $(glfw_FILE))" $(notdir $(basename $(glfw_FILE))) && \
cd $(notdir $(basename $(glfw_FILE))) && \
git checkout -q $(glfw_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DGLFW_BUILD_DOCS:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX="$(glfw_PREFIX)" \
-DZLIB_ROOT:PATH="$(zlib_PREFIX)" \
. > $(ABSOLUTE_PREFIX_ROOT)/log_glfw.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_glfw.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(glfw_VERSION) > $@
# glut
$(glut_VERSION_FILE) : $(cmake_VERSION_FILE) $(glut_FILE)
@echo Building glut $(glut_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(basename $(glut_FILE)))) && \
tar -xf $(ABSOLUTE_SOURCES_ROOT)/$(notdir $(glut_FILE)) && \
cd $(notdir $(basename $(basename $(glut_FILE)))) && \
( printf "2a\n#define FREEGLUT_STATIC\n.\nw\n" | ed -s include/GL/freeglut_std.h ) && \
( printf "2a\n#define FREEGLUT_LIB_PRAGMAS 0\n.\nw\n" | ed -s include/GL/freeglut_std.h ) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DCMAKE_INSTALL_PREFIX="$(glut_PREFIX)" \
-DFREEGLUT_BUILD_DEMOS:BOOL=OFF \
-DFREEGLUT_BUILD_SHARED_LIBS:BOOL=OFF \
-DINSTALL_PDB:BOOL=OFF \
. > $(ABSOLUTE_PREFIX_ROOT)/log_glut.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_glut.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(glut_VERSION) > $@
# HDF5
$(hdf5_VERSION_FILE) : $(cmake_VERSION_FILE) $(zlib_VERSION_FILE) $(hdf5_FILE)
@echo Building HDF5 $(hdf5_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf hdf5-$(hdf5_VERSION) && \
tar -xf $(ABSOLUTE_SOURCES_ROOT)/hdf5-$(hdf5_VERSION).tar.gz && \
cd hdf5-$(hdf5_VERSION) && \
( test $$CURRENT_OS != linux || if [ -f release_docs/USING_CMake.txt ] ; then cp release_docs/USING_CMake.txt release_docs/Using_CMake.txt ; fi ) && \
( if [ ! -f release_docs/USING_CMake.txt ] ; then touch release_docs/USING_CMake.txt ; fi ) && \
( if [ ! -f release_docs/Using_CMake.txt ] ; then touch release_docs/Using_CMake.txt ; fi ) && \
( printf '/H5_HAVE_TIMEZONE/s/1/0/\nw\nq' | ed -s config/cmake/ConfigureChecks.cmake ) && \
( test ! $(CRT_LINKAGE) == static || printf '/"\/MD"/s/MD/MT/\nw\nq' | ed -s config/cmake/HDFMacros.cmake ) && \
( printf '/HDF5_PRINTF_LL/s/(.*)/(HDF5_PRINTF_LL)/\nw\nq' | ed -s config/cmake/ConfigureChecks.cmake ) && \
mkdir build && cd build && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX="$(hdf5_PREFIX)" \
-DZLIB_ROOT:PATH="$(zlib_PREFIX)" \
-DZLIB_USE_EXTERNAL:BOOL=ON \
.. > $(ABSOLUTE_PREFIX_ROOT)/log_hdf5.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_hdf5.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(hdf5_VERSION) > $@
# jom
$(jom_VERSION_FILE) : $(cmake_VERSION_FILE) $(qt5base_VERSION_FILE) $(jom_FILE)/HEAD
@echo Building jom $(jom_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(jom_FILE))) && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/$(notdir $(jom_FILE))" $(notdir $(basename $(jom_FILE))) && \
cd $(notdir $(basename $(jom_FILE))) && \
git checkout -q $(jom_VERSION) && \
( printf "/target_link_libraries/s/)/ Winmm Mincore $(subst /,\/,$(qt5base_PREFIX))\/lib\/qtpcre2.lib)/\nw\n" | ed -s CMakeLists.txt ) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-G "NMake Makefiles" \
-DQt5Core_DIR:PATH="$(qt5base_PREFIX)/lib/cmake/Qt5Core" \
-DCMAKE_INSTALL_PREFIX="$(jom_PREFIX)" \
. > $(ABSOLUTE_PREFIX_ROOT)/log_jom.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_jom.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(jom_VERSION) > $@
# jpeg
$(jpeg_VERSION_FILE) : $(cmake_VERSION_FILE) $(jpeg_FILE)/HEAD
ifeq "$(CURRENT_OS)" "windows"
@echo Building jpeg $(jpeg_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf jpeg && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/libjpeg-turbo.git" jpeg && \
cd jpeg && \
git checkout -q $(jpeg_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DENABLE_SHARED:BOOL=OFF \
-DENABLE_STATIC:BOOL=ON \
-DCMAKE_INSTALL_PREFIX="$(jpeg_PREFIX)" \
. > $(ABSOLUTE_PREFIX_ROOT)/log_jpeg.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) >> $(ABSOLUTE_PREFIX_ROOT)/log_jpeg.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(jpeg_VERSION) > $@
else
@echo Building jpeg $(jpeg_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf jpeg && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/libjpeg-turbo.git" jpeg && \
cd jpeg && \
git checkout -q $(jpeg_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
autoreconf -fiv > $(ABSOLUTE_PREFIX_ROOT)/log_jpeg.txt 2>&1 && \
$(COMPILER_CONF) \
./configure \
--prefix="$(jpeg_PREFIX)" \
--enable-shared=no >> $(ABSOLUTE_PREFIX_ROOT)/log_jpeg.txt 2>&1 && \
make -j$(JOB_COUNT) \
MAKE_MODE=$(MAKE_MODE) \
install >> $(ABSOLUTE_PREFIX_ROOT)/log_jpeg.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(jpeg_VERSION) > $@
endif
# jsoncpp
$(jsoncpp_VERSION_FILE) : $(cmake_VERSION_FILE) $(zlib_VERSION_FILE) $(jsoncpp_FILE)/HEAD
@echo Building jsoncpp $(jsoncpp_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf jsoncpp && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/jsoncpp.git" jsoncpp && \
cd jsoncpp && \
git checkout -q $(jsoncpp_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DCMAKE_INSTALL_PREFIX="$(jsoncpp_PREFIX)" \
-DZLIB_ROOT:PATH="$(zlib_PREFIX)" \
. > $(ABSOLUTE_PREFIX_ROOT)/log_jsoncpp.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_jsoncpp.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(jsoncpp_VERSION) > $@
# MaterialX
$(materialx_VERSION_FILE) : $(cmake_VERSION_FILE) $(materialx_FILE)/HEAD
@echo Building MaterialX $(materialx_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf materialx && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/$(notdir $(materialx_FILE))" materialx && \
cd materialx && \
git checkout -q $(materialx_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DCMAKE_INSTALL_PREFIX="$(materialx_PREFIX)" \
. > $(ABSOLUTE_PREFIX_ROOT)/log_materialx.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_materialx.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(materialx_VERSION) > $@
$(ilmbase_VERSION_FILE) : $(cmake_VERSION_FILE) $(ilmbase_FILE)
@echo Building IlmBase $(ilmbase_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf ilmbase-$(ilmbase_VERSION) && \
tar -xf $(ABSOLUTE_SOURCES_ROOT)/ilmbase-$(ilmbase_VERSION).tar.gz && \
cd ilmbase-$(ilmbase_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX="$(ilmbase_PREFIX)" \
-DNAMESPACE_VERSIONING:BOOL=ON \
. > $(ABSOLUTE_PREFIX_ROOT)/log_ilmbase.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_ilmbase.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(ilmbase_VERSION) > $@
# LLVM and clang
$(llvm_VERSION_FILE) : $(llvm_FILE) $(cfe_FILE) $(clangtoolsextra_FILE) $(cmake_VERSION_FILE) $(compilerrt_FILE)
@echo Building llvm and clang $(llvm_VERS) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(basename $(llvm_FILE)))) && \
tar xf $(ABSOLUTE_SOURCES_ROOT)/$(notdir $(llvm_FILE)) && \
cd $(notdir $(basename $(basename $(llvm_FILE)))) && \
cd tools && \
tar xf $(ABSOLUTE_SOURCES_ROOT)/$(notdir $(cfe_FILE)) && \
mv $(notdir $(basename $(basename $(cfe_FILE)))) clang && \
cd clang/tools && \
tar xf $(ABSOLUTE_SOURCES_ROOT)/$(notdir $(clangtoolsextra_FILE)) && \
mv $(notdir $(basename $(basename $(clangtoolsextra_FILE)))) extra && \
cd ../../../projects && \
tar xf $(ABSOLUTE_SOURCES_ROOT)/$(notdir $(compilerrt_FILE)) && \
mv $(notdir $(basename $(basename $(compilerrt_FILE)))) compiler-rt && \
cd .. && \
mkdir build && cd build && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DCMAKE_INSTALL_PREFIX="$(llvm_PREFIX)" \
-DLLVM_ENABLE_RTTI:BOOL=ON \
-DLLVM_REQUIRES_RTTI:BOOL=ON \
-DLLVM_TARGETS_TO_BUILD:STRING="X86;NVPTX" \
-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN:BOOL=ON \
-DPYTHON_EXECUTABLE:STRING="$(PYTHON_BIN)" \
.. > $(ABSOLUTE_PREFIX_ROOT)/log_llvm.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_llvm.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(llvm_VERSION) > $@
# OpenImageIO
# Edits:
# - Defining OIIO_STATIC_BUILD to avoid specifying it everywhere
# - std::locale segfault fix
# - Python module
ifeq "$(CURRENT_OS)" "windows"
PNG_LIBRARY := $(png_PREFIX)/lib/libpng16_static$(STATICLIB_EXT)
else
PNG_LIBRARY := $(png_PREFIX)/lib/libpng16$(STATICLIB_EXT)
endif
$(oiio_VERSION_FILE) : $(boost_VERSION_FILE) $(cmake_VERSION_FILE) $(freetype_VERSION_FILE) $(ilmbase_VERSION_FILE) $(jpeg_VERSION_FILE) $(openexr_VERSION_FILE) $(png_VERSION_FILE) $(ptex_VERSION_FILE) $(tiff_VERSION_FILE) $(zlib_VERSION_FILE) $(oiio_FILE)/HEAD
@echo Building OpenImageIO $(oiio_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf oiio && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/oiio.git" oiio && \
cd oiio && \
git checkout -q $(oiio_VERSION) && \
( printf '/pragma once/a\n#ifndef OIIO_STATIC_BUILD\n#define OIIO_STATIC_BUILD\n#endif\n.\nw\nq\n' | ed -s src/include/OpenImageIO/export.h ) && \
( printf '/libturbojpeg/s/libturbojpeg/turbojpeg-static/\nw\nq' | ed -s src/cmake/modules/FindJPEGTurbo.cmake ) && \
( printf '/\/W1/s/W1/bigobj/\nw\nq' | ed -s src/cmake/compiler.cmake ) && \
( printf '/Boost_USE_STATIC_LIBS/d\nw\nq' | ed -s src/cmake/compiler.cmake ) && \
( printf '/Boost_USE_STATIC_LIBS/d\nw\nq' | ed -s src/cmake/compiler.cmake ) && \
( printf '/Boost_USE_STATIC_LIBS/d\nw\nq' | ed -s src/cmake/externalpackages.cmake ) && \
( printf '/USE_PYTHON OFF/d\nw\n' | ed -s src/cmake/compiler.cmake ) && \
mkdir build && cd build && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DBOOST_ROOT="$(boost_PREFIX)" \
-DBUILDSTATIC:BOOL=ON \
-DBoost_USE_STATIC_LIBS:BOOL=$(USE_STATIC_BOOST) \
-DCMAKE_INSTALL_PREFIX="$(oiio_PREFIX)" \
-DFREETYPE_INCLUDE_PATH="$(freetype_PREFIX)/include/freetype2" \
-DFREETYPE_PATH="$(freetype_PREFIX)" \
-DILMBASE_ROOT_DIR="$(ilmbase_PREFIX)" \
-DJPEGTURBO_PATH="$(jpeg_PREFIX)" \
-DLINKSTATIC:BOOL=ON \
-DOIIO_BUILD_TESTS:BOOL=OFF \
-DOPENEXR_ROOT_DIR="$(openexr_PREFIX)" \
-DPNG_LIBRARY="$(PNG_LIBRARY)" \
-DPNG_PNG_INCLUDE_DIR="$(png_PREFIX)/include" \
-DPTEX_LOCATION:PATH="$(ptex_PREFIX)" \
-DPYTHON_EXECUTABLE=$(PYTHON_BIN) \
-DSTOP_ON_WARNING:BOOL=OFF \
-DTIFF_INCLUDE_DIR="$(tiff_PREFIX)/include" \
-DTIFF_LIBRARY="$(tiff_PREFIX)/lib/libtiff$(STATICLIB_EXT)" \
-DUSE_FREETYPE:BOOL=ON \
-DUSE_GIF:BOOL=OFF \
-DUSE_JPEGTURBO:BOOL=ON \
-DUSE_NUKE:BOOL=OFF \
-DUSE_QT:BOOL=OFF \
-DVERBOSE:BOOL=ON \
-DZLIB_ROOT="$(zlib_PREFIX)" \
.. > $(ABSOLUTE_PREFIX_ROOT)/log_oiio.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_oiio.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(oiio_VERSION) > $@
$(openexr_VERSION_FILE) : $(cmake_VERSION_FILE) $(ilmbase_VERSION_FILE) $(zlib_VERSION_FILE) $(openexr_FILE)
@echo Building OpenEXR $(openexr_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf openexr-$(openexr_VERSION) && \
tar -xf $(ABSOLUTE_SOURCES_ROOT)/openexr-$(openexr_VERSION).tar.gz && \
cd openexr-$(openexr_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
( printf '/define.*INCLUDED_IMF_DWA_COMRESSOR_H/a\n#include <zlib.h>\n.\nw\n' | ed -s IlmImf/ImfDwaCompressor.h ) && \
( printf '/define.*INCLUDED_IMF_ZIP_COMPRESSOR_H/a\n#include <zlib.h>\n.\nw\n' | ed -s IlmImf/ImfZipCompressor.h ) && \
( printf '/define.*INCLUDED_IMF_COMPRESSION_H/a\n#include <zlib.h>\n.\nw\n' | ed -s IlmImf/ImfCompression.h ) && \
( printf '/define.*INCLUDED_IMF_ZIP_H/a\n#include <zlib.h>\n.\nw\n' | ed -s IlmImf/ImfZip.h ) && \
( test ! $(CURRENT_OS) == linux || patch -N --no-backup-if-mismatch IlmImf/CMakeLists.txt $(THIS_DIR)/patches/OpenEXR/patch_openexr_cmakelists.diff ) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX="$(openexr_PREFIX)" \
-DILMBASE_PACKAGE_PREFIX:PATH="$(ilmbase_PREFIX)" \
-DNAMESPACE_VERSIONING:BOOL=ON \
-DZLIB_ROOT:PATH="$(zlib_PREFIX)" \
. > $(ABSOLUTE_PREFIX_ROOT)/log_openexr.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_openexr.txt 2>&1 && \
cp $(ABSOLUTE_PREFIX_ROOT)/ilmbase/lib/*$(STATICLIB_EXT) $(ABSOLUTE_PREFIX_ROOT)/openexr/lib && \
cd $(THIS_DIR) && \
echo $(openexr_VERSION) > $@
# OpenSubdiv
$(opensubd_VERSION_FILE) : $(cmake_VERSION_FILE) $(glew_VERSION_FILE) $(glfw_VERSION_FILE) $(ptex_VERSION_FILE) $(tbb_VERSION_FILE) $(zlib_VERSION_FILE) $(opensubd_FILE)/HEAD
@echo Building OpenSubdiv $(opensubd_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(opensubd_FILE))) && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/$(notdir $(opensubd_FILE))" $(notdir $(basename $(opensubd_FILE))) && \
cd $(notdir $(basename $(opensubd_FILE))) && \
git checkout -q $(opensubd_VERSION) && \
mkdir -p $(ABSOLUTE_PREFIX_ROOT) && \
( printf "/osd_dynamic_cpu/s/osd_dynamic_cpu/osd_static_gpu/\nw\nq" | ed -s CMakeLists.txt ) && \
( printf "/osd_dynamic_gpu/s/osd_dynamic_gpu/osd_static_cpu/\nw\nq" | ed -s CMakeLists.txt ) && \
( printf "/if.*NOT.*NOT/s/(/( 0 AND /\nw\nq" | ed -s opensubdiv/CMakeLists.txt ) && \
( printf "/\/WX/d\nw\nq" | ed -s CMakeLists.txt ) && \
( printf "/glew32s/s/glew32s/libglew32/\nw\nq" | ed -s cmake/FindGLEW.cmake ) && \
$(CMAKE) \
$(COMMON_CMAKE_FLAGS) \
-DCMAKE_INSTALL_PREFIX="$(opensubd_PREFIX)" \
-DGLFW_LOCATION:PATH="$(glfw_PREFIX)" \
-DGLEW_LOCATION:PATH="$(glew_PREFIX)" \
-DNO_GLTESTS:BOOL=ON \
-DNO_TESTS:BOOL=ON \
-DNO_TUTORIALS:BOOL=ON \
-DMSVC_STATIC_CRT:BOOL=$(STATIC_RUNTIME) \
-DPTEX_LOCATION:PATH="$(ptex_PREFIX)" \
-DPYTHON_EXECUTABLE=$(PYTHON_BIN) \
-DTBB_LOCATION:PATH="$(tbb_PREFIX)" \
-DZLIB_ROOT:PATH="$(zlib_PREFIX)" \
-DNO_OMP=1 \
. > $(ABSOLUTE_PREFIX_ROOT)/log_opensubdiv.txt 2>&1 && \
$(CMAKE) \
--build . \
--target install \
--config $(CMAKE_BUILD_TYPE) \
$(CMAKE_MAKE_FLAGS) >> $(ABSOLUTE_PREFIX_ROOT)/log_opensubdiv.txt 2>&1 && \
cd $(THIS_DIR) && \
echo $(opensubd_VERSION) > $@
# Open Shading Language
$(osl_VERSION_FILE) : $(boost_VERSION_FILE) $(cmake_VERSION_FILE) $(llvm_VERSION_FILE) $(oiio_VERSION_FILE) $(zlib_VERSION_FILE) $(osl_FILE)/HEAD
@echo Building OSL $(osl_VERSION) && \
mkdir -p $(ABSOLUTE_BUILD_ROOT) && cd $(ABSOLUTE_BUILD_ROOT) && \
rm -rf $(notdir $(basename $(osl_FILE))) && \
git clone -q --no-checkout "$(WINDOWS_SOURCES_ROOT)/$(notdir $(osl_FILE))" $(notdir $(basename $(osl_FILE))) && \
cd $(notdir $(basename $(osl_FILE))) && \
git checkout -q $(osl_VERSION) && \
echo OSL: Disable OSL shaders... && \
( printf "/pragma once/a\n#ifndef OSL_STATIC_BUILD\n#define OSL_STATIC_BUILD\n#endif\n.\nw\n" | ed -s src/include/OSL/export.h ) && \
( printf "/shaders/d\nw\n" | ed -s CMakeLists.txt ) && \
( printf "/shaders/d\nw\n" | ed -s CMakeLists.txt ) && \
echo OSL: Linking against static boost... && \
( printf "/Boost_COMPONENTS/a\nlist (APPEND Boost_COMPONENTS filesystem)\n.\nw\n" | ed -s src/cmake/externalpackages.cmake ) && \
( printf "/Boost_USE_STATIC_LIBS/d\nw\n" | ed -s src/cmake/externalpackages.cmake ) && \
( printf "/Boost_USE_STATIC_LIBS/d\nw\n" | ed -s src/cmake/compiler.cmake ) && \
( printf "/Boost_USE_STATIC_LIBS/d\nw\n" | ed -s src/cmake/compiler.cmake ) && \