CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
PROJECT(libalgebra)

#if you don't want the full compiler output, remove the following line

SET(CMAKE_VERBOSE_MAKEFILE ON)

#this is just a basic CMakeLists.txt, for more information see the cmake manpage

#add definitions, compiler switches, etc.
ADD_DEFINITIONS(-D DEBUG -Wall -Wextra -g -O0)
#ADD_DEFINITIONS(-O3)

SET(libalgebra_sources
	libalgebra.h
	Ring.h
	NonInvertibleElementException.h
	RingMismatchException.h
	RingMismatchException.cpp
	RingZn.h
	RingZn.cpp
	RingZnElement.h
	RingZnElement.cpp
	NonIntegralDomainException.h
	NonIntegralDomainException.cpp
	Field.h
	Field.cpp
	NonPrimeException.h
	NonPrimeException.cpp
	FieldElement.h
	ExtensionField.h
	DensePolynomial.h
	DimensionMismatchException.h
	DimensionMismatchException.cpp
	NonInvertibleMatrixException.h
	NonInvertibleMatrixException.cpp
	DenseMatrix.h
	NonCoprimeElementsException.h
	NonCoprimeElementsException.cpp
	GenericAlgorithms.h
	RingElement.h
	NonIrreductiblePolynomialException.h
	NonIrreductiblePolynomialException.cpp
	ExtensionFieldElement.h
	RingZ.h
	RingZ.cpp
	RingZElement.h
	RingZElement.cpp
	)
																	        
#build a shared library
ADD_LIBRARY(libalgebra SHARED ${libalgebra_sources} )

SET(libalgebratest_sources
  libalgebratest.cpp
  libalgebratest.h
)

#for testing the shared library you probably need some test app too
ADD_EXECUTABLE(libalgebratest ${libalgebratest_sources} )


SET(libraries libalgebra libgmp.so libgmpxx.so)

#need to link to some other libraries ? just add them here
TARGET_LINK_LIBRARIES(libalgebratest ${libraries})

#add an install target here
#INSTALL_FILES(...)
#INSTALL_PROGRAMS(...)
#INSTALL_TARGET(...)

INSTALL(TARGETS libalgebra LIBRARY DESTINATION /usr/lib)