mirror of https://github.com/TheAlgorithms/C
chore: add `math` to CMake lists (#1236)
This commit is contained in:
parent
9997c8bdf0
commit
581dd22ae0
|
@ -63,6 +63,7 @@ add_subdirectory(project_euler)
|
||||||
add_subdirectory(machine_learning)
|
add_subdirectory(machine_learning)
|
||||||
add_subdirectory(process_scheduling_algorithms)
|
add_subdirectory(process_scheduling_algorithms)
|
||||||
add_subdirectory(numerical_methods)
|
add_subdirectory(numerical_methods)
|
||||||
|
add_subdirectory(math)
|
||||||
|
|
||||||
## Configure Doxygen documentation system
|
## Configure Doxygen documentation system
|
||||||
cmake_policy(SET CMP0054 NEW)
|
cmake_policy(SET CMP0054 NEW)
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
# If necessary, use the RELATIVE flag, otherwise each source file may be listed
|
||||||
|
# with full pathname. The RELATIVE flag makes it easier to extract an executable's name
|
||||||
|
# automatically.
|
||||||
|
|
||||||
|
file( GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c )
|
||||||
|
foreach( testsourcefile ${APP_SOURCES} )
|
||||||
|
string( REPLACE ".c" "" testname ${testsourcefile} ) # File type. Example: `.c`
|
||||||
|
add_executable( ${testname} ${testsourcefile} )
|
||||||
|
|
||||||
|
if(OpenMP_C_FOUND)
|
||||||
|
target_link_libraries(${testname} OpenMP::OpenMP_C)
|
||||||
|
endif()
|
||||||
|
if(MATH_LIBRARY)
|
||||||
|
target_link_libraries(${testname} ${MATH_LIBRARY})
|
||||||
|
endif()
|
||||||
|
install(TARGETS ${testname} DESTINATION "bin/math") # Folder name. Do NOT include `<>`
|
||||||
|
|
||||||
|
endforeach( testsourcefile ${APP_SOURCES} )
|
Loading…
Reference in New Issue