cmake: fix for <cmake-3.4

This commit is contained in:
Christoph Junghans
2018-06-22 17:05:55 -06:00
parent ce0f3daad6
commit 264e4fd3b1

View File

@ -461,6 +461,9 @@ endforeach(HEADER)
set(MATH_LIBRARIES "m" CACHE STRING "math library")
mark_as_advanced( MATH_LIBRARIES )
include(CheckLibraryExists)
if (CMAKE_VERSION VERSION_LESS "3.4")
enable_language(C) # check_library_exists isn't support with a c compiler before v3.4
endif()
foreach(FUNC sin cos)
check_library_exists(${MATH_LIBRARIES} ${FUNC} "" FOUND_${FUNC}_${MATH_LIBRARIES})
if(NOT FOUND_${FUNC}_${MATH_LIBRARIES})