forked from FNNDSC/KWWidgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
991 lines (864 loc) · 34.8 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.6)
project(KWWidgets)
# --------------------------------------------------------------------------
# To use this library in a larger project you will need to SUBDIR into this
# directory so that it gets built and then you will use the following variables
# in your CMakeLists files to get the proper include paths and libraries
set(KWWidgets_INCLUDE_PATH
"${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}/AutoGeneratedClasses;${CMAKE_CURRENT_BINARY_DIR}"
CACHE INTERNAL "include paths for KWWidgets"
)
set(KWWidgets_LIBRARIES KWWidgets CACHE INTERNAL "libraries for KWWidgets")
# You will also need to define a value for the following variables:
# KWWidgets_INSTALL_BIN_DIR - binary dir (executables)
# KWWidgets_INSTALL_LIB_DIR - library dir (libs)
# KWWidgets_INSTALL_DATA_DIR - share dir (say, examples, data, etc)
# KWWidgets_INSTALL_INCLUDE_DIR - include dir (headers)
# KWWidgets_INSTALL_PACKAGE_DIR - package/export configuration files
# KWWidgets_VTK_INSTALL_PACKAGE_DIR - VTK package/export configuration files
# KWWidgets_INSTALL_NO_DEVELOPMENT - do not install development files
# KWWidgets_INSTALL_NO_RUNTIME - do not install runtime files
# KWWidgets_INSTALL_NO_DOCUMENTATION - do not install documentation files
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------
# Version
set(KWWidgets_MAJOR_VERSION 1)
set(KWWidgets_MINOR_VERSION 0)
set(KWWidgets_PATCH_VERSION 0)
set(KWWidgets_VERSION
"${KWWidgets_MAJOR_VERSION}.${KWWidgets_MINOR_VERSION}.${KWWidgets_PATCH_VERSION}")
# --------------------------------------------------------------------------
# We need VTK
if(NOT VTK_SOURCE_DIR)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
if(NOT VTK_WRAP_TCL)
message(FATAL_ERROR "Please set VTK_WRAP_TCL to ON in VTK")
endif(NOT VTK_WRAP_TCL)
if(VTK_MAJOR_VERSION LESS 5)
message(FATAL_ERROR "Please use VTK 5.0 or later")
endif(VTK_MAJOR_VERSION LESS 5)
else(NOT VTK_SOURCE_DIR)
if(NOT VTK_WRAP_TCL)
include_directories(${VTK_TK_RESOURCES_DIR})
endif(NOT VTK_WRAP_TCL)
endif(NOT VTK_SOURCE_DIR)
# --------------------------------------------------------------------------
# Output directories
if(NOT LIBRARY_OUTPUT_PATH)
set(LIBRARY_OUTPUT_PATH ${KWWidgets_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all libraries.")
endif(NOT LIBRARY_OUTPUT_PATH)
set(KWWidgets_LIBRARY_DIRS ${LIBRARY_OUTPUT_PATH})
set(KWWidgets_RUNTIME_DIRS ${LIBRARY_OUTPUT_PATH})
if(NOT EXECUTABLE_OUTPUT_PATH)
set(EXECUTABLE_OUTPUT_PATH ${KWWidgets_BINARY_DIR}/bin CACHE INTERNAL
"Single output directory for building all executables.")
endif(NOT EXECUTABLE_OUTPUT_PATH)
# --------------------------------------------------------------------------
# Some flags
include_regular_expression("^(vtk|kw|icons).*$")
set(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
if(CMAKE_COMPILER_2005)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
endif(CMAKE_COMPILER_2005)
set(BUILD_SHARED_LIBS ${VTK_BUILD_SHARED_LIBS})
set(KWWidgets_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(KWWidgets_CMAKE_DIR "${KWWidgets_SOURCE_DIR}/CMake" CACHE INTERNAL "")
subdirs(CMake)
# Make sure VTK_CMAKE_DIR is at the beginning so that VTK's FindTCL is
# used before CMake's FindTCL.
set(CMAKE_MODULE_PATH "${VTK_CMAKE_DIR}" ${CMAKE_MODULE_PATH} "${KWWidgets_CMAKE_DIR}")
set(KWWidgets_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES})
mark_as_advanced(CMAKE_BACKWARDS_COMPATIBILITY)
include("${KWWidgets_SOURCE_DIR}/Utilities/tkdnd/TkDnD.cmake")
tkdnd_get_library(KWWidgets_USE_TKDND TKDND_SRCS TKDND_INCLUDE_PATH TKDND_LIBS)
include("${KWWidgets_SOURCE_DIR}/Utilities/TkTreeCtrl/TkTreeCtrl.cmake")
tktreectrl_get_library(KWWidgets_USE_TKTREECTRL TKTREECTRL_SRCS TKTREECTRL_INCLUDE_PATH TKTREECTRL_LIBS)
# --------------------------------------------------------------------------
# Install directories
if(NOT KWWidgets_INSTALL_BIN_DIR)
set(KWWidgets_INSTALL_BIN_DIR "/bin")
endif(NOT KWWidgets_INSTALL_BIN_DIR)
if(NOT KWWidgets_INSTALL_LIB_DIR)
set(KWWidgets_INSTALL_LIB_DIR "/lib/${PROJECT_NAME}")
endif(NOT KWWidgets_INSTALL_LIB_DIR)
if(NOT KWWidgets_INSTALL_DATA_DIR)
set(KWWidgets_INSTALL_DATA_DIR "/share/${PROJECT_NAME}"
CACHE INTERNAL "")
endif(NOT KWWidgets_INSTALL_DATA_DIR)
if(NOT KWWidgets_INSTALL_INCLUDE_DIR)
set(KWWidgets_INSTALL_INCLUDE_DIR "/include/${PROJECT_NAME}")
endif(NOT KWWidgets_INSTALL_INCLUDE_DIR)
if(NOT KWWidgets_INSTALL_PACKAGE_DIR)
set(KWWidgets_INSTALL_PACKAGE_DIR ${KWWidgets_INSTALL_LIB_DIR}
CACHE INTERNAL "")
endif(NOT KWWidgets_INSTALL_PACKAGE_DIR)
if(NOT KWWidgets_VTK_INSTALL_PACKAGE_DIR)
set(KWWidgets_VTK_INSTALL_PACKAGE_DIR ${VTK_INSTALL_PACKAGE_DIR})
endif(NOT KWWidgets_VTK_INSTALL_PACKAGE_DIR)
if(NOT KWWidgets_INSTALL_NO_DEVELOPMENT)
set(KWWidgets_INSTALL_NO_DEVELOPMENT 0)
endif(NOT KWWidgets_INSTALL_NO_DEVELOPMENT)
if(NOT KWWidgets_INSTALL_NO_RUNTIME)
set(KWWidgets_INSTALL_NO_RUNTIME 0)
endif(NOT KWWidgets_INSTALL_NO_RUNTIME)
if(NOT KWWidgets_INSTALL_NO_DOCUMENTATION)
set(KWWidgets_INSTALL_NO_DOCUMENTATION 0)
endif(NOT KWWidgets_INSTALL_NO_DOCUMENTATION)
set(KWWidgets_INSTALL_NO_LIBRARIES)
if(KWWidgets_BUILD_SHARED_LIBS)
if(KWWidgets_INSTALL_NO_RUNTIME AND KWWidgets_INSTALL_NO_DEVELOPMENT)
set(KWWidgets_INSTALL_NO_LIBRARIES 1)
endif(KWWidgets_INSTALL_NO_RUNTIME AND KWWidgets_INSTALL_NO_DEVELOPMENT)
else(KWWidgets_BUILD_SHARED_LIBS)
if(KWWidgets_INSTALL_NO_DEVELOPMENT)
set(KWWidgets_INSTALL_NO_LIBRARIES 1)
endif(KWWidgets_INSTALL_NO_DEVELOPMENT)
endif(KWWidgets_BUILD_SHARED_LIBS)
# --------------------------------------------------------------------------
# Sources
option(KWWidgets_BUILD_VTK_WIDGETS "Build the widgets that can be interfaced to complex VTK classes. Set it to OFF to build a core version of the library." ON)
mark_as_advanced(KWWidgets_BUILD_VTK_WIDGETS)
set(KWWidgets_SRCS
vtkKWApplication.cxx
vtkKWApplicationSettingsInterface.cxx
vtkKWBalloonHelpManager.cxx
vtkKWCanvas.cxx
vtkKWChangeColorButton.cxx
vtkKWCheckButton.cxx
vtkKWCheckButtonWithChangeColorButton.cxx
vtkKWCheckButtonWithPopupFrame.cxx
vtkKWClipboardHelper.cxx
vtkKWColorPickerDialog.cxx
vtkKWColorPickerWidget.cxx
vtkKWColorPresetSelector.cxx
vtkKWColorSpectrumWidget.cxx
vtkKWColorSwatchesWidget.cxx
vtkKWComboBox.cxx
vtkKWCompositeWidget.cxx
vtkKWCoreWidget.cxx
vtkKWDialog.cxx
vtkKWDirectoryExplorer.cxx
vtkKWDirectoryPresetSelector.cxx
vtkKWDragAndDropTargetSet.cxx
vtkKWEntry.cxx
vtkKWEvent.cxx
vtkKWEventMap.cxx
vtkKWExtent.cxx
vtkKWFavoriteDirectoriesFrame.cxx
vtkKWFileBrowserDialog.cxx
vtkKWFileBrowserWidget.cxx
vtkKWFileListTable.cxx
vtkKWFrame.cxx
vtkKWFrameWithLabel.cxx
vtkKWFrameWithScrollbar.cxx
vtkKWHSVColorSelector.cxx
vtkKWIcon.cxx
vtkKWInternationalization.cxx
vtkKWKeyBindingsManager.cxx
vtkKWKeyBindingsWidget.cxx
vtkKWLabel.cxx
vtkKWLanguage.cxx
vtkKWListBox.cxx
vtkKWListBoxToListBoxSelectionEditor.cxx
vtkKWLoadSaveButton.cxx
vtkKWLoadSaveDialog.cxx
vtkKWLogDialog.cxx
vtkKWLogWidget.cxx
vtkKWMaterialPropertyWidget.cxx
vtkKWMatrixWidget.cxx
vtkKWMenu.cxx
vtkKWMenuButton.cxx
vtkKWMessage.cxx
vtkKWMessageDialog.cxx
vtkKWMostRecentFilesManager.cxx
vtkKWMultiColumnList.cxx
vtkKWNotebook.cxx
vtkKWObject.cxx
vtkKWOptionDataBase.cxx
vtkKWOptions.cxx
vtkKWPopupButton.cxx
vtkKWPopupFrame.cxx
vtkKWPresetSelector.cxx
vtkKWProgressGauge.cxx
vtkKWPushButton.cxx
vtkKWPushButtonWithMenu.cxx
vtkKWRadioButton.cxx
vtkKWRadioButtonSet.cxx
vtkKWRange.cxx
vtkKWRegistryHelper.cxx
vtkKWResourceUtilities.cxx
vtkKWSaveImageDialog.cxx
vtkKWScalarComponentSelectionWidget.cxx
vtkKWScale.cxx
vtkKWScaleWithEntry.cxx
vtkKWScrollbar.cxx
vtkKWSeparator.cxx
vtkKWSimpleEntryDialog.cxx
vtkKWSmallCounterLabel.cxx
vtkKWSpinBox.cxx
vtkKWSpinButtons.cxx
vtkKWSplashScreen.cxx
vtkKWSplitFrame.cxx
vtkKWStartupPageWidget.cxx
vtkKWStateMachine.cxx
vtkKWStateMachineCluster.cxx
vtkKWStateMachineDOTWriter.cxx
vtkKWStateMachineInput.cxx
vtkKWStateMachineState.cxx
vtkKWStateMachineTransition.cxx
vtkKWStateMachineWriter.cxx
vtkKWTclInteractor.cxx
vtkKWText.cxx
vtkKWTheme.cxx
vtkKWThumbWheel.cxx
vtkKWTkUtilities.cxx
vtkKWTkcon.cxx
vtkKWToolbar.cxx
vtkKWToolbarSet.cxx
vtkKWTopLevel.cxx
vtkKWTree.cxx
vtkKWTreeWithScrollbars.cxx
vtkKWUserInterfaceManager.cxx
vtkKWUserInterfaceManagerDialog.cxx
vtkKWUserInterfaceManagerNotebook.cxx
vtkKWUserInterfacePanel.cxx
vtkKWWidget.cxx
vtkKWWidgetSet.cxx
vtkKWWidgetWithLabel.cxx
vtkKWWidgetWithScrollbars.cxx
vtkKWWidgetWithSpinButtons.cxx
vtkKWWidgetsVersion.cxx
vtkKWWindow.cxx
vtkKWWindowBase.cxx
vtkKWWindowLevelPresetSelector.cxx
vtkKWWizardDialog.cxx
vtkKWWizardStep.cxx
vtkKWWizardWidget.cxx
vtkKWWizardWorkflow.cxx
)
if(KWWidgets_BUILD_VTK_WIDGETS)
if(NOT VTK_WRAP_TCL)
message(FATAL_ERROR "Please set VTK_USE_TK to ON in VTK for KWWidgets_BUILD_VTK_WIDGETS to be ON as well.")
endif(NOT VTK_WRAP_TCL)
set(KWWidgets_SRCS ${KWWidgets_SRCS}
vtkKWColorPresetMenu.cxx
vtkKWColorTransferFunctionEditor.cxx
vtkKWCornerAnnotationEditor.cxx
vtkKWGenericRenderWindowInteractor.cxx
vtkKWHeaderAnnotationEditor.cxx
vtkKWHistogram.cxx
vtkKWHistogramSet.cxx
vtkKWParameterValueFunctionEditor.cxx
vtkKWParameterValueFunctionInterface.cxx
vtkKWParameterValueHermiteFunctionEditor.cxx
vtkKWPiecewiseFunctionEditor.cxx
vtkKWRenderWidget.cxx
vtkKWScalarBarAnnotation.cxx
vtkKWSelectionFrame.cxx
vtkKWSelectionFrameLayoutManager.cxx
vtkKWSimpleAnimationWidget.cxx
vtkKWSurfaceMaterialPropertyWidget.cxx
vtkKWTextPropertyEditor.cxx
vtkKWVolumePropertyHelper.cxx
vtkKWVolumeMaterialPropertyWidget.cxx
vtkKWVolumePropertyPresetSelector.cxx
vtkKWVolumePropertyWidget.cxx
)
endif(KWWidgets_BUILD_VTK_WIDGETS)
# Utilities/Extra sources
set(KWWidgets_UTILS_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/Wrapping/Tcl/vtkKWWidgetsInitializeCommand.cxx
${CMAKE_CURRENT_SOURCE_DIR}/Utilities/BWidgets/vtkKWBWidgetsInit.cxx
${CMAKE_CURRENT_SOURCE_DIR}/Utilities/Tablelist/vtkKWTablelistInit.cxx
${CMAKE_CURRENT_SOURCE_DIR}/Utilities/tkcon/vtkKWTkconInit.cxx
)
if(TKDND_SRCS)
set(KWWidgets_UTILS_SRCS ${KWWidgets_UTILS_SRCS} ${TKDND_SRCS})
endif(TKDND_SRCS)
if(TKTREECTRL_SRCS)
set(KWWidgets_UTILS_SRCS ${KWWidgets_UTILS_SRCS} ${TKTREECTRL_SRCS})
endif(TKTREECTRL_SRCS)
# Abstract/pure virtual classes
set_source_files_properties(
vtkKWClipboardHelper.cxx
vtkKWMaterialPropertyWidget.cxx
vtkKWParameterValueFunctionEditor.cxx
vtkKWParameterValueFunctionInterface.cxx
vtkKWParameterValueHermiteFunctionEditor.cxx
vtkKWRegistryHelper.cxx
vtkKWStateMachineWriter.cxx
vtkKWUserInterfaceManager.cxx
vtkKWWidgetSet.cxx
vtkKWWidgetWithScrollbars.cxx
${KWWidgets_UTILS_SRCS}
ABSTRACT
)
# Helper classes
set_source_files_properties(
vtkKWEvent.cxx
${KWWidgets_UTILS_SRCS}
WRAP_EXCLUDE
)
if(NOT VTK_WRAP_TCL)
set_source_files_properties(
vtkKWGenericRenderWindowInteractor.cxx
WRAP_EXCLUDE
)
endif(NOT VTK_WRAP_TCL)
# Add the registry code, and the set_icon command on win32
if(WIN32)
set(KWWidgets_UTILS_SRCS ${KWWidgets_UTILS_SRCS}
${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ApplicationIcon/vtkKWSetApplicationIconTclCommand.c)
set(KWWidgets_SRCS ${KWWidgets_SRCS}
vtkKWWin32RegistryHelper.cxx)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/Utilities/ApplicationIcon/vtkKWSetApplicationIconTclCommand.c
WRAP_EXCLUDE)
else(WIN32)
set(KWWidgets_SRCS ${KWWidgets_SRCS}
vtkKWUNIXRegistryHelper.cxx)
endif(WIN32)
# --------------------------------------------------------------------------
# Sources generated automatically from templates
set(KWWidgets_TEMPLATES_DIR ${KWWidgets_SOURCE_DIR}/Templates)
set(KWWidgets_AUTOGENERATED_DIR ${KWWidgets_BINARY_DIR}/AutoGeneratedClasses)
set(KWWidgets_AUTOGENERATED_SRCS)
set(KWWidgets_TEMPLATE_SRCS)
subdirs(Templates)
macro(KWWidgets_AUTOGENERATE_CLASS template build_dir class suffix src_list)
set(WidgetType ${class})
configure_file(
${template}.h.in
${build_dir}/${class}${suffix}.h
IMMEDIATE)
configure_file(
${template}.cxx.in
${build_dir}/${class}${suffix}.cxx
IMMEDIATE)
set(${src_list} ${${src_list}} ${build_dir}/${class}${suffix}.cxx)
endmacro(KWWidgets_AUTOGENERATE_CLASS)
# The "set of widgets" are automatically generated from some core widgets
# (i.e., vtkKWCheckButton => vtkKWCheckButtonSet).
set(list
vtkKWCheckButton
vtkKWComboBox
vtkKWEntry
vtkKWFrame
vtkKWLabel
vtkKWLabelWithLabel
vtkKWPushButton
vtkKWScale
vtkKWScaleWithEntry
vtkKWScaleWithLabel
vtkKWSpinBox
)
if(KWWidgets_BUILD_VTK_WIDGETS)
set(list ${list}
vtkKWColorTransferFunctionEditor
vtkKWPiecewiseFunctionEditor
)
endif(KWWidgets_BUILD_VTK_WIDGETS)
foreach(WidgetType ${list})
kwwidgets_autogenerate_class(
${KWWidgets_TEMPLATES_DIR}/vtkKWWidgetSetSubclass
${KWWidgets_AUTOGENERATED_DIR}
${WidgetType}
Set
KWWidgets_AUTOGENERATED_SRCS)
endforeach(WidgetType)
set(KWWidgets_TEMPLATE_SRCS ${KWWidgets_TEMPLATE_SRCS}
${KWWidgets_TEMPLATES_DIR}/vtkKWWidgetSetSubclass.cxx.in)
# The "labeled widgets" are automatically generated from some core widgets
# (i.e., vtkKWCheckButton => vtkKWCheckButtonWithLabel)
set(list
vtkKWCheckButton
vtkKWCheckButtonSet
vtkKWComboBox
vtkKWEntry
vtkKWLabel
vtkKWLoadSaveButton
vtkKWListBoxWithScrollbars
vtkKWMatrixWidget
vtkKWMenuButton
vtkKWMenuButtonWithSpinButtons
vtkKWMessage
vtkKWMultiColumnList
vtkKWMultiColumnListWithScrollbars
vtkKWPopupButton
vtkKWPushButton
vtkKWPushButtonSet
vtkKWRadioButtonSet
vtkKWScale
vtkKWScaleWithEntrySet
vtkKWSpinBox
vtkKWText
vtkKWTextWithScrollbars
)
foreach(WidgetType ${list})
kwwidgets_autogenerate_class(
${KWWidgets_TEMPLATES_DIR}/vtkKWWidgetWithLabelSubclass
${KWWidgets_AUTOGENERATED_DIR}
${WidgetType}
WithLabel
KWWidgets_AUTOGENERATED_SRCS)
endforeach(WidgetType)
set(KWWidgets_TEMPLATE_SRCS ${KWWidgets_TEMPLATE_SRCS}
${KWWidgets_TEMPLATES_DIR}/vtkKWWidgetWithLabelSubclass.cxx.in)
# The "widgets with scrollbars" are automatically generated from some core
# widgets
# (i.e., vtkKWText => vtkKWTextWithScrollbars)
set(list
vtkKWCanvas
vtkKWListBox
vtkKWMultiColumnList
vtkKWText
)
foreach(WidgetType ${list})
kwwidgets_autogenerate_class(
${KWWidgets_TEMPLATES_DIR}/vtkKWWidgetWithScrollbarsSubclass
${KWWidgets_AUTOGENERATED_DIR}
${WidgetType}
WithScrollbars
KWWidgets_AUTOGENERATED_SRCS)
endforeach(WidgetType)
set(KWWidgets_TEMPLATE_SRCS ${KWWidgets_TEMPLATE_SRCS}
${KWWidgets_TEMPLATES_DIR}/vtkKWWidgetWithScrollbarsSubclass.cxx.in)
# The "widgets with spinbuttons" are automatically generated from some
# core widgets
# (i.e., vtkKWMenuButton => vtkKWMenuButtonWithSpinButtons)
set(list
vtkKWMenuButton
)
foreach(WidgetType ${list})
kwwidgets_autogenerate_class(
${KWWidgets_TEMPLATES_DIR}/vtkKWWidgetWithSpinButtonsSubclass
${KWWidgets_AUTOGENERATED_DIR}
${WidgetType}
WithSpinButtons
KWWidgets_AUTOGENERATED_SRCS)
endforeach(WidgetType)
set(KWWidgets_TEMPLATE_SRCS ${KWWidgets_TEMPLATE_SRCS}
${KWWidgets_TEMPLATES_DIR}/vtkKWWidgetWithSpinButtonsSubclass.cxx.in)
# --------------------------------------------------------------------------
# SOViewer support
option(KWWidgets_USE_SOVIEWER "Use the SOViewer library (SOV_DIR) and build the corresponding support classes and examples." OFF)
mark_as_advanced(KWWidgets_USE_SOVIEWER)
if(KWWidgets_USE_SOVIEWER)
find_package(SOV REQUIRED)
if(SOV_FOUND)
mark_as_advanced(FLTK_FLUID_EXECUTABLE SOV_DIR)
endif(SOV_FOUND)
endif(KWWidgets_USE_SOVIEWER)
# --------------------------------------------------------------------------
# HTML Help can help
# http://msdn.microsoft.com/
# http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/vsconwhtshw.asp
if(WIN32)
if(HTML_HELP_INCLUDE_PATH AND HTML_HELP_LIBRARY)
else(HTML_HELP_INCLUDE_PATH AND HTML_HELP_LIBRARY)
include(FindHTMLHelp)
endif(HTML_HELP_INCLUDE_PATH AND HTML_HELP_LIBRARY)
if(HTML_HELP_INCLUDE_PATH AND HTML_HELP_LIBRARY)
set(KWWidgets_USE_HTML_HELP 1)
else(HTML_HELP_INCLUDE_PATH AND HTML_HELP_LIBRARY)
set(KWWidgets_USE_HTML_HELP 0)
endif(HTML_HELP_INCLUDE_PATH AND HTML_HELP_LIBRARY)
if(KWWidgets_USE_HTML_HELP)
set(KWWidgets_INCLUDE_PATH ${KWWidgets_INCLUDE_PATH}
${HTML_HELP_INCLUDE_PATH} CACHE INTERNAL "" FORCE)
endif(KWWidgets_USE_HTML_HELP)
endif(WIN32)
# --------------------------------------------------------------------------
# Internationalization
set(default_val 0)
if(DEFINED KWWidgets_USE_INTERNATIONALIZATION_DEFAULT)
set(default_val ${KWWidgets_USE_INTERNATIONALIZATION_DEFAULT})
endif(DEFINED KWWidgets_USE_INTERNATIONALIZATION_DEFAULT)
option(KWWidgets_USE_INTERNATIONALIZATION
"Enable internationalization support in KWWidgets." ${default_val})
mark_as_advanced(KWWidgets_USE_INTERNATIONALIZATION)
if(KWWidgets_USE_INTERNATIONALIZATION)
find_package(Gettext)
if(GETTEXT_FOUND)
include("${KWWidgets_CMAKE_DIR}/KWWidgetsInternationalizationMacros.cmake")
set(KWWidgets_INCLUDE_PATH ${KWWidgets_INCLUDE_PATH}
${GETTEXT_INCLUDE_DIR} CACHE INTERNAL "" FORCE)
kwwidgets_create_gettext_targets(
DOMAIN_NAME "KWWidgets"
LOCALE_LIST "fr"
COPYRIGHT_HOLDER "Kitware, Inc."
SOURCES "${KWWidgets_SRCS};${KWWidgets_TEMPLATE_SRCS}"
PO_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Resources/po"
POT_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/Resources/po"
PO_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/Resources/po"
MO_INSTALL_DIR "${KWWidgets_INSTALL_DATA_DIR}/locale"
ADD_MO_TARGET_TO_ALL)
else(GETTEXT_FOUND)
set(msg "KWWidgets_USE_INTERNATIONALIZATION is ON but the gettext runtime library and tools were not found.\n\nMore information about internationalization support in KWWidgets can be found at http://public.kitware.com/Wiki/KWWidgets/i18n.\n\n${GETTEXT_INFO_MSG}")
message(FATAL_ERROR "${msg}")
endif(GETTEXT_FOUND)
endif(KWWidgets_USE_INTERNATIONALIZATION)
# --------------------------------------------------------------------------
# Use [incr Tcl]
set(default_val 0)
if(DEFINED KWWidgets_USE_INCR_TCL_DEFAULT)
set(default_val ${KWWidgets_USE_INCR_TCL_DEFAULT})
endif(DEFINED KWWidgets_USE_INCR_TCL_DEFAULT)
option(KWWidgets_USE_INCR_TCL
"Enable [incr Tcl] support in KWWidgets." ${default_val})
mark_as_advanced(KWWidgets_USE_INCR_TCL)
if(KWWidgets_USE_INCR_TCL)
find_package(IncrTCL REQUIRED)
endif(KWWidgets_USE_INCR_TCL)
# --------------------------------------------------------------------------
# Include dirs
include_directories(
${KWWidgets_INCLUDE_PATH}
${VTK_INCLUDE_DIR}
${TKDND_INCLUDE_PATH}
${TK_INCLUDE_PATH}
)
# A tricky one. Tcl/Tk 8.5.0 provides (for the first time) some of the
# "internal headers" we usually provide in VTK (tclPort.h, tclWinPort.h, etc).
# Alas, tclPort.h is buggy by default, as it tries to explicitly include
# "../win/tclWinPort.h" instead of "tclWinPort.h". Our VTK internal headers
# were fixed. The trick is therefore to include ours before ActiveState's,
# by using the BEFORE keyword below.
include_directories(BEFORE ${TKTREECTRL_INCLUDE_PATH})
# --------------------------------------------------------------------------
# Wrapping
subdirs(Wrapping)
set(KWWidgets_SRCS ${KWWidgets_SRCS} ${KWWidgets_AUTOGENERATED_SRCS})
# --------------------------------------------------------------------------
# Wrap the classes in Tcl
include("${KWWidgets_CMAKE_DIR}/KWWidgetsWrappingMacros.cmake")
set(VTK_WRAP_HINTS ${KWWidgets_SOURCE_DIR}/hints)
kwwidgets_wrap_tcl(
KWWidgets
KWWidgetsTCL_SRCS
"${KWWidgets_SRCS}"
"vtkKWWidgetsInitializeCommand"
"${KWWidgets_MAJOR_VERSION}.${KWWidgets_MINOR_VERSION}")
set(KWWidgets_TCL_PACKAGE_INDEX_DIR
${KWWidgets_BINARY_DIR}/Wrapping/Tcl)
# If needed, copy the Tcl/Tk support files required at run-time
# to initialize Tcl/Tk. This is used by the examples or larger
# projects that include KWWidgets directly in their source trees.
if(TclTk_INSTALL_LIB_DIR)
set(KWWidgets_TclTk_INSTALL_LIB_DIR "${TclTk_INSTALL_LIB_DIR}")
else(TclTk_INSTALL_LIB_DIR)
set(KWWidgets_TclTk_INSTALL_LIB_DIR "${KWWidgets_INSTALL_LIB_DIR}/TclTk/lib")
endif(TclTk_INSTALL_LIB_DIR)
include("${KWWidgets_CMAKE_DIR}/KWWidgetsTclTkMacros.cmake")
kwwidgets_copy_tcl_tk_support_files("${PROJECT_BINARY_DIR}/lib")
kwwidgets_install_tcl_tk_support_files("${KWWidgets_TclTk_INSTALL_LIB_DIR}")
incr_tcl_get_version("INCR_TCL_MAJOR_VERSION" "INCR_TCL_MINOR_VERSION")
# --------------------------------------------------------------------------
# Wrap the classes in Python
if(VTK_WRAP_PYTHON)
set(KWWidgetsPythonExtra_SRCS)
set(KWWidgetsPython_LIBS vtkCommonPythonD)
include("${VTK_CMAKE_DIR}/vtkWrapPython.cmake")
vtk_wrap_python3(KWWidgetsPython KWWidgetsPython_SRCS
"${KWWidgets_SRCS} ${KWWidgetsPythonExtra_SRCS}")
set(KWWidgets_PYTHON_MODULE_DIR
${KWWidgets_BINARY_DIR}/Wrapping/Python)
if(BORLAND)
write_file(${LIBRARY_OUTPUT_PATH}/KWWidgetsPython.def
"EXPORTS\ninitKWWidgetsPython=_initKWWidgetsPython\n")
endif(BORLAND)
add_library(KWWidgetsPythonD
${KWWidgetsPython_SRCS}
${KWWidgetsPythonExtra_SRCS}
)
target_link_libraries(KWWidgetsPythonD KWWidgets ${KWWidgetsPython_LIBS})
if(KWWidgets_BUILD_VTK_WIDGETS AND
VTK_USE_RENDERING OR VTK_USE_RENDERING_ISSET)
target_link_libraries(KWWidgetsPythonD vtkRenderingPythonD)
endif(KWWidgets_BUILD_VTK_WIDGETS AND
VTK_USE_RENDERING OR VTK_USE_RENDERING_ISSET)
if(WIN32 OR APPLE)
target_link_libraries(KWWidgetsPythonD ${VTK_PYTHON_LIBRARIES})
endif(WIN32 OR APPLE)
if(NOT KWWidgets_INSTALL_NO_LIBRARIES)
install_targets(
${KWWidgets_INSTALL_LIB_DIR}
RUNTIME_DIRECTORY ${KWWidgets_INSTALL_BIN_DIR}
KWWidgetsPythonD)
endif(NOT KWWidgets_INSTALL_NO_LIBRARIES)
# Create a python module that can be loaded dynamically.
add_library(KWWidgetsPython MODULE
Wrapping/Python/KWWidgetsPythonExtraInit.cxx)
target_link_libraries(KWWidgetsPython KWWidgetsPythonD)
# Python extension modules on Windows must have the extension ".pyd"
# instead of ".dll" as of Python 2.5. Older python versions do support
# this suffix.
if(WIN32 AND NOT CYGWIN)
set_target_properties(KWWidgetsPython PROPERTIES SUFFIX ".pyd")
endif(WIN32 AND NOT CYGWIN)
if(WIN32 OR APPLE)
target_link_libraries(KWWidgetsPython ${VTK_PYTHON_LIBRARIES})
endif(WIN32 OR APPLE)
if(KWWidgets_BUILD_VTK_WIDGETS AND
VTK_USE_RENDERING OR VTK_USE_RENDERING_ISSET)
# TARGET_LINK_LIBRARIES(KWWidgetsPython vtkRenderingPython)
endif(KWWidgets_BUILD_VTK_WIDGETS AND
VTK_USE_RENDERING OR VTK_USE_RENDERING_ISSET)
find_program(PYTHON_EXECUTABLE
NAMES python2.6 python2.5 python2.4 python2.3 python2.2 python
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]
)
mark_as_advanced(PYTHON_EXECUTABLE)
endif(VTK_WRAP_PYTHON)
# --------------------------------------------------------------------------
# Create the instantiators
include("${VTK_CMAKE_DIR}/vtkMakeInstantiator.cmake")
set(VTK_USE_INSTANTIATOR_NEW 1)
vtk_make_instantiator3(KWWidgetsInstantiator
KWWidgets_Instantiator_SRCS
"${KWWidgets_SRCS}"
KWWidgets_EXPORT
${KWWidgets_BINARY_DIR}
"vtkKWWidgets.h")
# --------------------------------------------------------------------------
# Build the library
add_library(KWWidgets
${KWWidgetsTCL_SRCS}
${KWWidgets_SRCS}
${KWWidgets_Instantiator_SRCS}
${KWWidgets_UTILS_SRCS})
target_link_libraries(KWWidgets vtkChartsCoreTCL)
target_link_libraries(KWWidgets vtkCommonColorTCL)
target_link_libraries(KWWidgets vtkCommonComputationalGeometryTCL)
target_link_libraries(KWWidgets vtkCommonCoreTCL)
target_link_libraries(KWWidgets vtkCommonDataModelTCL)
target_link_libraries(KWWidgets vtkCommonExecutionModelTCL)
target_link_libraries(KWWidgets vtkCommonMathTCL)
target_link_libraries(KWWidgets vtkCommonMiscTCL)
target_link_libraries(KWWidgets vtkCommonSystemTCL)
target_link_libraries(KWWidgets vtkCommonTransformsTCL)
target_link_libraries(KWWidgets vtkDomainsChemistryTCL)
target_link_libraries(KWWidgets vtkFiltersAMRTCL)
target_link_libraries(KWWidgets vtkFiltersCoreTCL)
target_link_libraries(KWWidgets vtkFiltersExtractionTCL)
target_link_libraries(KWWidgets vtkFiltersFlowPathsTCL)
target_link_libraries(KWWidgets vtkFiltersGeneralTCL)
target_link_libraries(KWWidgets vtkFiltersGenericTCL)
target_link_libraries(KWWidgets vtkFiltersGeometryTCL)
target_link_libraries(KWWidgets vtkFiltersHybridTCL)
target_link_libraries(KWWidgets vtkFiltersHyperTreeTCL)
target_link_libraries(KWWidgets vtkFiltersImagingTCL)
target_link_libraries(KWWidgets vtkFiltersModelingTCL)
target_link_libraries(KWWidgets vtkFiltersParallelImagingTCL)
target_link_libraries(KWWidgets vtkFiltersParallelTCL)
target_link_libraries(KWWidgets vtkFiltersProgrammableTCL)
target_link_libraries(KWWidgets vtkFiltersSelectionTCL)
target_link_libraries(KWWidgets vtkFiltersSMPTCL)
target_link_libraries(KWWidgets vtkFiltersSourcesTCL)
target_link_libraries(KWWidgets vtkFiltersStatisticsTCL)
target_link_libraries(KWWidgets vtkFiltersTextureTCL)
target_link_libraries(KWWidgets vtkFiltersVerdictTCL)
target_link_libraries(KWWidgets vtkGeovisCoreTCL)
target_link_libraries(KWWidgets vtkImagingColorTCL)
target_link_libraries(KWWidgets vtkImagingCoreTCL)
target_link_libraries(KWWidgets vtkImagingFourierTCL)
target_link_libraries(KWWidgets vtkImagingGeneralTCL)
target_link_libraries(KWWidgets vtkImagingHybridTCL)
target_link_libraries(KWWidgets vtkImagingMathTCL)
target_link_libraries(KWWidgets vtkImagingMorphologicalTCL)
target_link_libraries(KWWidgets vtkImagingSourcesTCL)
target_link_libraries(KWWidgets vtkImagingStatisticsTCL)
target_link_libraries(KWWidgets vtkImagingStencilTCL)
target_link_libraries(KWWidgets vtkInfovisCoreTCL)
target_link_libraries(KWWidgets vtkInfovisLayoutTCL)
target_link_libraries(KWWidgets vtkInteractionImageTCL)
target_link_libraries(KWWidgets vtkInteractionStyleTCL)
target_link_libraries(KWWidgets vtkInteractionWidgetsTCL)
target_link_libraries(KWWidgets vtkIOAMRTCL)
target_link_libraries(KWWidgets vtkIOCoreTCL)
target_link_libraries(KWWidgets vtkIOEnSightTCL)
target_link_libraries(KWWidgets vtkIOExodusTCL)
target_link_libraries(KWWidgets vtkIOExportTCL)
target_link_libraries(KWWidgets vtkIOGeometryTCL)
target_link_libraries(KWWidgets vtkIOImageTCL)
target_link_libraries(KWWidgets vtkIOImportTCL)
target_link_libraries(KWWidgets vtkIOInfovisTCL)
target_link_libraries(KWWidgets vtkIOLegacyTCL)
target_link_libraries(KWWidgets vtkIOLSDynaTCL)
target_link_libraries(KWWidgets vtkIOMINCTCL)
target_link_libraries(KWWidgets vtkIOMovieTCL)
target_link_libraries(KWWidgets vtkIONetCDFTCL)
target_link_libraries(KWWidgets vtkIOParallelTCL)
target_link_libraries(KWWidgets vtkIOParallelXMLTCL)
target_link_libraries(KWWidgets vtkIOPLYTCL)
target_link_libraries(KWWidgets vtkIOSQLTCL)
target_link_libraries(KWWidgets vtkIOVideoTCL)
target_link_libraries(KWWidgets vtkIOXMLParserTCL)
target_link_libraries(KWWidgets vtkIOXMLTCL)
target_link_libraries(KWWidgets vtkParallelCoreTCL)
target_link_libraries(KWWidgets vtkRenderingAnnotationTCL)
target_link_libraries(KWWidgets vtkRenderingContextIIDTCL)
target_link_libraries(KWWidgets vtkRenderingContextOpenGLTCL)
target_link_libraries(KWWidgets vtkRenderingCoreTCL)
target_link_libraries(KWWidgets vtkRenderingFreeTypeTCL)
target_link_libraries(KWWidgets vtkRenderingGLtoPSTCL)
target_link_libraries(KWWidgets vtkRenderingImageTCL)
target_link_libraries(KWWidgets vtkRenderingLabelTCL)
target_link_libraries(KWWidgets vtkRenderingLICTCL)
target_link_libraries(KWWidgets vtkRenderingLODTCL)
target_link_libraries(KWWidgets vtkRenderingOpenGLTCL)
target_link_libraries(KWWidgets vtkRenderingTkTCL)
target_link_libraries(KWWidgets vtkRenderingVolumeOpenGLTCL)
target_link_libraries(KWWidgets vtkRenderingVolumeTCL)
target_link_libraries(KWWidgets vtkViewsContextIIDTCL)
target_link_libraries(KWWidgets vtkViewsCoreTCL)
target_link_libraries(KWWidgets vtkViewsInfovisTCL)
target_link_libraries(KWWidgets ${TK_LIBRARY})
target_link_libraries(KWWidgets ${TCL_LIBRARY})
message( "${KWWidgets_LIBRARIES} ${TK_LIBRARY} ${TCL_LIBRARY}")
if(KWWidgets_BUILD_VTK_WIDGETS)
if(VTK_WRAP_TCL)
if(VTK_USE_RENDERING OR VTK_USE_RENDERING_ISSET)
target_link_libraries(KWWidgets vtkRenderingTCL)
target_link_libraries(KWWidgets vtkHybridTCL)
if(VTK_MAJOR_VERSION GREATER 4)
target_link_libraries(KWWidgets vtkWidgetsTCL)
target_link_libraries(KWWidgets vtkVolumeRenderingTCL)
endif(VTK_MAJOR_VERSION GREATER 4)
endif(VTK_USE_RENDERING OR VTK_USE_RENDERING_ISSET)
if(VTK_USE_PARALLEL OR VTK_USE_PARALLEL_ISSET)
target_link_libraries(KWWidgets vtkParallelTCL)
endif(VTK_USE_PARALLEL OR VTK_USE_PARALLEL_ISSET)
else(VTK_WRAP_TCL)
if(VTK_USE_RENDERING OR VTK_USE_RENDERING_ISSET)
target_link_libraries(KWWidgets vtkRendering)
target_link_libraries(KWWidgets vtkHybrid)
if(VTK_MAJOR_VERSION GREATER 4)
target_link_libraries(KWWidgets vtkWidgets)
target_link_libraries(KWWidgets vtkVolumeRendering)
endif(VTK_MAJOR_VERSION GREATER 4)
endif(VTK_USE_RENDERING OR VTK_USE_RENDERING_ISSET)
if(VTK_USE_PARALLEL OR VTK_USE_PARALLEL_ISSET)
target_link_libraries(KWWidgets vtkParallel)
endif(VTK_USE_PARALLEL OR VTK_USE_PARALLEL_ISSET)
endif(VTK_WRAP_TCL)
else(KWWidgets_BUILD_VTK_WIDGETS)
if(TK_LIBRARY_DEBUG)
set(KWWidgets_TK_LIBRARIES
optimized ${TK_LIBRARY} debug ${TK_LIBRARY_DEBUG})
else(TK_LIBRARY_DEBUG)
set(KWWidgets_TK_LIBRARIES ${TK_LIBRARY})
endif(TK_LIBRARY_DEBUG)
target_link_libraries(KWWidgets ${KWWidgets_TK_LIBRARIES})
endif(KWWidgets_BUILD_VTK_WIDGETS)
target_link_libraries(KWWidgets
${VTK_PNG_LIBRARIES}
${KWSYS_NAMESPACE}
)
if(WIN32)
target_link_libraries(KWWidgets comctl32 mpr)
if(HTML_HELP_INCLUDE_PATH AND HTML_HELP_LIBRARY)
target_link_libraries(KWWidgets ${HTML_HELP_LIBRARY} )
endif(HTML_HELP_INCLUDE_PATH AND HTML_HELP_LIBRARY)
endif(WIN32)
# link ApplicationServices.framework on OSX for vtkKWClipboardHelper
if(APPLE)
target_link_libraries (KWWidgets "-framework ApplicationServices")
# As much as we should try to avoid linking against Carbon, I'm
# afraid we will need it to run an AppleScript using OSAExecute()
# (see vtkKWApplication::RunAppleScript and SendEmail)
target_link_libraries (KWWidgets "-framework Carbon")
endif(APPLE)
if(KWWidgets_USE_INTERNATIONALIZATION AND GETTEXT_RUNTIME_FOUND)
target_link_libraries(KWWidgets ${GETTEXT_LIBRARIES})
endif(KWWidgets_USE_INTERNATIONALIZATION AND GETTEXT_RUNTIME_FOUND)
if(KWWidgets_USE_INCR_TCL AND INCR_TCL_FOUND)
target_link_libraries(KWWidgets ${INCR_TCL_LIBRARY} ${INCR_TK_LIBRARY})
endif(KWWidgets_USE_INCR_TCL AND INCR_TCL_FOUND)
if(TKDND_LIBS)
target_link_libraries(KWWidgets ${TKDND_LIBS})
endif(TKDND_LIBS)
if(TKTREECTRL_LIBS)
target_link_libraries(KWWidgets ${TKTREECTRL_LIBS})
endif(TKTREECTRL_LIBS)
if(NOT KWWidgets_INSTALL_NO_LIBRARIES)
install_targets(
${KWWidgets_INSTALL_LIB_DIR}
RUNTIME_DIRECTORY ${KWWidgets_INSTALL_BIN_DIR}
${KWWidgets_LIBRARIES})
endif(NOT KWWidgets_INSTALL_NO_LIBRARIES)
# --------------------------------------------------------------------------
# Examples
set(KWWidgets_EXAMPLES_DIR ${KWWidgets_SOURCE_DIR}/Examples)
option(KWWidgets_BUILD_EXAMPLES "Build KWWidgets examples." ${BUILD_EXAMPLES})
mark_as_advanced(KWWidgets_BUILD_EXAMPLES)
set(KWWidgets_NEED_TO_BUILD_EXAMPLES ${KWWidgets_BUILD_EXAMPLES})
# --------------------------------------------------------------------------
# Testing (requires some of the examples)
include(Dart)
mark_as_advanced(BUILD_TESTING DART_ROOT TCL_TCLSH)
set(default_val 1)
if(DEFINED KWWidgets_BUILD_TESTING_DEFAULT)
set(default_val ${KWWidgets_BUILD_TESTING_DEFAULT})
endif(DEFINED KWWidgets_BUILD_TESTING_DEFAULT)
option(KWWidgets_BUILD_TESTING
"Enable testing in KWWidgets (if BUILD_TESTING is ON as well)."
${default_val})
mark_as_advanced(KWWidgets_BUILD_TESTING)
if(BUILD_TESTING AND KWWidgets_BUILD_TESTING)
enable_testing()
#SET(BUILDNAME "${PROJECT_NAME}-${BUILDNAME}")
set(KWWidgets_NEED_TO_BUILD_EXAMPLES 1)
option(KWWidgets_TEST_OUT_OF_SOURCE "Perform existing tests as out-of-source tests. This checks that external projects can be built against a KWWidgets build tree." OFF)
mark_as_advanced(KWWidgets_TEST_OUT_OF_SOURCE)
if(KWWidgets_TEST_OUT_OF_SOURCE)
option(KWWidgets_TEST_INSTALLATION "Perform existing out-of-source tests against an installed KWWidgets library as well. This checks that external projects can be built against a KWWidgets installation tree. Make sure CMAKE_INSTALL_PREFIX is set and KWWidgets has been installed properly before running the tests." OFF)
mark_as_advanced(KWWidgets_TEST_INSTALLATION)
endif(KWWidgets_TEST_OUT_OF_SOURCE)
subdirs(Testing)
endif(BUILD_TESTING AND KWWidgets_BUILD_TESTING)
# --------------------------------------------------------------------------
# Build the utilities
subdirs(Utilities)
# --------------------------------------------------------------------------
# Install the headers
if(NOT KWWidgets_INSTALL_NO_DEVELOPMENT)
install_files(${KWWidgets_INSTALL_INCLUDE_DIR} .h ${KWWidgets_SRCS})
install_files(${KWWidgets_INSTALL_INCLUDE_DIR} FILES vtkKWWidgets.h)
endif(NOT KWWidgets_INSTALL_NO_DEVELOPMENT)
# --------------------------------------------------------------------------
# Resources
set(KWWidgets_RESOURCES_DIR
${KWWidgets_SOURCE_DIR}/Resources CACHE INTERNAL "")
subdirs(Resources)
# --------------------------------------------------------------------------
# Configure the export configuration
subdirs(CMake/ExportConfiguration)
# --------------------------------------------------------------------------
# Build the examples
# This need to be done *at the end*, so that the installation process
# goes as far as possible before trying to install the examples;
# examples would stop the install process if they failed to build (say, if a
# third-party lib like ITK or SOV was broken).
if(KWWidgets_NEED_TO_BUILD_EXAMPLES)
subdirs(Examples)
endif(KWWidgets_NEED_TO_BUILD_EXAMPLES)
# --------------------------------------------------------------------------
# Testing with Squish
if(BUILD_TESTING AND KWWidgets_BUILD_TESTING)
option(KWWidgets_USE_Squish "Test KWWidgets With Squish" OFF)
mark_as_advanced(KWWidgets_USE_Squish)
if(KWWidgets_USE_Squish)
find_package(Squish)
if(NOT SQUISH_FOUND)
MESSAGE("Warning: Squish not found, can't add Squish Tk GUI tests")
endif(NOT SQUISH_FOUND)
endif(KWWidgets_USE_Squish)
endif(BUILD_TESTING AND KWWidgets_BUILD_TESTING)