ADD_DEFINITIONS("-DOFFDIR=\"${OCOOKIEDIR}\"")
ADD_DEFINITIONS("-DFORTDIR=\"${COOKIEDIR}\"")
+INCLUDE(CheckIncludeFile)
+CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H)
+
+IF ("${HAVE_REGEX_H}")
+ ADD_DEFINITIONS("-DHAVE_REGEX_H")
+ ADD_DEFINITIONS("-DBSD_REGEX")
+ENDIF()
+
+ADD_DEFINITIONS("-DHAVE_STDBOOL")
SET (COOKIES
art
ascii-art
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Path qw/mkpath rmtree/;
+use Cwd qw/getcwd/;
+
+use Test::More tests => 1;
+sub do_system
+{
+ my ($args) = @_;
+
+ my $cmd = $args->{cmd};
+ print "Running [@$cmd]\n";
+ if ( system(@$cmd) )
+ {
+ die "Running [@$cmd] failed!";
+ }
+}
+
+{
+ my $cwd = getcwd();
+ my $build_dir = "$cwd/fortune-m-build-dir";
+ my $inst_dir = "$cwd/fortune-m-INST_DIR";
+ rmtree($build_dir, 0, 0);
+ rmtree($inst_dir, 0, 0);
+ mkpath ($build_dir);
+ chdir $build_dir;
+ do_system({cmd => ['cmake', "-DCMAKE_INSTALL_PREFIX=$inst_dir", $ENV{SRC_DIR}]});
+ do_system({cmd => ['make']});
+ do_system({cmd => ['make', 'install',]});
+
+ my $text = `'$inst_dir/games/fortune' -m giants`;
+
+ # TEST
+ like ($text, qr/Newton/, 'fortune -m matched');
+}