# Copyright (C) 2006 International Business Machines and others.
# All Rights Reserved.
# This file is distributed under the Eclipse Public License.

## $Id: Makefile.am 1600 2013-07-11 13:41:11Z tkr $

# Author:  Andreas Waechter           IBM    2006-04-13

AUTOMAKE_OPTIONS = foreign

########################################################################
#                      unitTest for CoinUtils                          #
########################################################################

noinst_PROGRAMS = unitTest

unitTest_SOURCES = \
	CoinLpIOTest.cpp \
	CoinDenseVectorTest.cpp \
	CoinErrorTest.cpp \
	CoinIndexedVectorTest.cpp \
	CoinMessageHandlerTest.cpp \
	CoinModelTest.cpp \
	CoinMpsIOTest.cpp \
	CoinPackedMatrixTest.cpp \
	CoinPackedVectorTest.cpp \
	CoinShallowPackedVectorTest.cpp \
	unitTest.cpp

# List libraries to link into binary
unitTest_LDADD = ../src/libCoinUtils.la $(COINUTILSLIB_LIBS)

# Dependencies of binaries are mostly the same as given in LDADD, but with -l and -L removed
unitTest_DEPENDENCIES = ../src/libCoinUtils.la $(COINUTILSLIB_DEPENDENCIES)

# Here list all include flags, relative to this "srcdir" directory.  This
# "cygpath" stuff is necessary to compile with native compilers on Cygwin
AM_CPPFLAGS = -I`$(CYGPATH_W) $(srcdir)/../src`

# This line is necessary to allow VPATH compilation
DEFAULT_INCLUDES = -I. -I`$(CYGPATH_W) $(srcdir)` -I$(top_builddir)/src

unittestflags =
if COIN_HAS_SAMPLE
  unittestflags += -mpsDir=`$(CYGPATH_W) $(SAMPLE_DATA)`
endif
if COIN_HAS_NETLIB
  unittestflags += -netlibDir=`$(CYGPATH_W) $(NETLIB_DATA)` -testModel=adlittle.mps
endif

test: unitTest$(EXEEXT)
	./unitTest$(EXEEXT) $(unittestflags)

.PHONY: test

########################################################################
#                          Cleaning stuff                              #
########################################################################

# Here we list everything that is not generated by the compiler, e.g.,
# output files of a program

DISTCLEANFILES = \
	byColumn.mps  byRow.mps  CoinMpsIoTest.mps  string.mps
