From: Christian Kastner <ckk@debian.org>
Date: Sat, 26 Sep 2015 02:50:14 +0200
Subject: Link against libm

The libraries need to be explicitly linked against libm.

Last-Update: 2015-09-26
---
 src/CMakeLists.txt | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 878d886..e7b0245 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,6 +14,9 @@ floatfann.c
 ADD_LIBRARY(floatfann SHARED ${floatfann_LIB_SRCS})
 ADD_LIBRARY(floatfann_static STATIC ${floatfann_LIB_SRCS})
 
+TARGET_LINK_LIBRARIES(floatfann m)
+TARGET_LINK_LIBRARIES(floatfann_static m)
+
 SET_TARGET_PROPERTIES(floatfann PROPERTIES VERSION ${VERSION} SOVERSION 2 )
 SET_TARGET_PROPERTIES(floatfann_static PROPERTIES OUTPUT_NAME floatfann)
 INSTALL(TARGETS floatfann DESTINATION ${LIB_INSTALL_DIR} )
@@ -29,6 +32,9 @@ doublefann.c
 ADD_LIBRARY(doublefann SHARED ${doublefann_LIB_SRCS})
 ADD_LIBRARY(doublefann_static STATIC ${doublefann_LIB_SRCS})
 
+TARGET_LINK_LIBRARIES(doublefann m)
+TARGET_LINK_LIBRARIES(doublefann_static m)
+
 SET_TARGET_PROPERTIES(doublefann PROPERTIES VERSION ${VERSION} SOVERSION 2 )
 SET_TARGET_PROPERTIES(doublefann_static PROPERTIES OUTPUT_NAME doublefann)
 INSTALL(TARGETS doublefann DESTINATION ${LIB_INSTALL_DIR} )
@@ -44,6 +50,9 @@ fixedfann.c
 ADD_LIBRARY(fixedfann SHARED ${fixedfann_LIB_SRCS})
 ADD_LIBRARY(fixedfann_static STATIC ${fixedfann_LIB_SRCS})
 
+TARGET_LINK_LIBRARIES(fixedfann m)
+TARGET_LINK_LIBRARIES(fixedfann_static m)
+
 SET_TARGET_PROPERTIES(fixedfann PROPERTIES VERSION ${VERSION} SOVERSION 2 )
 SET_TARGET_PROPERTIES(fixedfann_static PROPERTIES OUTPUT_NAME fixedfann)
 INSTALL(TARGETS fixedfann DESTINATION ${LIB_INSTALL_DIR} )
@@ -59,6 +68,9 @@ floatfann.c
 ADD_LIBRARY(fann SHARED ${fann_LIB_SRCS})
 ADD_LIBRARY(fann_static STATIC ${fann_LIB_SRCS})
 
+TARGET_LINK_LIBRARIES(fann m)
+TARGET_LINK_LIBRARIES(fann_static m)
+
 SET_TARGET_PROPERTIES(fann PROPERTIES VERSION ${VERSION} SOVERSION 2 )
 SET_TARGET_PROPERTIES(fann_static PROPERTIES OUTPUT_NAME fann)
 INSTALL(TARGETS fann DESTINATION ${LIB_INSTALL_DIR} )
