
# add the library that runs 
add_library(Afn afnio.cc alphabet.cc binomial.cc block.cc dheap.cc 
		    digraph.cc dms_typ.cc dsets.cc guide.cc 
		    haussler.cc histogram.cc iarray.cc karlin.cc list.cc 
		    mheap.cc mlist.cc nrutil.cc olist.cc order.cc 
		    probability.cc pseg.cc random.cc randwalk.cc swaln.cc 
		    segment.cc seqset.cc sequence.cc set_typ.cc sqheap.cc 
		    stack.cc sumstat.cc table.cc wdigraph.cc idp_typ.cc 
		    cls_typ.cc rff_typ.cc license.cc bstree.cc bpps_typ.cc 
		    bpps_quick.cc pps_typ.cc rst_typ.cc pat_typ.cc 
		    clr_typ.cc ptrn_typ.cc fdt_typ.cc )

# state that anybody linking to us needs to include the current source dir
# to find MathFunctions.h, while we don't.
include_directories("${PROJECT_SOURCE_DIR}/lib/libafn"
	"${PROJECT_SOURCE_DIR}/lib/include"
	) 

target_include_directories(Afn
                           INTERFACE
                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
                            $<INSTALL_INTERFACE:include>
                           )

target_compile_definitions(Afn PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")

# define the symbol stating we are using the declspec(dllexport) when
# building on windows
target_compile_definitions(Afn PRIVATE "EXPORTING_MYMATH")

# setup the version numbering
set_property(TARGET Afn PROPERTY VERSION "1.0.0")
set_property(TARGET Afn PROPERTY SOVERSION "1")

install(TARGETS Afn
        DESTINATION lib
        EXPORT AfnTargets)
install(FILES MathFunctions.h DESTINATION include)

