File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,6 @@ include (CheckCCompilerFlag)
81
81
include (CheckCXXSymbolExists )
82
82
include (CheckCSourceCompiles )
83
83
include (CheckCXXCompilerFlag )
84
- include (CheckLibraryExists )
85
84
86
85
#==============================================================================
87
86
# COMPILATION CHECKINGS and CONFIGURATION GENERATION
@@ -108,9 +107,8 @@ set (HAVE_UINT32_T ${SIZEOF_UINT32_T})
108
107
check_type_size ("unsigned int" SIZEOF_UNSIGNED_INT )
109
108
check_type_size ("unsigned long" SIZEOF_UNSIGNED_LONG )
110
109
111
- check_library_exists ("m" sqrt "" HAVE_LIBM )
112
- if (HAVE_LIBM )
113
- set (M_LIBRARY m )
110
+ find_library (M_LIBRARY m )
111
+ if (M_LIBRARY )
114
112
set (LIBS_PRIVATE "-l${M_LIBRARY} " )
115
113
endif ()
116
114
@@ -258,7 +256,9 @@ if (NLOPT_LUKSAN)
258
256
target_include_directories (${nlopt_lib} PRIVATE src/algs/luksan )
259
257
target_compile_definitions (${nlopt_lib} PRIVATE NLOPT_LUKSAN )
260
258
endif ()
261
- target_link_libraries (${nlopt_lib} ${M_LIBRARY} )
259
+ if (M_LIBRARY )
260
+ target_link_libraries (${nlopt_lib} ${M_LIBRARY} )
261
+ endif ()
262
262
set_target_properties (${nlopt_lib} PROPERTIES SOVERSION ${SO_MAJOR} )
263
263
set_target_properties (${nlopt_lib} PROPERTIES VERSION "${SO_MAJOR} .${SO_MINOR} .${SO_PATCH} " )
264
264
You can’t perform that action at this time.
0 commit comments