Skip to content

Commit f3a3e6d

Browse files
authored
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
1 parent 581dd22 commit f3a3e6d

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ add_subdirectory(machine_learning)
6464
add_subdirectory(process_scheduling_algorithms)
6565
add_subdirectory(numerical_methods)
6666
add_subdirectory(math)
67+
add_subdirectory(cipher)
6768

6869
## Configure Doxygen documentation system
6970
cmake_policy(SET CMP0054 NEW)

cipher/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# If necessary, use the RELATIVE flag, otherwise each source file may be listed
2+
# with full pathname. The RELATIVE flag makes it easier to extract an executable's name
3+
# automatically.
4+
5+
file( GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c )
6+
foreach( testsourcefile ${APP_SOURCES} )
7+
string( REPLACE ".c" "" testname ${testsourcefile} ) # File type. Example: `.c`
8+
add_executable( ${testname} ${testsourcefile} )
9+
10+
if(OpenMP_C_FOUND)
11+
target_link_libraries(${testname} OpenMP::OpenMP_C)
12+
endif()
13+
if(MATH_LIBRARY)
14+
target_link_libraries(${testname} ${MATH_LIBRARY})
15+
endif()
16+
install(TARGETS ${testname} DESTINATION "bin/cipher") # Folder name. Do NOT include `<>`
17+
18+
endforeach( testsourcefile ${APP_SOURCES} )
File renamed without changes.

0 commit comments

Comments
 (0)