Skip to content

Commit 453bb30

Browse files
committed
Refactored C++ project layout.
1 parent f74371f commit 453bb30

File tree

16 files changed

+42
-55
lines changed

16 files changed

+42
-55
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,4 @@ venv.bak/
106106
#intellij
107107
.idea
108108
cmake-build-debug/
109+
cmake-build-release/

cp_cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ endif()
3737
add_subdirectory(src)
3838

3939
# ----- Add subdirectory for unit tests -----
40-
add_subdirectory(test)
40+
#add_subdirectory(test)

cp_cpp/src/CMakeLists.txt

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,4 @@
1-
# ----- Chapter 1 Library -----
2-
add_library(chapter1_lib "")
3-
4-
target_sources(chapter1_lib
5-
PRIVATE
6-
chapter_1.cpp
7-
PUBLIC
8-
${CMAKE_CURRENT_LIST_DIR}/chapter_1.h
9-
)
10-
11-
target_include_directories(
12-
chapter1_lib
13-
PUBLIC
14-
${CMAKE_CURRENT_LIST_DIR}
15-
)
16-
17-
# ----- Chapter 1 Executable -----
18-
add_executable(
19-
chapter_1_main
20-
chapter_1_main.cpp)
21-
22-
target_link_libraries(chapter_1_main
23-
chapter1_lib)
24-
25-
# ----- Data Structures Library -----
26-
add_library(data_structs_lib "")
27-
target_sources(data_structs_lib
28-
PRIVATE
29-
data_structures.cpp
30-
PUBLIC
31-
${CMAKE_CURRENT_LIST_DIR}/data_structures.h
32-
)
33-
target_include_directories(
34-
data_structs_lib
35-
PUBLIC
36-
${CMAKE_CURRENT_LIST_DIR}
37-
)
38-
39-
# ----- Data Structure Executable -----
40-
add_executable(data_structs_main
41-
data_structures_main.cpp)
42-
43-
target_link_libraries(data_structs_main
44-
data_structs_lib)
45-
46-
# ----- Tryout Executable -----
47-
add_executable(tryout_main
48-
tryout_main.cpp)
1+
add_subdirectory(crack_coding_interview)
2+
add_subdirectory(data_structures)
3+
add_subdirectory(algorithms)
4+
add_subdirectory(miscellaneous)
File renamed without changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ----- Chapter 1 Library -----
2+
add_library(chapter1_lib)
3+
4+
target_sources(chapter1_lib
5+
PRIVATE
6+
chapter_1.cpp
7+
PUBLIC
8+
${CMAKE_CURRENT_SOURCE_DIR}/chapter_1.h
9+
)
10+
11+
# ----- Chapter 1 Executable -----
12+
add_executable(chapter_1_main
13+
chapter_1_main.cpp)
14+
15+
target_link_libraries(chapter_1_main
16+
chapter1_lib)

cp_cpp/src/chapter_1.cpp renamed to cp_cpp/src/crack_coding_interview/chapter_1.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//
2-
// Created by matt on 07.11.19.
3-
//
4-
51
#include <iostream>
62
#include <unordered_set> // Hash Set - O(1) insert & access
73
#include <map> // Hash Map - O(1) insert & access
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ----- Data Structures Library -----
2+
add_library(data_structs_lib)
3+
target_sources(data_structs_lib
4+
PRIVATE
5+
data_structures.cpp
6+
PUBLIC
7+
${CMAKE_CURRENT_SOURCE_DIR}/data_structures.h
8+
)
9+
10+
# ----- Data Structure Executable -----
11+
add_executable(data_structs_main
12+
data_structures_main.cpp)
13+
14+
target_link_libraries(data_structs_main
15+
data_structs_lib)

cp_cpp/src/data_structures/data_structures.cpp

Whitespace-only changes.

0 commit comments

Comments
 (0)