summaryrefslogtreecommitdiff
path: root/libs/assimp/contrib/draco/CMakeLists.txt
blob: 5526e7f60595f557c6b17ab899252b1854631cb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

# Draco requires C++11.
set(CMAKE_CXX_STANDARD 11)
project(draco C CXX)

if(NOT CMAKE_BUILD_TYPE)
  set(CMAKE_BUILD_TYPE Release)
endif()

set(draco_root "${CMAKE_CURRENT_SOURCE_DIR}")
set(draco_src_root "${draco_root}/src/draco")
set(draco_build "${CMAKE_BINARY_DIR}")

if("${draco_root}" STREQUAL "${draco_build}")
  message(
    FATAL_ERROR "Building from within the Draco source tree is not supported.\n"
                "Hint: Run these commands\n"
                "$ rm -rf CMakeCache.txt CMakeFiles\n"
                "$ mkdir -p ../draco_build\n" "$ cd ../draco_build\n"
                "And re-run CMake from the draco_build directory.")
endif()

include(CMakePackageConfigHelpers)
include(FindPythonInterp)
include("${draco_root}/cmake/draco_build_definitions.cmake")
include("${draco_root}/cmake/draco_cpu_detection.cmake")
include("${draco_root}/cmake/draco_emscripten.cmake")
include("${draco_root}/cmake/draco_flags.cmake")
include("${draco_root}/cmake/draco_helpers.cmake")
include("${draco_root}/cmake/draco_install.cmake")
include("${draco_root}/cmake/draco_intrinsics.cmake")
include("${draco_root}/cmake/draco_options.cmake")
include("${draco_root}/cmake/draco_sanitizer.cmake")
include("${draco_root}/cmake/draco_targets.cmake")
include("${draco_root}/cmake/draco_tests.cmake")
include("${draco_root}/cmake/draco_variables.cmake")

# C++ and linker flags.
draco_track_configuration_variable(DRACO_CXX_FLAGS)
draco_track_configuration_variable(DRACO_EXE_LINKER_FLAGS)

# Sanitizer integration.
draco_track_configuration_variable(DRACO_SANITIZE)

# Generated source file directory.
draco_track_configuration_variable(DRACO_GENERATED_SOURCES_DIRECTORY)

# Controls use of std::mutex and absl::Mutex in ThreadPool.
draco_track_configuration_variable(DRACO_THREADPOOL_USE_STD_MUTEX)

if(DRACO_VERBOSE)
  draco_dump_cmake_flag_variables()
  draco_dump_tracked_configuration_variables()
  draco_dump_options()
endif()

# Compiler/linker flags must be lists, but come in from the environment as
# strings. Break them up:
if(NOT "${DRACO_CXX_FLAGS}" STREQUAL "")
  separate_arguments(DRACO_CXX_FLAGS)
endif()
if(NOT "${DRACO_EXE_LINKER_FLAGS}" STREQUAL "")
  separate_arguments(DRACO_EXE_LINKER_FLAGS)
endif()

draco_reset_target_lists()
draco_setup_options()
draco_set_build_definitions()
draco_set_cxx_flags()
draco_generate_features_h()

# Draco source file listing variables.
list(APPEND draco_attributes_sources
            "${draco_src_root}/attributes/attribute_octahedron_transform.cc"
            "${draco_src_root}/attributes/attribute_octahedron_transform.h"
            "${draco_src_root}/attributes/attribute_quantization_transform.cc"
            "${draco_src_root}/attributes/attribute_quantization_transform.h"
            "${draco_src_root}/attributes/attribute_transform.cc"
            "${draco_src_root}/attributes/attribute_transform.h"
            "${draco_src_root}/attributes/attribute_transform_data.h"
            "${draco_src_root}/attributes/attribute_transform_type.h"
            "${draco_src_root}/attributes/geometry_attribute.cc"
            "${draco_src_root}/attributes/geometry_attribute.h"
            "${draco_src_root}/attributes/geometry_indices.h"
            "${draco_src_root}/attributes/point_attribute.cc"
            "${draco_src_root}/attributes/point_attribute.h")

list(
  APPEND
    draco_compression_attributes_dec_sources
    "${draco_src_root}/compression/attributes/attributes_decoder.cc"
    "${draco_src_root}/compression/attributes/attributes_decoder.h"
    "${draco_src_root}/compression/attributes/kd_tree_attributes_decoder.cc"
    "${draco_src_root}/compression/attributes/kd_tree_attributes_decoder.h"
    "${draco_src_root}/compression/attributes/kd_tree_attributes_shared.h"
    "${draco_src_root}/compression/attributes/mesh_attribute_indices_encoding_data.h"
    "${draco_src_root}/compression/attributes/normal_compression_utils.h"
    "${draco_src_root}/compression/attributes/point_d_vector.h"
    "${draco_src_root}/compression/attributes/sequential_attribute_decoder.cc"
    "${draco_src_root}/compression/attributes/sequential_attribute_decoder.h"
    "${draco_src_root}/compression/attributes/sequential_attribute_decoders_controller.cc"
    "${draco_src_root}/compression/attributes/sequential_attribute_decoders_controller.h"
    "${draco_src_root}/compression/attributes/sequential_integer_attribute_decoder.cc"
    "${draco_src_root}/compression/attributes/sequential_integer_attribute_decoder.h"
    "${draco_src_root}/compression/attributes/sequential_normal_attribute_decoder.cc"
    "${draco_src_root}/compression/attributes/sequential_normal_attribute_decoder.h"
    "${draco_src_root}/compression/attributes/sequential_quantization_attribute_decoder.cc"
    "${draco_src_root}/compression/attributes/sequential_quantization_attribute_decoder.h"
  )

list(
  APPEND
    draco_compression_attributes_enc_sources
    "${draco_src_root}/compression/attributes/attributes_encoder.cc"
    "${draco_src_root}/compression/attributes/attributes_encoder.h"
    "${draco_src_root}/compression/attributes/kd_tree_attributes_encoder.cc"
    "${draco_src_root}/compression/attributes/kd_tree_attributes_encoder.h"
    "${draco_src_root}/compression/attributes/linear_sequencer.h"
    "${draco_src_root}/compression/attributes/points_sequencer.h"
    "${draco_src_root}/compression/attributes/sequential_attribute_encoder.cc"
    "${draco_src_root}/compression/attributes/sequential_attribute_encoder.h"
    "${draco_src_root}/compression/attributes/sequential_attribute_encoders_controller.cc"
    "${draco_src_root}/compression/attributes/sequential_attribute_encoders_controller.h"
    "${draco_src_root}/compression/attributes/sequential_integer_attribute_encoder.cc"
    "${draco_src_root}/compression/attributes/sequential_integer_attribute_encoder.h"
    "${draco_src_root}/compression/attributes/sequential_normal_attribute_encoder.cc"
    "${draco_src_root}/compression/attributes/sequential_normal_attribute_encoder.h"
    "${draco_src_root}/compression/attributes/sequential_quantization_attribute_encoder.cc"
    "${draco_src_root}/compression/attributes/sequential_quantization_attribute_encoder.h"
  )


list(
  APPEND
    draco_compression_attributes_pred_schemes_dec_sources
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_decoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_shared.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_data.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_decoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_decoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_area.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_base.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_multi_parallelogram_decoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_shared.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_decoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_decoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_predictor.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_decoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_decoder_factory.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_decoder_interface.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_decoding_transform.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_delta_decoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_factory.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_interface.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_decoding_transform.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_transform_base.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_decoding_transform.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_transform_base.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_wrap_decoding_transform.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_wrap_transform_base.h"
  )

list(
  APPEND
    draco_compression_attributes_pred_schemes_enc_sources
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_shared.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_data.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_area.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_base.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_multi_parallelogram_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_shared.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_predictor.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_delta_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_encoder.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_encoder_factory.cc"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_encoder_factory.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_encoder_interface.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_encoding_transform.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_factory.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_interface.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_encoding_transform.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_transform_base.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_encoding_transform.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_transform_base.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_wrap_encoding_transform.h"
    "${draco_src_root}/compression/attributes/prediction_schemes/prediction_scheme_wrap_transform_base.h"
  )

list(
  APPEND
    draco_compression_bit_coders_sources
    "${draco_src_root}/compression/bit_coders/adaptive_rans_bit_coding_shared.h"
    "${draco_src_root}/compression/bit_coders/adaptive_rans_bit_decoder.cc"
    "${draco_src_root}/compression/bit_coders/adaptive_rans_bit_decoder.h"
    "${draco_src_root}/compression/bit_coders/adaptive_rans_bit_encoder.cc"
    "${draco_src_root}/compression/bit_coders/adaptive_rans_bit_encoder.h"
    "${draco_src_root}/compression/bit_coders/direct_bit_decoder.cc"
    "${draco_src_root}/compression/bit_coders/direct_bit_decoder.h"
    "${draco_src_root}/compression/bit_coders/direct_bit_encoder.cc"
    "${draco_src_root}/compression/bit_coders/direct_bit_encoder.h"
    "${draco_src_root}/compression/bit_coders/folded_integer_bit_decoder.h"
    "${draco_src_root}/compression/bit_coders/folded_integer_bit_encoder.h"
    "${draco_src_root}/compression/bit_coders/rans_bit_decoder.cc"
    "${draco_src_root}/compression/bit_coders/rans_bit_decoder.h"
    "${draco_src_root}/compression/bit_coders/rans_bit_encoder.cc"
    "${draco_src_root}/compression/bit_coders/rans_bit_encoder.h"
    "${draco_src_root}/compression/bit_coders/symbol_bit_decoder.cc"
    "${draco_src_root}/compression/bit_coders/symbol_bit_decoder.h"
    "${draco_src_root}/compression/bit_coders/symbol_bit_encoder.cc"
    "${draco_src_root}/compression/bit_coders/symbol_bit_encoder.h")

list(APPEND draco_enc_config_sources
            "${draco_src_root}/compression/config/compression_shared.h"
            "${draco_src_root}/compression/config/draco_options.h"
            "${draco_src_root}/compression/config/encoder_options.h"
            "${draco_src_root}/compression/config/encoding_features.h")

list(APPEND draco_dec_config_sources
            "${draco_src_root}/compression/config/compression_shared.h"
            "${draco_src_root}/compression/config/decoder_options.h"
            "${draco_src_root}/compression/config/draco_options.h")

list(APPEND draco_compression_decode_sources
            "${draco_src_root}/compression/decode.cc"
            "${draco_src_root}/compression/decode.h")

list(APPEND draco_compression_encode_sources
            "${draco_src_root}/compression/encode.cc"
            "${draco_src_root}/compression/encode.h"
            "${draco_src_root}/compression/encode_base.h"
            "${draco_src_root}/compression/expert_encode.cc"
            "${draco_src_root}/compression/expert_encode.h")

list(
  APPEND
    draco_compression_mesh_traverser_sources
    "${draco_src_root}/compression/mesh/traverser/depth_first_traverser.h"
    "${draco_src_root}/compression/mesh/traverser/max_prediction_degree_traverser.h"
    "${draco_src_root}/compression/mesh/traverser/mesh_attribute_indices_encoding_observer.h"
    "${draco_src_root}/compression/mesh/traverser/mesh_traversal_sequencer.h"
    "${draco_src_root}/compression/mesh/traverser/traverser_base.h")

list(
  APPEND
    draco_compression_mesh_dec_sources
    "${draco_src_root}/compression/mesh/mesh_decoder.cc"
    "${draco_src_root}/compression/mesh/mesh_decoder.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_decoder.cc"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_decoder.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_decoder_impl.cc"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_decoder_impl.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_decoder_impl_interface.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_shared.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_traversal_decoder.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_traversal_predictive_decoder.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_traversal_valence_decoder.h"
    "${draco_src_root}/compression/mesh/mesh_sequential_decoder.cc"
    "${draco_src_root}/compression/mesh/mesh_sequential_decoder.h")

list(
  APPEND
    draco_compression_mesh_enc_sources
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_encoder.cc"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_encoder.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_encoder_impl.cc"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_encoder_impl.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_encoder_impl_interface.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_shared.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_traversal_encoder.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_traversal_predictive_encoder.h"
    "${draco_src_root}/compression/mesh/mesh_edgebreaker_traversal_valence_encoder.h"
    "${draco_src_root}/compression/mesh/mesh_encoder.cc"
    "${draco_src_root}/compression/mesh/mesh_encoder.h"
    "${draco_src_root}/compression/mesh/mesh_sequential_encoder.cc"
    "${draco_src_root}/compression/mesh/mesh_sequential_encoder.h")

list(
  APPEND
    draco_compression_point_cloud_dec_sources
    "${draco_src_root}/compression/point_cloud/point_cloud_decoder.cc"
    "${draco_src_root}/compression/point_cloud/point_cloud_decoder.h"
    "${draco_src_root}/compression/point_cloud/point_cloud_kd_tree_decoder.cc"
    "${draco_src_root}/compression/point_cloud/point_cloud_kd_tree_decoder.h"
    "${draco_src_root}/compression/point_cloud/point_cloud_sequential_decoder.cc"
    "${draco_src_root}/compression/point_cloud/point_cloud_sequential_decoder.h"
  )

list(
  APPEND
    draco_compression_point_cloud_enc_sources
    "${draco_src_root}/compression/point_cloud/point_cloud_encoder.cc"
    "${draco_src_root}/compression/point_cloud/point_cloud_encoder.h"
    "${draco_src_root}/compression/point_cloud/point_cloud_kd_tree_encoder.cc"
    "${draco_src_root}/compression/point_cloud/point_cloud_kd_tree_encoder.h"
    "${draco_src_root}/compression/point_cloud/point_cloud_sequential_encoder.cc"
    "${draco_src_root}/compression/point_cloud/point_cloud_sequential_encoder.h"
  )

list(APPEND draco_compression_entropy_sources
            "${draco_src_root}/compression/entropy/ans.h"
            "${draco_src_root}/compression/entropy/rans_symbol_coding.h"
            "${draco_src_root}/compression/entropy/rans_symbol_decoder.h"
            "${draco_src_root}/compression/entropy/rans_symbol_encoder.h"
            "${draco_src_root}/compression/entropy/shannon_entropy.cc"
            "${draco_src_root}/compression/entropy/shannon_entropy.h"
            "${draco_src_root}/compression/entropy/symbol_decoding.cc"
            "${draco_src_root}/compression/entropy/symbol_decoding.h"
            "${draco_src_root}/compression/entropy/symbol_encoding.cc"
            "${draco_src_root}/compression/entropy/symbol_encoding.h")

list(APPEND draco_core_sources
            "${draco_src_root}/core/bit_utils.cc"
            "${draco_src_root}/core/bit_utils.h"
            "${draco_src_root}/core/bounding_box.cc"
            "${draco_src_root}/core/bounding_box.h"
            "${draco_src_root}/core/cycle_timer.cc"
            "${draco_src_root}/core/cycle_timer.h"
            "${draco_src_root}/core/data_buffer.cc"
            "${draco_src_root}/core/data_buffer.h"
            "${draco_src_root}/core/decoder_buffer.cc"
            "${draco_src_root}/core/decoder_buffer.h"
            "${draco_src_root}/core/divide.cc"
            "${draco_src_root}/core/divide.h"
            "${draco_src_root}/core/draco_index_type.h"
            "${draco_src_root}/core/draco_index_type_vector.h"
            "${draco_src_root}/core/draco_types.cc"
            "${draco_src_root}/core/draco_types.h"
            "${draco_src_root}/core/encoder_buffer.cc"
            "${draco_src_root}/core/encoder_buffer.h"
            "${draco_src_root}/core/hash_utils.cc"
            "${draco_src_root}/core/hash_utils.h"
            "${draco_src_root}/core/macros.h"
            "${draco_src_root}/core/math_utils.h"
            "${draco_src_root}/core/options.cc"
            "${draco_src_root}/core/options.h"
            "${draco_src_root}/core/quantization_utils.cc"
            "${draco_src_root}/core/quantization_utils.h"
            "${draco_src_root}/core/status.h"
            "${draco_src_root}/core/status_or.h"
            "${draco_src_root}/core/varint_decoding.h"
            "${draco_src_root}/core/varint_encoding.h"
            "${draco_src_root}/core/vector_d.h")

list(APPEND draco_io_sources
            "${draco_src_root}/io/file_reader_factory.cc"
            "${draco_src_root}/io/file_reader_factory.h"
            "${draco_src_root}/io/file_reader_interface.h"
            "${draco_src_root}/io/file_utils.cc"
            "${draco_src_root}/io/file_utils.h"
            "${draco_src_root}/io/file_writer_factory.cc"
            "${draco_src_root}/io/file_writer_factory.h"
            "${draco_src_root}/io/file_writer_interface.h"
            "${draco_src_root}/io/file_writer_utils.h"
            "${draco_src_root}/io/file_writer_utils.cc"
            "${draco_src_root}/io/mesh_io.cc"
            "${draco_src_root}/io/mesh_io.h"
            "${draco_src_root}/io/obj_decoder.cc"
            "${draco_src_root}/io/obj_decoder.h"
            "${draco_src_root}/io/obj_encoder.cc"
            "${draco_src_root}/io/obj_encoder.h"
            "${draco_src_root}/io/parser_utils.cc"
            "${draco_src_root}/io/parser_utils.h"
            "${draco_src_root}/io/ply_decoder.cc"
            "${draco_src_root}/io/ply_decoder.h"
            "${draco_src_root}/io/ply_encoder.cc"
            "${draco_src_root}/io/ply_encoder.h"
            "${draco_src_root}/io/ply_property_reader.h"
            "${draco_src_root}/io/ply_property_writer.h"
            "${draco_src_root}/io/ply_reader.cc"
            "${draco_src_root}/io/ply_reader.h"
            "${draco_src_root}/io/point_cloud_io.cc"
            "${draco_src_root}/io/point_cloud_io.h"
            "${draco_src_root}/io/stdio_file_reader.cc"
            "${draco_src_root}/io/stdio_file_reader.h"
            "${draco_src_root}/io/stdio_file_writer.cc"
            "${draco_src_root}/io/stdio_file_writer.h")

list(APPEND draco_mesh_sources
            "${draco_src_root}/mesh/corner_table.cc"
            "${draco_src_root}/mesh/corner_table.h"
            "${draco_src_root}/mesh/corner_table_iterators.h"
            "${draco_src_root}/mesh/mesh.cc"
            "${draco_src_root}/mesh/mesh.h"
            "${draco_src_root}/mesh/mesh_are_equivalent.cc"
            "${draco_src_root}/mesh/mesh_are_equivalent.h"
            "${draco_src_root}/mesh/mesh_attribute_corner_table.cc"
            "${draco_src_root}/mesh/mesh_attribute_corner_table.h"
            "${draco_src_root}/mesh/mesh_cleanup.cc"
            "${draco_src_root}/mesh/mesh_cleanup.h"
            "${draco_src_root}/mesh/mesh_misc_functions.cc"
            "${draco_src_root}/mesh/mesh_misc_functions.h"
            "${draco_src_root}/mesh/mesh_stripifier.cc"
            "${draco_src_root}/mesh/mesh_stripifier.h"
            "${draco_src_root}/mesh/triangle_soup_mesh_builder.cc"
            "${draco_src_root}/mesh/triangle_soup_mesh_builder.h"
            "${draco_src_root}/mesh/valence_cache.h")

list(APPEND draco_point_cloud_sources
            "${draco_src_root}/point_cloud/point_cloud.cc"
            "${draco_src_root}/point_cloud/point_cloud.h"
            "${draco_src_root}/point_cloud/point_cloud_builder.cc"
            "${draco_src_root}/point_cloud/point_cloud_builder.h")

list(
  APPEND
    draco_points_common_sources
    "${draco_src_root}/compression/point_cloud/algorithms/point_cloud_compression_method.h"
    "${draco_src_root}/compression/point_cloud/algorithms/point_cloud_types.h"
    "${draco_src_root}/compression/point_cloud/algorithms/quantize_points_3.h"
    "${draco_src_root}/compression/point_cloud/algorithms/queuing_policy.h")

list(
  APPEND
    draco_points_dec_sources
    "${draco_src_root}/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.cc"
    "${draco_src_root}/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.h"
    "${draco_src_root}/compression/point_cloud/algorithms/float_points_tree_decoder.cc"
    "${draco_src_root}/compression/point_cloud/algorithms/float_points_tree_decoder.h"
  )

list(
  APPEND
    draco_points_enc_sources
    "${draco_src_root}/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_encoder.cc"
    "${draco_src_root}/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_encoder.h"
    "${draco_src_root}/compression/point_cloud/algorithms/float_points_tree_encoder.cc"
    "${draco_src_root}/compression/point_cloud/algorithms/float_points_tree_encoder.h"
  )

list(APPEND draco_metadata_sources
            "${draco_src_root}/metadata/geometry_metadata.cc"
            "${draco_src_root}/metadata/geometry_metadata.h"
            "${draco_src_root}/metadata/metadata.cc"
            "${draco_src_root}/metadata/metadata.h")

list(APPEND draco_metadata_enc_sources
            "${draco_src_root}/metadata/metadata_encoder.cc"
            "${draco_src_root}/metadata/metadata_encoder.h")

list(APPEND draco_metadata_dec_sources
            "${draco_src_root}/metadata/metadata_decoder.cc"
            "${draco_src_root}/metadata/metadata_decoder.h")

list(APPEND draco_animation_sources
            "${draco_src_root}/animation/keyframe_animation.cc"
            "${draco_src_root}/animation/keyframe_animation.h")

list(APPEND draco_animation_enc_sources
            "${draco_src_root}/animation/keyframe_animation_encoder.cc"
            "${draco_src_root}/animation/keyframe_animation_encoder.h")

list(APPEND draco_animation_dec_sources
            "${draco_src_root}/animation/keyframe_animation_decoder.cc"
            "${draco_src_root}/animation/keyframe_animation_decoder.h")

list(
  APPEND draco_js_dec_sources
         "${draco_src_root}/javascript/emscripten/decoder_webidl_wrapper.cc"
         "${draco_src_root}/javascript/emscripten/draco_decoder_glue_wrapper.cc"
  )

list(
  APPEND draco_js_enc_sources
         "${draco_src_root}/javascript/emscripten/draco_encoder_glue_wrapper.cc"
         "${draco_src_root}/javascript/emscripten/encoder_webidl_wrapper.cc")

list(
  APPEND
    draco_animation_js_dec_sources
    "${draco_src_root}/javascript/emscripten/animation_decoder_webidl_wrapper.cc"
    "${draco_src_root}/javascript/emscripten/draco_animation_decoder_glue_wrapper.cc"
  )

list(
  APPEND
    draco_animation_js_enc_sources
    "${draco_src_root}/javascript/emscripten/animation_encoder_webidl_wrapper.cc"
    "${draco_src_root}/javascript/emscripten/draco_animation_encoder_glue_wrapper.cc"
  )

list(APPEND draco_unity_plug_sources
            "${draco_src_root}/unity/draco_unity_plugin.cc"
            "${draco_src_root}/unity/draco_unity_plugin.h")

list(APPEND draco_maya_plug_sources
            "${draco_src_root}/maya/draco_maya_plugin.cc"
            "${draco_src_root}/maya/draco_maya_plugin.h")

#
# Draco targets.
#
if(EMSCRIPTEN AND DRACO_JS_GLUE)
  # Draco decoder and encoder "executable" targets in various flavors for
  # Emsscripten.
  list(APPEND draco_decoder_src
              ${draco_attributes_sources}
              ${draco_compression_attributes_dec_sources}
              ${draco_compression_attributes_pred_schemes_dec_sources}
              ${draco_compression_bit_coders_sources}
              ${draco_compression_decode_sources}
              ${draco_compression_entropy_sources}
              ${draco_compression_mesh_traverser_sources}
              ${draco_compression_mesh_dec_sources}
              ${draco_compression_point_cloud_dec_sources}
              ${draco_core_sources}
              ${draco_dec_config_sources}
              ${draco_js_dec_sources}
              ${draco_mesh_sources}
              ${draco_metadata_dec_sources}
              ${draco_metadata_sources}
              ${draco_point_cloud_sources}
              ${draco_points_dec_sources})

  list(APPEND draco_encoder_src
              ${draco_attributes_sources}
              ${draco_compression_attributes_enc_sources}
              ${draco_compression_attributes_pred_schemes_enc_sources}
              ${draco_compression_bit_coders_sources}
              ${draco_compression_encode_sources}
              ${draco_compression_entropy_sources}
              ${draco_compression_mesh_traverser_sources}
              ${draco_compression_mesh_enc_sources}
              ${draco_compression_point_cloud_enc_sources}
              ${draco_core_sources}
              ${draco_enc_config_sources}
              ${draco_js_enc_sources}
              ${draco_mesh_sources}
              ${draco_metadata_enc_sources}
              ${draco_metadata_sources}
              ${draco_point_cloud_sources}
              ${draco_points_enc_sources})

  list(APPEND draco_js_dec_idl
              "${draco_src_root}/javascript/emscripten/draco_web_decoder.idl")
  list(APPEND draco_js_enc_idl
              "${draco_src_root}/javascript/emscripten/draco_web_encoder.idl")
  list(
    APPEND
      draco_animation_js_dec_idl
      "${draco_src_root}/javascript/emscripten/draco_animation_web_decoder.idl")
  list(
    APPEND
      draco_animation_js_enc_idl
      "${draco_src_root}/javascript/emscripten/draco_animation_web_encoder.idl")
  list(APPEND draco_pre_link_js_sources
              "${draco_src_root}/javascript/emscripten/prepareCallbacks.js"
              "${draco_src_root}/javascript/emscripten/version.js")
  list(APPEND draco_post_link_js_sources
              "${draco_src_root}/javascript/emscripten/finalize.js")
  list(APPEND draco_post_link_js_decoder_sources ${draco_post_link_js_sources}
              "${draco_src_root}/javascript/emscripten/decoder_functions.js")

  set(draco_decoder_glue_path "${draco_build}/glue_decoder")
  set(draco_encoder_glue_path "${draco_build}/glue_encoder")

  draco_generate_emscripten_glue(INPUT_IDL ${draco_js_dec_idl} OUTPUT_PATH
                                 ${draco_decoder_glue_path})
  draco_generate_emscripten_glue(INPUT_IDL ${draco_js_enc_idl} OUTPUT_PATH
                                 ${draco_encoder_glue_path})

  if(DRACO_DECODER_ATTRIBUTE_DEDUPLICATION)
    list(APPEND draco_decoder_features
                "DRACO_ATTRIBUTE_INDICES_DEDUPLICATION_SUPPORTED"
                "DRACO_ATTRIBUTE_VALUES_DEDUPLICATION_SUPPORTED")
  endif()

  draco_add_emscripten_executable(NAME
                                  draco_decoder
                                  SOURCES
                                  ${draco_decoder_src}
                                  DEFINES
                                  ${draco_defines}
                                  FEATURES
                                  ${draco_decoder_features}
                                  INCLUDES
                                  ${draco_include_paths}
                                  LINK_FLAGS
                                  "-sEXPORT_NAME=\"DracoDecoderModule\""
                                  GLUE_PATH
                                  ${draco_decoder_glue_path}
                                  PRE_LINK_JS_SOURCES
                                  ${draco_pre_link_js_sources}
                                  POST_LINK_JS_SOURCES
                                  ${draco_post_link_js_decoder_sources})

  draco_add_emscripten_executable(
    NAME
    draco_encoder
    SOURCES
    ${draco_encoder_src}
    DEFINES
    ${draco_defines}
    FEATURES
    DRACO_ATTRIBUTE_INDICES_DEDUPLICATION_SUPPORTED
    DRACO_ATTRIBUTE_VALUES_DEDUPLICATION_SUPPORTED
    INCLUDES
    ${draco_include_paths}
    LINK_FLAGS
    "-sEXPORT_NAME=\"DracoEncoderModule\""
    GLUE_PATH
    ${draco_encoder_glue_path}
    PRE_LINK_JS_SOURCES
    ${draco_pre_link_js_sources}
    POST_LINK_JS_SOURCES
    ${draco_post_link_js_sources})

  if(DRACO_ANIMATION_ENCODING)
    set(draco_anim_decoder_glue_path "${draco_build}/glue_animation_decoder")
    set(draco_anim_encoder_glue_path "${draco_build}/glue_animation_encoder")

    draco_generate_emscripten_glue(INPUT_IDL ${draco_animation_js_dec_idl}
                                   OUTPUT_PATH ${draco_anim_decoder_glue_path})
    draco_generate_emscripten_glue(INPUT_IDL ${draco_animation_js_enc_idl}
                                   OUTPUT_PATH ${draco_anim_encoder_glue_path})

    draco_add_emscripten_executable(
      NAME
      draco_animation_decoder
      SOURCES
      ${draco_animation_dec_sources}
      ${draco_animation_js_dec_sources}
      ${draco_animation_sources}
      ${draco_decoder_src}
      DEFINES
      ${draco_defines}
      INCLUDES
      ${draco_include_paths}
      LINK_FLAGS
      "-sEXPORT_NAME=\"DracoAnimationDecoderModule\""
      GLUE_PATH
      ${draco_anim_decoder_glue_path}
      PRE_LINK_JS_SOURCES
      ${draco_pre_link_js_sources}
      POST_LINK_JS_SOURCES
      ${draco_post_link_js_decoder_sources})

    draco_add_emscripten_executable(
      NAME
      draco_animation_encoder
      SOURCES
      ${draco_animation_enc_sources}
      ${draco_animation_js_enc_sources}
      ${draco_animation_sources}
      ${draco_encoder_src}
      DEFINES
      ${draco_defines}
      INCLUDES
      ${draco_include_paths}
      LINK_FLAGS
      "-sEXPORT_NAME=\"DracoAnimationEncoderModule\""
      GLUE_PATH
      ${draco_anim_encoder_glue_path}
      PRE_LINK_JS_SOURCES
      ${draco_pre_link_js_sources}
      POST_LINK_JS_SOURCES
      ${draco_post_link_js_sources})
  endif()
else()
  # Standard Draco libs, encoder and decoder. Object collections that mirror the
  # Draco directory structure.
  draco_add_library(NAME draco_attributes TYPE OBJECT SOURCES
                    ${draco_attributes_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME
                    draco_compression_attributes_dec
                    OBJECT
                    ${draco_compression_attributes_dec_sources}
                    TYPE
                    OBJECT
                    SOURCES
                    ${draco_compression_attributes_dec_sources}
                    DEFINES
                    ${draco_defines}
                    INCLUDES
                    ${draco_include_paths})
  draco_add_library(NAME draco_compression_attributes_enc TYPE OBJECT SOURCES
                    ${draco_compression_attributes_enc_sources} DEFINES
                    ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_attributes_pred_schemes_dec TYPE
                    OBJECT SOURCES
                    ${draco_compression_attributes_pred_schemes_dec_sources})
  draco_add_library(NAME draco_compression_attributes_pred_schemes_enc TYPE
                    OBJECT SOURCES
                    ${draco_compression_attributes_pred_schemes_enc_sources}
                    DEFINES ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_bit_coders TYPE OBJECT SOURCES
                    ${draco_compression_bit_coders_sources} DEFINES
                    ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_enc_config TYPE OBJECT SOURCES
                    ${draco_enc_config_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_dec_config TYPE OBJECT SOURCES
                    ${draco_dec_config_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_decode TYPE OBJECT SOURCES
                    ${draco_compression_decode_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_encode TYPE OBJECT SOURCES
                    ${draco_compression_encode_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_entropy TYPE OBJECT SOURCES
                    ${draco_compression_entropy_sources} DEFINES
                    ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_mesh_traverser TYPE OBJECT SOURCES
                    ${draco_compression_mesh_traverser_sources} DEFINES
                    ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_mesh_dec TYPE OBJECT SOURCES
                    ${draco_compression_mesh_dec_sources} DEFINES
                    ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_mesh_enc TYPE OBJECT SOURCES
                    ${draco_compression_mesh_enc_sources} DEFINES
                    ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_point_cloud_dec TYPE OBJECT SOURCES
                    ${draco_compression_point_cloud_dec_sources} DEFINES
                    ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_compression_point_cloud_enc TYPE OBJECT SOURCES
                    ${draco_compression_point_cloud_enc_sources} DEFINES
                    ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_core TYPE OBJECT SOURCES ${draco_core_sources}
                    DEFINES ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_io TYPE OBJECT SOURCES ${draco_io_sources}
                    DEFINES ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_mesh TYPE OBJECT SOURCES ${draco_mesh_sources}
                    DEFINES ${draco_defines} INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_metadata_dec TYPE OBJECT SOURCES
                    ${draco_metadata_dec_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_metadata_enc TYPE OBJECT SOURCES
                    ${draco_metadata_enc_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_metadata TYPE OBJECT SOURCES
                    ${draco_metadata_sources} DEFINES ${draco_defines} INCLUDES
                    ${draco_include_paths})
  draco_add_library(NAME draco_animation_dec TYPE OBJECT SOURCES
                    ${draco_animation_dec_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_animation_enc TYPE OBJECT SOURCES
                    ${draco_animation_enc_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME draco_animation TYPE OBJECT SOURCES
                    ${draco_animation_sources} DEFINES ${draco_defines} INCLUDES
                    ${draco_include_paths})
  draco_add_library(NAME draco_point_cloud TYPE OBJECT SOURCES
                    ${draco_point_cloud_sources} DEFINES ${draco_defines}
                    INCLUDES ${draco_include_paths})
  draco_add_library(NAME
                    draco_points_dec
                    TYPE
                    OBJECT
                    SOURCES
                    ${draco_points_common_sources}
                    ${draco_points_dec_sources}
                    DEFINES
                    ${draco_defines}
                    INCLUDES
                    ${draco_include_paths})
  draco_add_library(NAME
                    draco_points_enc
                    TYPE
                    OBJECT
                    SOURCES
                    ${draco_points_common_sources}
                    ${draco_points_enc_sources}
                    DEFINES
                    ${draco_defines}
                    INCLUDES
                    ${draco_include_paths})

  set(draco_object_library_deps
      draco_attributes
      draco_compression_attributes_dec
      draco_compression_attributes_enc
      draco_compression_attributes_pred_schemes_dec
      draco_compression_attributes_pred_schemes_enc
      draco_compression_bit_coders
      draco_compression_decode
      draco_compression_encode
      draco_compression_entropy
      draco_compression_mesh_dec
      draco_compression_mesh_enc
      draco_compression_point_cloud_dec
      draco_compression_point_cloud_enc
      draco_core
      draco_dec_config
      draco_enc_config
      draco_io
      draco_mesh
      draco_metadata
      draco_metadata_dec
      draco_metadata_enc
      draco_animation
      draco_animation_dec
      draco_animation_enc
      draco_point_cloud
      draco_points_dec
      draco_points_enc)

  # Library targets that consume the object collections.
  if(MSVC)
    # In order to produce a DLL and import library the Windows tools require
    # that the exported symbols are part of the DLL target. The unfortunate side
    # effect of this is that a single configuration cannot output both the
    # static library and the DLL: This results in an either/or situation.
    # Windows users of the draco build can have a DLL and an import library,
    # or they can have a static library; they cannot have both from a single
    # configuration of the build.
    if(BUILD_SHARED_LIBS)
      set(draco_lib_type SHARED)
    else()
      set(draco_lib_type STATIC)
    endif()
    draco_add_library(NAME
                      draco
                      OUTPUT_NAME
                      draco
                      TYPE
                      ${draco_lib_type}
                      DEFINES
                      ${draco_defines}
                      INCLUDES
                      ${draco_include_paths}
                      OBJLIB_DEPS
                      ${draco_object_library_deps})

  else()
    draco_add_library(NAME
                      draco_static
                      OUTPUT_NAME
                      draco
                      TYPE
                      STATIC
                      DEFINES
                      ${draco_defines}
                      INCLUDES
                      ${draco_include_paths}
                      OBJLIB_DEPS
                      ${draco_object_library_deps})

    if(BUILD_SHARED_LIBS)
      draco_add_library(NAME
                        draco_shared
                        SOURCES
                        "${draco_src_root}/core/draco_version.h"
                        OUTPUT_NAME
                        draco
                        TYPE
                        SHARED
                        DEFINES
                        ${draco_defines}
                        INCLUDES
                        ${draco_include_paths}
                        LIB_DEPS
                        draco_static)
    endif()
  endif()

  if(DRACO_UNITY_PLUGIN)
    if(IOS)
      set(unity_decoder_lib_type STATIC)
    else()
      set(unity_decoder_lib_type MODULE)
    endif()

    draco_add_library(NAME draco_unity_plugin TYPE OBJECT SOURCES
                      ${draco_unity_plug_sources} DEFINES ${draco_defines}
                      INCLUDES ${draco_include_paths})

    draco_add_library(NAME
                      dracodec_unity
                      TYPE
                      ${unity_decoder_lib_type}
                      DEFINES
                      ${draco_defines}
                      INCLUDES
                      ${draco_include_paths}
                      OBJLIB_DEPS
                      draco_unity_plugin
                      LIB_DEPS
                      ${draco_plugin_dependency})

    # For Mac, we need to build a .bundle for the unity plugin.
    if(APPLE)
      set_target_properties(dracodec_unity PROPERTIES BUNDLE true)
    endif()
  endif()

  if(DRACO_MAYA_PLUGIN)
    draco_add_library(NAME draco_maya_plugin TYPE OBJECT SOURCES
                      ${draco_maya_plug_sources} DEFINES ${draco_defines}
                      INCLUDES ${draco_include_paths})

    draco_add_library(NAME
                      draco_maya_wrapper
                      TYPE
                      MODULE
                      DEFINES
                      ${draco_defines}
                      INCLUDES
                      ${draco_include_paths}
                      OBJLIB_DEPS
                      draco_maya_plugin
                      LIB_DEPS
                      ${draco_plugin_dependency})

    # For Mac, we need to build a .bundle for the plugin.
    if(APPLE)
      set_target_properties(draco_maya_wrapper PROPERTIES BUNDLE true)
    endif()
  endif()

  # Draco app targets.
  draco_add_executable(NAME
                       draco_decoder
                       SOURCES
                       "${draco_src_root}/tools/draco_decoder.cc"
                       ${draco_io_sources}
                       DEFINES
                       ${draco_defines}
                       INCLUDES
                       ${draco_include_paths}
                       LIB_DEPS
                       ${draco_dependency})

  draco_add_executable(NAME
                       draco_encoder
                       SOURCES
                       "${draco_src_root}/tools/draco_encoder.cc"
                       ${draco_io_sources}
                       DEFINES
                       ${draco_defines}
                       INCLUDES
                       ${draco_include_paths}
                       LIB_DEPS
                       ${draco_dependency})

  draco_setup_install_target()
  draco_setup_test_targets()
endif()

if(DRACO_VERBOSE)
  draco_dump_cmake_flag_variables()
  draco_dump_tracked_configuration_variables()
  draco_dump_options()
endif()