diff --git a/CMakeLists.txt b/CMakeLists.txt index 22167ab..526e937 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,11 +5,14 @@ project(Sudoku) set(CMAKE_CXX_STANDARD 20) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(SOURCE_FILES +set(LIB_SOURCE_FILES solver/cell.cpp solver/puzzle.cpp solver/solver.cpp - solver.cpp ) -add_executable(solver ${SOURCE_FILES}) +add_library(solver ${LIB_SOURCE_FILES}) +target_include_directories(solver PUBLIC "${PROJECT_SOURCE_DIR}") + +add_executable(test_solver solver.cpp) +target_link_libraries(test_solver PUBLIC solver) diff --git a/solver/cell.cpp b/solver/cell.cpp index 38a8bbf..f0339a1 100644 --- a/solver/cell.cpp +++ b/solver/cell.cpp @@ -1,4 +1,4 @@ -#include "cell.h" +#include "solver/cell.h" #include #include diff --git a/solver/puzzle.cpp b/solver/puzzle.cpp index f77c226..eac6636 100644 --- a/solver/puzzle.cpp +++ b/solver/puzzle.cpp @@ -1,4 +1,4 @@ -#include "puzzle.h" +#include "solver/puzzle.h" #include #include diff --git a/solver/puzzle.h b/solver/puzzle.h index 9138c69..9c3d7e2 100644 --- a/solver/puzzle.h +++ b/solver/puzzle.h @@ -3,7 +3,7 @@ #include #include -#include "cell.h" +#include "solver/cell.h" class Puzzle { public: diff --git a/solver/solver.cpp b/solver/solver.cpp index ebf74b1..5370f3d 100644 --- a/solver/solver.cpp +++ b/solver/solver.cpp @@ -1,4 +1,4 @@ -#include "solver.h" +#include "solver/solver.h" #include diff --git a/solver/solver.h b/solver/solver.h index f59bb03..ef66894 100644 --- a/solver/solver.h +++ b/solver/solver.h @@ -1,6 +1,6 @@ #pragma once -#include "puzzle.h" +#include "solver/puzzle.h" class Solver { public: