From 9cae3a759486e8dd608b5ff3c119b3a98f86ac6c Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 27 Nov 2012 00:41:35 +0100 Subject: [PATCH] Only run the pkg-config line for Eigen3 once. Also, print an error message if pkg-config has failed. --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f7ba81e..1ab3d9c 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,13 @@ GTEST_DIR = /usr/src/gtest +EIGEN_CXXFLAGS := $(shell pkg-config --cflags eigen3) +ifeq ($(EIGEN_CXXFLAGS),) +$(error Empty EIGEN_CXXFLAGS. You probably need to install Eigen3) +endif + CC=gcc CXX=g++ -CXXFLAGS=-Wall -g -I$(GTEST_DIR)/include $(shell pkg-config --cflags eigen3 ) +CXXFLAGS=-Wall -g -I$(GTEST_DIR)/include $(EIGEN_CXXFLAGS) LDFLAGS=-lSDL -lSDL_image -lGL -lrt -lpthread RANLIB=ranlib -- 2.39.2