Graphics-VTK
view release on metacpan or search on metacpan
Tk/pTk/Makefile.PL view on Meta::CPAN
use Config;
use ExtUtils::MakeMaker;
use Tk::MMtry qw(try_compile);
use Tk::MMutil;
# Get existing tk version for figuring generating the define
my $tkversion = eval 'use Tk; $Tk::VERSION;';
#print "tkversion = $tkversion\n";
if( $tkversion <= 800.022 ){
# Tkversion 800.022 needs the old style LandWidgetArg
# instead of the new LangWidgetObj call
$define .= ' -DUSE_LANGWIDGETARG';
}
# Find path to existing pTk include files
my $ptkPath = Tk::MMutil::findINC('Tk/pTk/Lang.h');
$ptkPath =~ s/\/Lang.h$//g;
my %configHash = %vtkConfigMacro;
$configHash{INC} = "-I../ $inc -I$ptkPath -I. -Ibitmaps ".$configHash{INC}; # Add another dir to include path
# Get list of objects, since makemaker won't autodetect the cxx files (also lets
# us control win32 files)
my @cxxfiles = ( qw/ vtkXRenderWindowTclInteractor vtkTkRenderWidget vtkTkImageViewerWidget vtkTkImageWindowWidget /);
# Remove X stuff if win32
if( $^O =~ /win32/i){
@cxxfiles = grep $_ !~ /vtkXRenderWindow/, @cxxfiles;
}
my @object = map "$_.o", @cxxfiles;
my @cfiles = map "$_.cxx",@cxxfiles;
# Include the extra tkWinX file if on win32 (to get the TkWinChildProc function)
if( $^O =~ /win32/i){
push @object, 'tkWinX.o';
push @cfiles, 'tkWinX.c';
}
Tk::MMutil::TkExtMakefile(
'NAME' => 'Tk::pTk',
'VERSION' => $VERSION,
'XS_VERSION'=> $VERSION,
'LINKTYPE' => 'static',
'OBJECT' => join(' ', @object),
'C' => join(' ', @cfiles),
macro => { WINARCH => $win_arch },
'DEFINE' => $define,
'clean' => {'FILES' => 'libpTk$(LIB_EXT)'},
# 'OPTIMIZE' => ' -g ', # Debug only
%configHash,
);
sub MY::top_targets {
my ($self) = @_;
local $_ = $self->MM::top_targets;
s/^(\$\(O_FILES\)\s*:.*)$/# Explicit dependancies provided\n# $1/m;
return $_;
}
sub MY::xs_c {
'
';
}
sub MY::post_initialize
{
my ($self) = @_;
my %mTk;
my $dir;
my @list;
if ($Tk::MMutil::IsWin32)
{ # only vtkTcl needed for everything
@list = qw( vtkTcl);
}
elsif ($win_arch eq 'open32')
{
@list = qw( vtkTcl);
}
( run in 2.107 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )