[OTHER] Add process_scheduling_algorithms to CMake #148

Closed
opened 2026-01-29 15:05:38 +00:00 by claunia · 1 comment
Owner

Originally created by @Panquesito7 on GitHub (Nov 25, 2022).

What would you like to share?

All folders should be included in the CMake file to run the tests properly and make sure the code fits our standards.
This new folder, which is named process_scheduling_algorithms, isn't added to CMakeLists and should be added as soon as possible.

Steps to contribute

If you've already forked the repository, skip to step 3

  1. Fork the repository here.
  2. Make a new branch named cmake_folder.
  3. Clone the forked repository with Git.
git clone https://github.com/<your-username>/C.git
  1. Open the CMakeLists.txt file in the root directory of your forked repository.
  2. After line 63 (when the machine_learning folder is being added), add the following code:
add_subdirectory(process_scheduling_algorithms)
  1. Save the current file.
  2. Make a new file named CMakeLists.txt under the process_scheduling_algorithms directory.
  3. Copy the content below onto the file.
# 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} )

  1. Save the current file.
  2. Commit and push your changes.
  3. Create a pull request.
  4. You're done now! 🎉 You just have to wait until the maintainers check your pull request.

If you need any help, let us know here or on our Discord server! 🙂

Additional information

This is a good first issue. Please leave it open to first-time contributors and beginners.

Originally created by @Panquesito7 on GitHub (Nov 25, 2022). ### What would you like to share? All folders should be included in the CMake file to run the tests properly and make sure the code fits our standards. This new folder, which is named `process_scheduling_algorithms`, isn't added to CMakeLists and should be added as soon as possible. ### Steps to contribute _If you've already forked the repository, skip to step 3_ 1. Fork the repository [**here**](https://github.com/TheAlgorithms/C/fork). 2. Make a new branch named `cmake_folder`. 3. Clone the forked repository with [**Git**](https://git-scm.com). ```bash git clone https://github.com/<your-username>/C.git ``` 4. Open the `CMakeLists.txt` file in the root directory of your forked repository. 5. After line 63 (when the `machine_learning` folder is being added), add the following code: ```cmake add_subdirectory(process_scheduling_algorithms) ``` 6. Save the current file. 7. Make a new file named `CMakeLists.txt` under the `process_scheduling_algorithms` directory. 8. Copy the content below onto the file. ```cmake # 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} ) ``` 9. Save the current file. 10. Commit and push your changes. 11. Create a [**pull request**](https://github.com/TheAlgorithms/C/compare). 12. You're done now! 🎉 You just have to wait until the maintainers check your pull request. If you need any help, let us know here or on our [**Discord server**](https://the-algorithms.com/discord)! 🙂 ### Additional information This is a good first issue. Please leave it open to first-time contributors and beginners.
claunia added the enhancementgood first issue labels 2026-01-29 15:05:38 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 26, 2022):

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions[bot] commented on GitHub (Dec 26, 2022): This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#148