From b0179ea3032ccfd59999dab740528e03dfc4a99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E9=B1=BC=E4=B8=B8?= Date: Wed, 27 May 2026 13:06:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20CMakeLists.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- process_scheduling_algorithms/CMakeLists.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/process_scheduling_algorithms/CMakeLists.txt b/process_scheduling_algorithms/CMakeLists.txt index 1d2a56e057..78ee04b7df 100644 --- a/process_scheduling_algorithms/CMakeLists.txt +++ b/process_scheduling_algorithms/CMakeLists.txt @@ -1,11 +1,6 @@ -# 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} ) @@ -17,4 +12,4 @@ foreach( testsourcefile ${APP_SOURCES} ) endif() install(TARGETS ${testname} DESTINATION "bin/process_scheduling_algorithms") -endforeach( testsourcefile ${APP_SOURCES} ) +endforeach( testsourcefile ${APP_SOURCES} ) \ No newline at end of file From d545636bfbd3c53ef465afeac156cbbf636cdc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E9=B1=BC=E4=B8=B8?= Date: Wed, 27 May 2026 13:08:50 +0800 Subject: [PATCH 2/2] Add process_scheduling_algorithms to CMake Add subdirectory in root CMakeLists.txt - Create CMakeLists.txt for process_scheduling_algorithms - Configure compilation for .c files in the directory --- process_scheduling_algorithms/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/process_scheduling_algorithms/CMakeLists.txt b/process_scheduling_algorithms/CMakeLists.txt index 78ee04b7df..1d2a56e057 100644 --- a/process_scheduling_algorithms/CMakeLists.txt +++ b/process_scheduling_algorithms/CMakeLists.txt @@ -1,6 +1,11 @@ +# 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} ) @@ -12,4 +17,4 @@ foreach( testsourcefile ${APP_SOURCES} ) endif() install(TARGETS ${testname} DESTINATION "bin/process_scheduling_algorithms") -endforeach( testsourcefile ${APP_SOURCES} ) \ No newline at end of file +endforeach( testsourcefile ${APP_SOURCES} )