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