From e5641a0cdc0eb0329cd6a7278a983d6a982ff36f Mon Sep 17 00:00:00 2001 From: wu-kan Date: Wed, 20 Apr 2022 07:17:03 +0000 Subject: [PATCH] format CMakeLists.txt --- CMakeLists.txt | 6 +++--- gen_input_gzip.py | 13 ------------ performance/CMakeLists.txt | 19 +++++++++--------- performance_test2021-private/CMakeLists.txt | 22 ++++++++++++--------- performance_test2021-public/CMakeLists.txt | 21 +++++++++++--------- 5 files changed, 38 insertions(+), 43 deletions(-) delete mode 100644 gen_input_gzip.py diff --git a/CMakeLists.txt b/CMakeLists.txt index abd2f20..e9b832e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_SUBDIRECTORY(performance) -ADD_SUBDIRECTORY(performance_test2021-private) -ADD_SUBDIRECTORY(performance_test2021-public) \ No newline at end of file +add_subdirectory(performance) +add_subdirectory(performance_test2021-private) +add_subdirectory(performance_test2021-public) diff --git a/gen_input_gzip.py b/gen_input_gzip.py deleted file mode 100644 index 3038e1a..0000000 --- a/gen_input_gzip.py +++ /dev/null @@ -1,13 +0,0 @@ -import sys -import os -import glob -import subprocess - - -def main(argv): - for filename in glob.glob(os.path.join(os.path.dirname(os.path.abspath(__file__)), "**", "*.in"), recursive=True): - subprocess.run(["gzip", "-9", filename]) - - -if __name__ == "__main__": - main(sys.argv) diff --git a/performance/CMakeLists.txt b/performance/CMakeLists.txt index 13ea406..9f83ffd 100644 --- a/performance/CMakeLists.txt +++ b/performance/CMakeLists.txt @@ -1,9 +1,10 @@ -FILE(GLOB mains *.sysu.c) -FOREACH(mainfile ${mains}) - # Get file name without directory - GET_FILENAME_COMPONENT(mainname ${mainfile} NAME_WE) - ADD_EXECUTABLE(sysu-tester-performance_${mainname} ${mainfile}) - TARGET_LINK_LIBRARIES(sysu-tester-performance_${mainname} sysy) - TARGET_INCLUDE_DIRECTORIES(sysu-tester-performance_${mainname} PRIVATE ${CMAKE_SOURCE_DIR}/librarian) - INSTALL(TARGETS sysu-tester-performance_${mainname}) -ENDFOREACH() \ No newline at end of file +file(GLOB mains *.sysu.c) +foreach(mainfile ${mains}) + # Get file name without directory + get_filename_component(mainname ${mainfile} NAME_WE) + add_executable(sysu-tester-performance_${mainname} ${mainfile}) + target_link_libraries(sysu-tester-performance_${mainname} sysy) + target_include_directories(sysu-tester-performance_${mainname} + PRIVATE ${CMAKE_SOURCE_DIR}/librarian) + install(TARGETS sysu-tester-performance_${mainname}) +endforeach() diff --git a/performance_test2021-private/CMakeLists.txt b/performance_test2021-private/CMakeLists.txt index fcc89c4..eb6aeab 100644 --- a/performance_test2021-private/CMakeLists.txt +++ b/performance_test2021-private/CMakeLists.txt @@ -1,9 +1,13 @@ -FILE(GLOB mains *.sysu.c) -FOREACH(mainfile ${mains}) - # Get file name without directory - GET_FILENAME_COMPONENT(mainname ${mainfile} NAME_WE) - ADD_EXECUTABLE(sysu-tester-performance_test2021-private_${mainname} ${mainfile}) - TARGET_LINK_LIBRARIES(sysu-tester-performance_test2021-private_${mainname} sysy) - TARGET_INCLUDE_DIRECTORIES(sysu-tester-performance_test2021-private_${mainname} PRIVATE ${CMAKE_SOURCE_DIR}/librarian) - INSTALL(TARGETS sysu-tester-performance_test2021-private_${mainname}) -ENDFOREACH() \ No newline at end of file +file(GLOB mains *.sysu.c) +foreach(mainfile ${mains}) + # Get file name without directory + get_filename_component(mainname ${mainfile} NAME_WE) + add_executable(sysu-tester-performance_test2021-private_${mainname} + ${mainfile}) + target_link_libraries(sysu-tester-performance_test2021-private_${mainname} + sysy) + target_include_directories( + sysu-tester-performance_test2021-private_${mainname} + PRIVATE ${CMAKE_SOURCE_DIR}/librarian) + install(TARGETS sysu-tester-performance_test2021-private_${mainname}) +endforeach() diff --git a/performance_test2021-public/CMakeLists.txt b/performance_test2021-public/CMakeLists.txt index d55037c..a9296d2 100644 --- a/performance_test2021-public/CMakeLists.txt +++ b/performance_test2021-public/CMakeLists.txt @@ -1,9 +1,12 @@ -FILE(GLOB mains *.sysu.c) -FOREACH(mainfile ${mains}) - # Get file name without directory - GET_FILENAME_COMPONENT(mainname ${mainfile} NAME_WE) - ADD_EXECUTABLE(sysu-tester-performance_test2021-public_${mainname} ${mainfile}) - TARGET_LINK_LIBRARIES(sysu-tester-performance_test2021-public_${mainname} sysy) - TARGET_INCLUDE_DIRECTORIES(sysu-tester-performance_test2021-public_${mainname} PRIVATE ${CMAKE_SOURCE_DIR}/librarian) - INSTALL(TARGETS sysu-tester-performance_test2021-public_${mainname}) -ENDFOREACH() \ No newline at end of file +file(GLOB mains *.sysu.c) +foreach(mainfile ${mains}) + # Get file name without directory + get_filename_component(mainname ${mainfile} NAME_WE) + add_executable(sysu-tester-performance_test2021-public_${mainname} + ${mainfile}) + target_link_libraries(sysu-tester-performance_test2021-public_${mainname} + sysy) + target_include_directories(sysu-tester-performance_test2021-public_${mainname} + PRIVATE ${CMAKE_SOURCE_DIR}/librarian) + install(TARGETS sysu-tester-performance_test2021-public_${mainname}) +endforeach()