]> git.sesse.net Git - movit/commitdiff
Only run the pkg-config line for Eigen3 once.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 26 Nov 2012 23:41:35 +0000 (00:41 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 26 Nov 2012 23:41:35 +0000 (00:41 +0100)
Also, print an error message if pkg-config has failed.

Makefile

index f7ba81e7c7c12a188b43ba6dc3e57464fd79b033..1ab3d9cce46d84d754060e2e207fa0a95a068f70 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,13 @@
 GTEST_DIR = /usr/src/gtest
 
 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++
 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
 
 LDFLAGS=-lSDL -lSDL_image -lGL -lrt -lpthread
 RANLIB=ranlib