mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-28 16:23:10 +03:00
check if math library is available and include if present
This commit is contained in:
parent
9165932928
commit
b1e1923580
@ -46,6 +46,8 @@ if(MSVC)
|
||||
add_compile_options(/Za)
|
||||
endif(MSVC)
|
||||
|
||||
find_library(MATH_LIBRARY m)
|
||||
|
||||
add_subdirectory(conversions)
|
||||
add_subdirectory(misc)
|
||||
add_subdirectory(project_euler)
|
||||
|
@ -16,12 +16,9 @@ foreach( testsourcefile ${APP_SOURCES} )
|
||||
if(OpenMP_C_FOUND)
|
||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_link_libraries(${testname} m)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_libraries(${testname} m)
|
||||
if(MATH_LIBRARY)
|
||||
target_link_libraries(${testname} ${MATH_LIBRARY})
|
||||
endif()
|
||||
|
||||
install(TARGETS ${testname} DESTINATION "bin/conversions")
|
||||
|
||||
endforeach( testsourcefile ${APP_SOURCES} )
|
||||
|
@ -16,10 +16,8 @@ foreach( testsourcefile ${APP_SOURCES} )
|
||||
if(OpenMP_C_FOUND)
|
||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_link_libraries(${testname} m)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_libraries(${testname} m)
|
||||
if(MATH_LIBRARY)
|
||||
target_link_libraries(${testname} ${MATH_LIBRARY})
|
||||
endif()
|
||||
install(TARGETS ${testname} DESTINATION "bin/misc")
|
||||
|
||||
|
@ -24,10 +24,9 @@ foreach( testsourcefile ${APP_SOURCES} )
|
||||
if(OpenMP_C_FOUND)
|
||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_link_libraries(${testname} m)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_libraries(${testname} m)
|
||||
|
||||
if(MATH_LIBRARY)
|
||||
target_link_libraries(${testname} ${MATH_LIBRARY})
|
||||
endif()
|
||||
install(TARGETS ${testname} DESTINATION "bin/numerical_methods")
|
||||
|
||||
|
@ -19,10 +19,9 @@ foreach( testsourcefile ${APP_SOURCES} )
|
||||
if(OpenMP_C_FOUND)
|
||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_link_libraries(${testname} m)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_libraries(${testname} m)
|
||||
|
||||
if(MATH_LIBRARY)
|
||||
target_link_libraries(${testname} ${MATH_LIBRARY})
|
||||
endif()
|
||||
install(TARGETS ${testname} DESTINATION "bin/misc")
|
||||
|
||||
|
@ -16,10 +16,8 @@ foreach( testsourcefile ${APP_SOURCES} )
|
||||
if(OpenMP_C_FOUND)
|
||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_link_libraries(${testname} m)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_libraries(${testname} m)
|
||||
if(MATH_LIBRARY)
|
||||
target_link_libraries(${testname} ${MATH_LIBRARY})
|
||||
endif()
|
||||
install(TARGETS ${testname} DESTINATION "bin/searching")
|
||||
|
||||
|
@ -16,10 +16,8 @@ foreach( testsourcefile ${APP_SOURCES} )
|
||||
if(OpenMP_C_FOUND)
|
||||
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_link_libraries(${testname} m)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_libraries(${testname} m)
|
||||
if(MATH_LIBRARY)
|
||||
target_link_libraries(${testname} ${MATH_LIBRARY})
|
||||
endif()
|
||||
install(TARGETS ${testname} DESTINATION "bin/sorting")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user