From f3a3e6d4765f53e03724f567c8380a830a7429d9 Mon Sep 17 00:00:00 2001 From: dsmurrow <73198549+dsmurrow@users.noreply.github.com> Date: Wed, 29 Mar 2023 16:42:08 -0400 Subject: [PATCH] chore: created new subdirectory for cryptographic ciphers (#1237) * chore: moved rot13.c to cipher directory * chore: added CMakeLists.txt for /cipher * chore: added /cipher to root CMakeLists.txt --- CMakeLists.txt | 1 + cipher/CMakeLists.txt | 18 ++++++++++++++++++ {misc => cipher}/rot13.c | 0 3 files changed, 19 insertions(+) create mode 100644 cipher/CMakeLists.txt rename {misc => cipher}/rot13.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80a80b0f..eb925dc9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,7 @@ add_subdirectory(machine_learning) add_subdirectory(process_scheduling_algorithms) add_subdirectory(numerical_methods) add_subdirectory(math) +add_subdirectory(cipher) ## Configure Doxygen documentation system cmake_policy(SET CMP0054 NEW) diff --git a/cipher/CMakeLists.txt b/cipher/CMakeLists.txt new file mode 100644 index 00000000..c1d93bbc --- /dev/null +++ b/cipher/CMakeLists.txt @@ -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/cipher") # Folder name. Do NOT include `<>` + +endforeach( testsourcefile ${APP_SOURCES} ) diff --git a/misc/rot13.c b/cipher/rot13.c similarity index 100% rename from misc/rot13.c rename to cipher/rot13.c