diff --git a/CMakeLists.txt b/CMakeLists.txt index c7033c5..e2e1b97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,13 +5,16 @@ project( VERSION 0.1.0 LANGUAGES CXX) +add_subdirectory(lib_vector_search) + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") include(ExportCompileCommands) include(sccache) -add_executable(VectorSearch main.cpp word_list_generator.cpp timer.cpp - linear_finder.cpp parallel_finder.cpp) +add_executable(VectorSearch main.cpp) + +target_link_libraries(VectorSearch lib_vector_search) target_compile_features(VectorSearch PUBLIC cxx_std_20) diff --git a/lib_vector_search/CMakeLists.txt b/lib_vector_search/CMakeLists.txt new file mode 100644 index 0000000..570b0ab --- /dev/null +++ b/lib_vector_search/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.20) + +project( + lib_vector_search + VERSION 0.1.0 + LANGUAGES CXX) + +add_library( + lib_vector_search STATIC src/word_list_generator.cpp src/timer.cpp + src/linear_finder.cpp src/parallel_finder.cpp) + +target_include_directories(lib_vector_search + PUBLIC ${PROJECT_SOURCE_DIR}/include) + +target_compile_features(lib_vector_search PUBLIC cxx_std_20) diff --git a/finder.h b/lib_vector_search/include/finder.h similarity index 100% rename from finder.h rename to lib_vector_search/include/finder.h diff --git a/linear_finder.h b/lib_vector_search/include/linear_finder.h similarity index 100% rename from linear_finder.h rename to lib_vector_search/include/linear_finder.h diff --git a/parallel_finder.h b/lib_vector_search/include/parallel_finder.h similarity index 100% rename from parallel_finder.h rename to lib_vector_search/include/parallel_finder.h diff --git a/timer.h b/lib_vector_search/include/timer.h similarity index 100% rename from timer.h rename to lib_vector_search/include/timer.h diff --git a/word_list_generator.h b/lib_vector_search/include/word_list_generator.h similarity index 100% rename from word_list_generator.h rename to lib_vector_search/include/word_list_generator.h diff --git a/linear_finder.cpp b/lib_vector_search/src/linear_finder.cpp similarity index 100% rename from linear_finder.cpp rename to lib_vector_search/src/linear_finder.cpp diff --git a/parallel_finder.cpp b/lib_vector_search/src/parallel_finder.cpp similarity index 100% rename from parallel_finder.cpp rename to lib_vector_search/src/parallel_finder.cpp diff --git a/timer.cpp b/lib_vector_search/src/timer.cpp similarity index 100% rename from timer.cpp rename to lib_vector_search/src/timer.cpp diff --git a/word_list_generator.cpp b/lib_vector_search/src/word_list_generator.cpp similarity index 100% rename from word_list_generator.cpp rename to lib_vector_search/src/word_list_generator.cpp