Skip to content

Commit

Permalink
feat: add process_scheduling_algorithms to CMake (TheAlgorithms#1193)
Browse files Browse the repository at this point in the history
* Update CMakeLists.txt

* Create CMakeLists.txt

Co-authored-by: David Leal <[email protected]>
  • Loading branch information
saadh123 and Panquesito7 authored Dec 28, 2022
1 parent b8a8807 commit 60310de
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ add_subdirectory(conversions)
add_subdirectory(client_server)
add_subdirectory(project_euler)
add_subdirectory(machine_learning)
add_subdirectory(process_scheduling_algorithms)
add_subdirectory(numerical_methods)

## Configure Doxygen documentation system
Expand Down
20 changes: 20 additions & 0 deletions process_scheduling_algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# If necessary, use the RELATIVE flag, otherwise each source file may be listed
# with full pathname. RELATIVE may makes it easier to extract an executable name
# automatically.
file( GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c )
# file( GLOB APP_SOURCES ${CMAKE_SOURCE_DIR}/*.c )
# AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} APP_SOURCES)
foreach( testsourcefile ${APP_SOURCES} )
# I used a simple string replace, to cut off .cpp.
string( REPLACE ".c" "" testname ${testsourcefile} )
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/process_scheduling_algorithms")

endforeach( testsourcefile ${APP_SOURCES} )

0 comments on commit 60310de

Please sign in to comment.