More verbose errors about BOOST_DIR

This commit is contained in:
Alessandro Ranellucci 2018-11-05 19:45:16 +01:00
parent d9c1d459c5
commit 734e6e7ef9

View File

@ -93,11 +93,16 @@ if (defined $ENV{BOOST_INCLUDEDIR}) {
} elsif (defined $ENV{BOOST_DIR}) { } elsif (defined $ENV{BOOST_DIR}) {
# User might have provided a path relative to the Build.PL in the main directory # User might have provided a path relative to the Build.PL in the main directory
foreach my $subdir ($ENV{BOOST_DIR}, "../$ENV{BOOST_DIR}", "$ENV{BOOST_DIR}/include", "../$ENV{BOOST_DIR}/include") { foreach my $subdir ($ENV{BOOST_DIR}, "../$ENV{BOOST_DIR}", "$ENV{BOOST_DIR}/include", "../$ENV{BOOST_DIR}/include") {
next if $subdir =~ m{^\.\.//};
printf "Checking %s: ", $subdir;
if (-d $subdir) { if (-d $subdir) {
push @boost_include, $subdir; push @boost_include, $subdir;
print "found\n";
} else {
print "not found\n";
} }
} }
die "Invalid BOOST_DIR: no such directory\n" if !@boost_include; die "Invalid BOOST_DIR: could not find Boost headers\n" if !@boost_include;
} else { } else {
# Boost library was not defined by the environment. # Boost library was not defined by the environment.
# Try to guess at some default paths. # Try to guess at some default paths.
@ -123,11 +128,16 @@ if (defined $ENV{BOOST_LIBRARYPATH}) {
} elsif (defined $ENV{BOOST_DIR}) { } elsif (defined $ENV{BOOST_DIR}) {
# User might have provided a path relative to the Build.PL in the main directory # User might have provided a path relative to the Build.PL in the main directory
foreach my $subdir ("$ENV{BOOST_DIR}/stage/lib", "../$ENV{BOOST_DIR}/stage/lib") { foreach my $subdir ("$ENV{BOOST_DIR}/stage/lib", "../$ENV{BOOST_DIR}/stage/lib") {
next if $subdir =~ m{^\.\.//};
printf "Checking %s: ", $subdir;
if (-d $subdir) { if (-d $subdir) {
push @boost_libs, $subdir; push @boost_libs, $subdir;
print "found\n";
} else {
print "not found\n";
} }
} }
die "Invalid BOOST_DIR: no such directory\n" if !@boost_libs; die "Invalid BOOST_DIR: could not find Boost libs\n" if !@boost_libs;
} else { } else {
# Boost library was not defined by the environment. # Boost library was not defined by the environment.
# Try to guess at some default paths. # Try to guess at some default paths.