# cmake build file for Mathomatic, originally contributed by Jonathan Stark.
# Produces the normal version of Mathomatic with readline support.
# Do not use unless you wish create a project with cmake.

cmake_minimum_required(VERSION 2.6)

project(mathomatic)

file(READ VERSION FV)
string(STRIP ${FV} MATHOMATIC_VERSION)
message(STATUS VERSION: ${MATHOMATIC_VERSION})
add_definitions(-DUNIX -DREADLINE -DVERSION="${MATHOMATIC_VERSION}")

add_executable(mathomatic
	includes.h
	am.h
	altproto.h
	externs.h
	license.h
	complex.h
	proto.h	
	globals.c
	complex.c	
	poly.c
	super.c
	am.c
	factor.c
	help.c	
	list.c	
	unfactor.c
	complex_lib.c
	factor_int.c
	main.c	
	simplify.c
	cmds.c	
	diff.c	
	gcd.c	
	integrate.c
	parse.c	
	solve.c
)

set_target_properties(mathomatic PROPERTIES COMPILE_FLAGS "-O3")
target_link_libraries(mathomatic -lm -lreadline)
