Commit 3fce3b79 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*added tkdnd module to the build process

*enabled drag'n'drop in the main window/console, as well as patches
*implemented properly supported horizontal touchpad scroll (in addition to vertical and shift+vertical, which is being handled as horizontal)
*pd-gui fails to start (missing pd-l2ork in the $lib/bin/ directory)
parent 562e10e4
#N canvas 390 64 692 599 10;
#X msg 102 10 print;
#X obj 102 32 pdinfo;
#X msg 547 23 pi;
#X obj 547 45 pdinfo;
#X obj 547 103 *;
#X obj 393 103 * 3.14159;
#X obj 393 161 ==;
#X obj 547 72 t a a;
#X msg 393 23 3.14159;
#X obj 392 124 print worsepi*pi;
#X obj 393 183 print are_they_equal?;
#X obj 547 125 print betterpi*pi;
#X msg 55 76 audio-api;
#X msg 55 106 audio-apilist;
#X msg 55 136 audio-apilist-raw;
#X msg 55 166 audio-inchannels;
#X msg 55 246 audio-indevlist;
#X msg 55 276 audio-multidev-support;
#X msg 55 306 audio-outchannels;
#X msg 55 386 audio-outdevlist;
#X msg 55 416 blocksize;
#X msg 55 446 dir;
#X msg 235 76 midi-api;
#X msg 235 106 midi-apilist;
#X msg 235 186 midi-indevlist;
#X msg 235 266 midi-outdevlist;
#X msg 235 296 pi;
#X msg 235 326 samplerate;
#X msg 235 356 version;
#X msg 235 436 print;
#X obj 55 518 pdinfo;
#X obj 235 468 t a;
#X obj 55 540 print;
#X floatatom 81 192 5 0 0 0 - - -, f 5;
#X msg 55 216 audio-indev \$1;
#X msg 55 356 audio-outdev \$1;
#X floatatom 81 332 5 0 0 0 - - -, f 5;
#X floatatom 261 132 5 0 0 0 - - -, f 5;
#X floatatom 261 212 5 0 0 0 - - -, f 5;
#X msg 235 156 midi-indev \$1;
#X msg 235 236 midi-outdev \$1;
#X obj 637 86 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 643 46 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 351 408 canvasinfo;
#X msg 55 476 dsp-status;
#X msg 351 383 print;
#X msg 481 293 print;
#X obj 481 318 classinfo clip;
#X obj 481 502 classinfo classinfo;
#X msg 481 370 classinfo canvasinfo pdinfo;
#X obj 481 392 list split 1;
#X obj 521 415 t a;
#X msg 481 436 print \$1;
#X obj 481 458 unpack s s;
#X obj 481 480 list trim;
#N canvas 534 231 450 521 find-smallest-object-size 0;
#X obj 119 149 classinfo objectmaker;
#X msg 119 34 bang;
#X obj 119 86 until;
#X obj 119 108 f;
#X obj 159 108 + 1;
#X obj 119 171 route bang;
#X obj 36 119 b;
#X floatatom 224 123 5 0 0 0 - - -, f 5;
#X msg 223 87 0;
#X msg 186 196 symbol \$1;
#X obj 186 265 classinfo;
#X msg 186 240 size;
#X obj 186 298 moses;
#X msg 301 262 1e+07;
#X obj 36 380 f;
#X obj 186 218 t b a;
#X obj 119 56 trigger bang anything;
#X msg 330 48 size;
#X obj 330 92 print;
#X obj 47 451 print;
#X obj 330 70 classinfo max;
#X obj 166 330 t a a;
#X connect 0 0 5 0;
#X connect 1 0 16 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 0 0 0;
#X connect 3 0 7 0;
#X connect 4 0 3 1;
#X connect 5 0 6 0;
#X connect 5 1 9 0;
#X connect 6 0 2 1;
#X connect 6 0 14 0;
#X connect 8 0 3 1;
#X connect 9 0 15 0;
#X connect 10 0 12 0;
#X connect 11 0 10 0;
#X connect 12 0 21 0;
#X connect 13 0 12 1;
#X connect 14 0 19 0;
#X connect 15 0 11 0;
#X connect 15 1 10 1;
#X connect 16 0 2 0;
#X connect 16 1 8 0;
#X connect 16 1 13 0;
#X connect 17 0 20 0;
#X connect 20 0 18 0;
#X connect 21 0 14 1;
#X connect 21 1 12 1;
#X restore 256 519 pd find-smallest-object-size;
#X connect 0 0 1 0;
#X connect 2 0 3 0;
#X connect 2 0 42 0;
#X connect 3 0 7 0;
#X connect 3 0 41 0;
#X connect 4 0 6 1;
#X connect 4 0 11 0;
#X connect 5 0 6 0;
#X connect 5 0 9 0;
#X connect 6 0 10 0;
#X connect 7 0 4 0;
#X connect 7 1 4 1;
#X connect 8 0 5 0;
#X connect 12 0 30 0;
#X connect 13 0 30 0;
#X connect 14 0 30 0;
#X connect 15 0 30 0;
#X connect 16 0 30 0;
#X connect 17 0 30 0;
#X connect 18 0 30 0;
#X connect 19 0 30 0;
#X connect 20 0 30 0;
#X connect 21 0 30 0;
#X connect 22 0 31 0;
#X connect 23 0 31 0;
#X connect 24 0 31 0;
#X connect 25 0 31 0;
#X connect 26 0 31 0;
#X connect 27 0 31 0;
#X connect 28 0 31 0;
#X connect 29 0 31 0;
#X connect 30 0 32 0;
#X connect 31 0 30 0;
#X connect 33 0 34 0;
#X connect 34 0 30 0;
#X connect 35 0 30 0;
#X connect 36 0 35 0;
#X connect 37 0 39 0;
#X connect 38 0 40 0;
#X connect 39 0 31 0;
#X connect 40 0 31 0;
#X connect 44 0 30 0;
#X connect 45 0 43 0;
#X connect 46 0 47 0;
#X connect 49 0 50 0;
#X connect 50 0 52 0;
#X connect 50 1 51 0;
#X connect 51 0 50 0;
#X connect 52 0 53 0;
#X connect 53 0 54 0;
#X connect 53 1 48 1;
#X connect 54 0 48 0;
......@@ -194,10 +194,15 @@ tkpath:
make -C ../tkpath
cd ../src
tkdnd:
cd ../tkdnd && aclocal && autoconf && ./configure --prefix=$(prefix)
make -C ../tkdnd
cd ../src
BINARYMODE=@binarymode@
ABOUT_FILE=$(DESTDIR)$(pddocdir)/1.manual/1.introduction.txt
install: all tkpath
install: all tkpath tkdnd
install -d $(DESTDIR)$(libpdbindir)
install $(BIN_DIR)/$(GUINAME) $(DESTDIR)$(libpdbindir)/$(GUINAME)
install $(BIN_DIR)/pd-watchdog $(DESTDIR)$(libpdbindir)/pd-watchdog
......@@ -206,11 +211,16 @@ install: all tkpath
install -m644 helpbrowser.tcl $(DESTDIR)$(libpdbindir)/helpbrowser.tcl
install -m644 ../tkpath/library/tkpath.tcl $(DESTDIR)$(libpdbindir)/tkpath.tcl
install -m644 ../tkpath/libtkpath*so $(DESTDIR)$(libpdbindir)/
install -m644 ../tkdnd/library/tkdnd.tcl $(DESTDIR)$(libpdbindir)/tkdnd.tcl
install -m644 ../tkdnd/library/tkdnd_unix.tcl $(DESTDIR)$(libpdbindir)/tkdnd_unix.tcl
install -m644 ../tkdnd/library/tkdnd_compat.tcl $(DESTDIR)$(libpdbindir)/tkdnd_compat.tcl
install -m644 ../tkdnd/libtkdnd*so $(DESTDIR)$(libpdbindir)/
install -d $(DESTDIR)$(bindir)
install $(BINARYMODE) $(PDEXEC) $(DESTDIR)$(bindir)/@PDEXEC@
# kludge to allow pd~ to work by default in pd-l2ork
rm -f $(DESTDIR)$(libpddir)/pd
ln -sf $(bindir)/pd-l2ork $(DESTDIR)$(libpddir)/pd-l2ork
ln -sf $(bindir)/pd-l2ork $(DESTDIR)$(libpdbindir)/pd-l2ork
install -m755 $(BIN_DIR)/pdsend $(DESTDIR)$(bindir)/pdsend
install -m755 $(BIN_DIR)/pdreceive $(DESTDIR)$(bindir)/pdreceive
for dir in $(shell ls -1 ../doc | grep -v CVS); do \
......
......@@ -625,6 +625,7 @@ set auto_path [linsert $auto_path 0 [file dirname [info script]]]
package require helpbrowser
package require msgcat
package require tkpng
package require tkdnd
# official GNU gettext msgcat shortcut
proc _ {s} {return [::msgcat::mc $s]}
......@@ -844,7 +845,8 @@ wm withdraw .printout
bind .printout.frame.text <Button> {pdtk_update_root_edit_menu 0}
bind .printout.frame.text <<Selection>> {pdtk_update_root_edit_menu 1}
bind .printout <Control-Next> {menu_raisenextwindow}
bind .printout <Control-Next> {menu_raisenextwindow}
bind .printout <Control-Prior> {menu_raisepreviouswindow} ;# needs Tcl/Tk 8.5
bind .printout <Control-w> { .controls.switches.console invoke }
proc pdtk_update_root_edit_menu {value} {
......@@ -939,6 +941,11 @@ if { [info tclversion] >= 8.5 && $pd_nt == 0 } { wm resizable . 0 0 }
# Intercept closing the main pd window: MP 20060413:
wm protocol . WM_DELETE_WINDOW menu_quit
focus .
after idle {
dnd bindtarget . text/uri-list <Drop> { foreach file %D {open_file $file} }
dnd bindtarget .printout.frame text/uri-list <Drop> { foreach file %D {open_file $file} }
dnd bindtarget .printout.bar text/uri-list <Drop> { foreach file %D {open_file $file} }
}
############### set up global variables ################################
......@@ -1179,13 +1186,6 @@ proc open_file {filename} {
}
}
catch {
package require tkdnd
dnd bindtarget . text/uri-list <Drop> {
foreach file %D {open_file $file}
}
}
################## the "Message" menu command #########################
proc menu_send {} {
global pd_nt ctrl_key
......@@ -3251,10 +3251,8 @@ proc pdtk_canvas_new {name width height geometry editable} {
"pdtk_canvas_scroll $name.c x \[expr -abs(%D)/%D\]"
}}
catch {
dnd bindtarget $name.c text/uri-list <Drop> \
"pdtk_canvas_makeobjs $name %D %x %y"
}
#dnd bindtarget $name.c text/uri-list <Drop> { pdtk_canvas_makeobjs $name %D %x %y }
after idle [list dnd bindtarget $name text/uri-list <Drop> { foreach file %D {open_file $file} }]
# puts stderr "all done"
# after 1 [concat raise $name]
......@@ -3896,10 +3894,16 @@ proc pdtk_canvas_sendmiddleclick {name x y b f} {
proc pdtk_canvas_click {name x y b f} {
focus $name
set scroll_name [string trimright $name .c]
pdtk_canvas_detect_scroll_click $scroll_name $x $y $b $f
if { $::hit_scrollbar($scroll_name) == 0 } {
pdtk_canvas_sendclick $name $x $y $b $f
if { $b == 6 } {
pdtk_canvas_scroll $name x -1
} elseif { $b == 7 } {
pdtk_canvas_scroll $name x +1
} else {
set scroll_name [string trimright $name .c]
pdtk_canvas_detect_scroll_click $scroll_name $x $y $b $f
if { $::hit_scrollbar($scroll_name) == 0 } {
pdtk_canvas_sendclick $name $x $y $b $f
}
}
}
......@@ -4673,9 +4677,12 @@ proc pdtk_canvas_unmap {name} {
}
proc pdtk_canvas_makeobjs {name files x y} {
puts stderr pdtk_canvas_makeobjs
set c 0
for {set n 0} {$n < [llength $files]} {incr n} {
puts stderr "file $n"
if {[regexp {.*/(.+).pd$} [lindex $files $n] file obj] == 1} {
puts stderr "name obj"
pd $name obj $x [expr $y + ($c * 30)] [pdtk_enquote $obj] \;
incr c
}
......
......@@ -5,7 +5,7 @@ package ifneeded helpbrowser 0.1 [list source [file join $dir helpbrowser.tcl]]
namespace eval ::tkpath {
proc load_package {dir} {
load [file join $dir libtkpath0.3.2.so]
load [file join $dir libtkpath0.3.3.so]
# Allow optional redirect of library components.
# Only necessary for testing, but could be used elsewhere.
if {[info exists ::env(TKPATH_LIBRARY)]} {
......@@ -17,4 +17,8 @@ namespace eval ::tkpath {
package ifneeded tkpath 0.3.2 [list ::tkpath::load_package $dir]
package ifneeded tkdnd 2.6 \
"source \{$dir/tkdnd.tcl\} ; \
tkdnd::initialise \{$dir\} libtkdnd2.6.so tkdnd"
#*EOF*
#N canvas 433 184 450 300 10;
#X floatatom 222 141 5 0 0 0 - - -, f 5;
#N canvas 0 0 450 300 (subpatch) 0;
#X array array1 5 float 1;
#A 0 0 -0.0571432 1.11759e-08 -0.071429 -0.071429;
#X coords 0 1 5 -1 200 140 1;
#X restore 37 71 graph;
#N canvas 583 132 450 300 10;
#X obj 111 137 aaaaaaaaaaaaaaaa;
#X obj 96 51 key;
#X obj 96 72 print PRESS;
#X obj 174 72 print RELEASE;
#X obj 265 72 print NAME;
#X obj 265 51 keyname;
#X obj 152 104 l2ork_toggle_console 1;
#X obj 174 51 keyup;
#X connect 1 0 2 0;
#X connect 5 0 4 0;
#X connect 7 0 3 0;
#N canvas 398 77 540 345 10;
#X obj 306 86 tgl 15 0 aw www empty 17 7 0 10 -262144 -1 -1 0 1;
#X floatatom 357 86 5 0 0 0 - - -, f 5;
#X obj 306 109 metro 150;
#X obj 330 178 osc~ 1000;
#X obj 419 61 pddp/dsp;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-array 100 float 3;
#A 0 -0.417124 -0.294923 -0.167682 -0.0375716 0.0931824 0.222342 0.347701
0.467102 0.578517 0.680039 0.769909 0.846617 0.908847 0.955503 0.985827
0.99929 0.995632 0.974956 0.937604 0.884188 0.815659 0.733178 0.638135
0.532186 0.417132 0.294931 0.167691 0.0375801 -0.0931739 -0.222334
-0.347693 -0.467094 -0.57851 -0.680033 -0.769903 -0.846613 -0.908843
-0.955501 -0.985825 -0.999289 -0.995631 -0.974954 -0.937602 -0.884185
-0.815655 -0.733173 -0.638129 -0.532178 -0.417124 -0.294923 -0.167682
-0.0375714 0.0931826 0.222342 0.347701 0.467102 0.578517 0.680039 0.769909
0.846617 0.908847 0.955503 0.985827 0.99929 0.995632 0.974955 0.937604
0.884188 0.815659 0.733178 0.638135 0.532185 0.417132 0.294931 0.167691
0.0375799 -0.0931741 -0.222334 -0.347693 -0.467094 -0.57851 -0.680033
-0.769903 -0.846613 -0.908843 -0.955501 -0.985825 -0.999289 -0.995631
-0.974954 -0.937602 -0.884185 -0.815654 -0.733173 -0.638129 -0.532178
-0.417124 -0.294923 -0.167682 -0.0375712;
#X coords 0 1 99 -1 200 140 1;
#X restore 80 82 graph;
#X obj 306 205 tabwrite~ \$0-array;
#X obj 369 131 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X floatatom 259 158 5 0 0 0 - - -, f 5;
#X obj 203 241 tgl 62 0 asd asdad empty 17 7 0 10 -262144 -1 -1 0 1
;
#X connect 0 0 2 0;
#X connect 1 0 2 1;
#X connect 2 0 6 0;
#X connect 3 0 6 0;
#X connect 7 0 6 0;
#X connect 8 0 3 0;
#N struct IR-blobs float x float y symbol s;
#N canvas 782 106 450 300 10;
#N canvas 526 148 481 416 IR-data 0;
#X scalar IR-blobs 616 680 blob1 \;;
#X scalar IR-blobs 211 368 blob2 \;;
#X scalar IR-blobs 943 759 blob3 \;;
#X scalar IR-blobs 419 760 blob4 \;;
#X coords 0 0 1024 768 256 196 1;
#X restore 595 246 pd IR-data;
#N canvas 303 253 342 204 IR-blobs 0;
#X obj 39 34 struct IR-blobs float x float y symbol s;
#X obj 39 71 filledcurve 9 30 0 0 -30 -30 0 0 30 30 0;
#X obj 65 109 drawsymbol s -60 -75 0 1 blob;
#X restore 702 216 pd IR-blobs;
#N canvas 433 184 450 300 10;
#X floatatom 40 40 5 0 0 0 - - -, f 5;
#X floatatom 399 207 5 0 0 0 - - -, f 5;
#X obj 171 26 l2ork_toggle_scrollbars 0;
#X connect 0 0 1 0;
#N canvas 433 184 450 300 10;
#X obj 187 107 bng 21 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X msg 225 54 size \$1;
#X floatatom 225 28 5 0 0 0 - - -, f 5;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#N canvas 440 199 450 300 10;
#X floatatom 139 27 5 0 0 0 - - -, f 5;
#X floatatom 139 48 5 0 0 0 - - -, f 5;
#X floatatom 139 69 5 0 0 0 - - -, f 5;
#X floatatom 139 90 5 0 0 0 - - -, f 5;
#X floatatom 139 111 5 0 0 0 - - -, f 5;
#X floatatom 139 132 5 0 0 0 - - -, f 5;
#X floatatom 866 192 5 0 0 0 - - -, f 5;
#X floatatom 139 174 5 0 0 0 - - -, f 5;
#X floatatom 139 195 5 0 0 0 - - -, f 5;
#X floatatom 139 216 5 0 0 0 - - -, f 5;
#X floatatom 139 237 5 0 0 0 - - -, f 5;
#X floatatom 139 258 5 0 0 0 - - -, f 5;
#X floatatom 139 279 5 0 0 0 - - -, f 5;
#X floatatom 139 300 5 0 0 0 - - -, f 5;
#X floatatom 139 321 5 0 0 0 - - -, f 5;
#X floatatom 139 342 5 0 0 0 - - -, f 5;
#X floatatom 139 363 5 0 0 0 - - -, f 5;
#X floatatom 139 384 5 0 0 0 - - -, f 5;
#X floatatom 139 405 5 0 0 0 - - -, f 5;
#X floatatom 139 426 5 0 0 0 - - -, f 5;
#X floatatom 139 447 5 0 0 0 - - -, f 5;
#X floatatom 139 468 5 0 0 0 - - -, f 5;
#X floatatom 139 489 5 0 0 0 - - -, f 5;
#X floatatom 139 510 5 0 0 0 - - -, f 5;
#X floatatom 139 531 5 0 0 0 - - -, f 5;
#X floatatom 139 552 5 0 0 0 - - -, f 5;
#X floatatom 139 573 5 0 0 0 - - -, f 5;
#X floatatom 139 594 5 0 0 0 - - -, f 5;
#X floatatom 139 615 5 0 0 0 - - -, f 5;
#X floatatom 139 636 5 0 0 0 - - -, f 5;
#X floatatom 139 657 5 0 0 0 - - -, f 5;
#X floatatom 139 678 5 0 0 0 - - -, f 5;
#X floatatom 139 699 5 0 0 0 - - -, f 5;
#X floatatom 139 720 5 0 0 0 - - -, f 5;
#X floatatom 139 741 5 0 0 0 - - -, f 5;
#X floatatom 139 762 5 0 0 0 - - -, f 5;
#X floatatom 139 783 5 0 0 0 - - -, f 5;
#X floatatom 139 804 5 0 0 0 - - -, f 5;
#X floatatom 139 825 5 0 0 0 - - -, f 5;
#X floatatom 139 846 5 0 0 0 - - -, f 5;
#X floatatom 139 867 5 0 0 0 - - -, f 5;
#X floatatom 139 888 5 0 0 0 - - -, f 5;
#X floatatom 139 909 5 0 0 0 - - -, f 5;
#X floatatom 139 930 5 0 0 0 - - -, f 5;
#X floatatom 139 951 5 0 0 0 - - -, f 5;
#X floatatom 139 972 5 0 0 0 - - -, f 5;
#X floatatom 139 993 5 0 0 0 - - -, f 5;
#X floatatom 632 227 5 0 0 0 - - -, f 5;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
#X connect 16 0 17 0;
#X connect 17 0 18 0;
#X connect 18 0 19 0;
#X connect 19 0 20 0;
#X connect 20 0 21 0;
#X connect 21 0 22 0;
#X connect 22 0 23 0;
#X connect 23 0 24 0;
#X connect 24 0 25 0;
#X connect 25 0 26 0;
#X connect 26 0 27 0;
#X connect 27 0 28 0;
#X connect 28 0 29 0;
#X connect 29 0 30 0;
#X connect 30 0 31 0;
#X connect 31 0 32 0;
#X connect 32 0 33 0;
#X connect 33 0 34 0;
#X connect 34 0 35 0;
#X connect 35 0 36 0;
#X connect 36 0 37 0;
#X connect 37 0 38 0;
#X connect 38 0 39 0;
#X connect 39 0 40 0;
#X connect 40 0 41 0;
#X connect 41 0 42 0;
#X connect 42 0 43 0;
#X connect 43 0 44 0;
#X connect 44 0 45 0;
#X connect 45 0 46 0;
#N canvas 433 184 450 300 10;
#X obj 125 78 bng 15 250 50 0 a b empty 17 7 0 10 -262144 -1 -1;
#X obj 142 78 tgl 15 0 a b empty 17 7 0 10 -262144 -1 -1 1 1;
#N canvas 433 184 450 300 10;
#N canvas 678 267 450 300 aaa 0;
#X obj 139 137 Scope~ 100 53 256 3 128 -1 1 0 0 0 0 102 255 51 135
135 135 0;
#X coords 0 -1 1 1 178 113 1 100 100;
#X restore 155 161 pd aaa;
#N canvas 433 184 450 300 10;
#X obj 105 29 loadbang;
#X obj 105 50 window_name;
#X symbolatom 105 71 10 0 0 0 - - -, f 10;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
CMAKE_MINIMUM_REQUIRED ( VERSION 2.6 )
## Ensure that the variable PKG_OS_ARCH exists! If undefined, define it with
## the value "x86_32"
IF ( NOT PKG_OS_ARCH )
SET ( PKG_OS_ARCH x86_32 )
ENDIF ( NOT PKG_OS_ARCH )
## ===========================================================================
## No need to modify below this point!
## ===========================================================================
SET ( NO_MSVCRT ON )
## ===========================================================================
## Project Information
## ===========================================================================
PROJECT ( tkdnd )
## Package version information:
SET ( PKG_NAME ${PROJECT_NAME} )
SET ( PKG_MAJOR_VERSION 2 )
SET ( PKG_MINOR_VERSION 6 )
SET ( PKG_BUILD_VERSION 0 )
## Author:
SET ( PKG_VENDOR "Georgios Petasis" )
## ===========================================================================
## Project sources
## ===========================================================================
IF ( WIN32 )
## True under windows (32bit, 64bit, Cygwin)...
INCLUDE_DIRECTORIES ( win )
SET ( CMAKE_SHARED_LIBRARY_PREFIX lib )
SET ( PKG_SOURCES win/TkDND_OleDND.cpp )
ADD_DEFINITIONS ( -DUNICODE )
ADD_DEFINITIONS ( -D_UNICODE )
# ADD_DEFINITIONS ( -D_MBCS )
ELSE ( WIN32 )
## Unix and OS X...
IF ( APPLE )
INCLUDE_DIRECTORIES ( macosx )
ADD_DEFINITIONS ( -DMAC_TK_COCOA )
ADD_DEFINITIONS ( -std=gnu99 )
ADD_DEFINITIONS ( -x objective-c )
ADD_DEFINITIONS ( -fobjc-gc )
LINK_LIBRARIES ( -framework Cocoa -framework Carbon )
SET ( PKG_SOURCES unix/macosx/macdnd.m )
ELSE ( APPLE )
INCLUDE_DIRECTORIES ( unix )
SET ( PKG_SOURCES unix/TkDND_XDND.c unix/tkUnixSelect.c unix/Cursors.c )
MESSAGE ( STATUS "Searching for X11..." )
FIND_PACKAGE ( X11 REQUIRED )
IF ( X11_FOUND )
INCLUDE_DIRECTORIES ( ${X11_INCLUDE_DIR} )
LINK_LIBRARIES ( ${X11_LIBRARIES} )
MESSAGE ( STATUS " X11_INCLUDE_DIR: " ${X11_INCLUDE_DIR} )
MESSAGE ( STATUS " X11_LIBRARIES: " ${X11_LIBRARIES} )
ENDIF ( X11_FOUND )
ENDIF ( APPLE )
ENDIF ( WIN32 )
##
## If we are building with MINGW, link statically to its libs...
##
IF ( MINGW )
INCLUDE ( CheckCCompilerFlag )
CHECK_C_COMPILER_FLAG ( -static-libgcc FLAG_static_libgcc )
CHECK_C_COMPILER_FLAG ( -static-libstdc++ FLAG_static_libstdcpp )
IF ( FLAG_static_libgcc )
MESSAGE ( STATUS " -> MINGW detected: adding -static-libgcc!" )
SET ( CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc" )
ENDIF ( FLAG_static_libgcc )
IF ( FLAG_static_libstdcpp )
MESSAGE ( STATUS " -> MINGW detected: adding -static-libstdc++!" )
SET ( CMAKE_SHARED_LINKER_FLAGS
"${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++" )
ENDIF (FLAG_static_libstdcpp )
ENDIF ( MINGW )
## Arange project version information...
SET ( PKG_VERSION
"${PKG_MAJOR_VERSION}.${PKG_MINOR_VERSION}.${PKG_BUILD_VERSION}" )
SET ( PKG_VERSION
"${PKG_MAJOR_VERSION}.${PKG_MINOR_VERSION}" )
SET ( PKG_NAME_VERSION ${PKG_NAME}-${PKG_VERSION} )
SET ( PKG_HOME_DIR ${PROJECT_SOURCE_DIR} )
## Greet the user...
MESSAGE ( STATUS "===========================================================" )
MESSAGE ( STATUS " Welcome to the ${PKG_NAME} ${PKG_VERSION} build system!" )
MESSAGE ( STATUS " * Selected generator: ${CMAKE_GENERATOR}" )
MESSAGE ( STATUS " * Operating System ID: "
${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_VERSION}-${CMAKE_SYSTEM_PROCESSOR} )
MESSAGE ( STATUS " * Installation Directory: " ${CMAKE_INSTALL_PREFIX} )
MESSAGE ( STATUS "===========================================================" )
## Allow additional cmake modules in the modules directory...
SET ( CMAKE_MODULE_PATH cmake/modules )
## ===========================================================================
## Utilities
## ===========================================================================
SET ( RM ${CMAKE_COMMAND} -E remove -f )
SET ( RM_FLAGS )
SET ( RMDIR ${CMAKE_COMMAND} -E remove_directory )
SET ( RMDIR_FLAGS )
SET ( MKDIR ${CMAKE_COMMAND} -E make_directory )
SET ( CP ${CMAKE_COMMAND} -E copy )
## ===========================================================================
## Locate Tcl/Tk
## ===========================================================================
MESSAGE ( STATUS "Searching for Tcl/Tk..." )
FIND_PACKAGE ( TCL REQUIRED )
FIND_PACKAGE ( TclStub REQUIRED )
## Tcl/Tk info (useful for debug purposes)...
# MESSAGE ( STATUS " TCL_TCLSH: " ${TCL_TCLSH} )
MESSAGE ( STATUS " TCL_INCLUDE_PATH: " ${TCL_INCLUDE_PATH} )
MESSAGE ( STATUS " TCL_STUB_LIBRARY: " ${TCL_STUB_LIBRARY} )
# MESSAGE ( STATUS " TCL_LIBRARY: " ${TCL_LIBRARY} )
# MESSAGE ( STATUS " TK_WISH: " ${TK_WISH} )
MESSAGE ( STATUS " TK_INCLUDE_PATH: " ${TK_INCLUDE_PATH} )
MESSAGE ( STATUS " TK_STUB_LIBRARY: " ${TK_STUB_LIBRARY} )
# MESSAGE ( STATUS " TK_LIBRARY: " ${TK_LIBRARY} )
## Enable Tcl/Tk stubs globally...
ADD_DEFINITIONS ( -DUSE_TCL_STUBS )