From 29f588a91a202a6d515dfb7383ecacc25668b7f7 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 6 Feb 2013 01:09:27 +0100 Subject: [PATCH] Make building the demo app optional if SDL_image and/or libpng12 are not found. --- Makefile.in | 7 ++++++- configure.ac | 11 ++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index f98bbfc..4656959 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,6 +6,7 @@ includedir = @includedir@ libdir = @libdir@ datarootdir = @datarootdir@ datadir = @datadir@ +with_demo_app = @with_demo_app@ CC=@CC@ CXX=@CXX@ @@ -62,7 +63,11 @@ TESTS=effect_chain_test $(TESTED_INPUTS:=_test) $(TESTED_EFFECTS:=_test) LIB_OBJS=effect_util.o util.o widgets.o effect.o effect_chain.o init.o $(INPUTS:=.o) $(EFFECTS:=.o) # Default target: -all: $(TESTS) demo +all: libmovit.a $(TESTS) + +ifeq ($(with_demo_app),yes) +all: demo +endif # Google Test and other test library functions. TEST_OBJS = gtest-all.o gtest_sdl_main.o test_util.o diff --git a/configure.ac b/configure.ac index f044a17..d21b85a 100644 --- a/configure.ac +++ b/configure.ac @@ -7,10 +7,15 @@ AC_PROG_CXX PKG_CHECK_MODULES([Eigen3], [eigen3]) PKG_CHECK_MODULES([GLEW], [glew]) -# These are only needed for the demo app. +# Needed for unit tests and the demo app. PKG_CHECK_MODULES([SDL], [sdl]) -PKG_CHECK_MODULES([SDL_image], [SDL_image]) -PKG_CHECK_MODULES([libpng], [libpng12]) + +# These are only needed for the demo app. +with_demo_app=yes +PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])]) +PKG_CHECK_MODULES([libpng], [libpng12], [], [with_demo_app=no; AC_MSG_WARN([libpng12 not found, demo program will not be built])]) + +AC_SUBST([with_demo_app]) AC_CONFIG_FILES([Makefile movit.pc]) AC_OUTPUT -- 2.39.2