Skip to content

Commit 0594923

Browse files
authored
feat: add the bit_manipulation directory to CMake (#1991)
* feat: add `bit_manipulation` to CMake * updating DIRECTORY.md
1 parent 60fc753 commit 0594923

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ add_subdirectory(geometry)
3737
add_subdirectory(graphics)
3838
add_subdirectory(probability)
3939
add_subdirectory(backtracking)
40+
add_subdirectory(bit_manipulation)
4041
add_subdirectory(data_structures)
4142
add_subdirectory(machine_learning)
4243
add_subdirectory(numerical_methods)

DIRECTORY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* [Rat Maze](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/backtracking/rat_maze.cpp)
1111
* [Subarray Sum](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/backtracking/subarray_sum.cpp)
1212
* [Subset Sum](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/backtracking/subset_sum.cpp)
13-
* [Sudoku Solve](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/backtracking/sudoku_solve.cpp)
13+
* [Sudoku Solver](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/backtracking/sudoku_solver.cpp)
1414
* [Wildcard Matching](https://github.com/TheAlgorithms/C-Plus-Plus/blob/master/backtracking/wildcard_matching.cpp)
1515

1616
## Bit Manipulation

bit_manipulation/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. RELATIVE may makes it easier to extract an executable name
3+
# automatically.
4+
file( GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp )
5+
# file( GLOB APP_SOURCES ${CMAKE_SOURCE_DIR}/*.c )
6+
# AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} APP_SOURCES)
7+
foreach( testsourcefile ${APP_SOURCES} )
8+
# I used a simple string replace, to cut off .cpp.
9+
string( REPLACE ".cpp" "" testname ${testsourcefile} )
10+
add_executable( ${testname} ${testsourcefile} )
11+
12+
set_target_properties(${testname} PROPERTIES LINKER_LANGUAGE CXX)
13+
if(OpenMP_CXX_FOUND)
14+
target_link_libraries(${testname} OpenMP::OpenMP_CXX)
15+
endif()
16+
install(TARGETS ${testname} DESTINATION "bin/bit_manipulation")
17+
18+
endforeach( testsourcefile ${APP_SOURCES} )

0 commit comments

Comments
 (0)