include (CheckCCompilerFlag)\r
include (CheckCXXSymbolExists)\r
include (CheckCXXCompilerFlag)\r
+include (CheckLibraryExists)\r
\r
#==============================================================================\r
# COMPILATION CHECKINGS and CONFIGURATION GENERATION\r
check_type_size ("unsigned int" SIZEOF_UNSIGNED_INT)\r
check_type_size ("unsigned long" SIZEOF_UNSIGNED_LONG)\r
\r
+check_library_exists ("m" sqrt "" HAVE_LIBM)\r
+if (HAVE_LIBM)\r
+ set (M_LIBRARY m)\r
+endif()\r
+\r
if (NOT DEFINED HAVE_FPCLASSIFY)\r
message(STATUS "Looking for fpclassify")\r
file (WRITE ${CMAKE_BINARY_DIR}/fpclassify.c "#include <math.h>\n")\r
\r
set (nlopt_lib nlopt${NLOPT_SUFFIX})\r
add_library (${nlopt_lib} ${NLOPT_SOURCES})\r
+target_link_libraries (${nlopt_lib} ${M_LIBRARY})\r
+\r
set_target_properties (${nlopt_lib} PROPERTIES SOVERSION 0)\r
set_target_properties (${nlopt_lib} PROPERTIES VERSION 0.9.0)\r
\r