From: "Michael R. Crusoe" <crusoe@debian.org>
Date: Mon, 13 Jan 2020 13:18:24 +0100
Subject: Use the tsl-hopscotch-map cmake target

Forwarded: not-needed
---
 Makefile                    |  2 +-
 deps/DYNAMIC/CMakeLists.txt | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index e5b1b3c..cb8a429 100644
--- a/Makefile
+++ b/Makefile
@@ -661,7 +661,7 @@ $(INC_DIR)/lru_cache.h: $(DEP_DIR)/lru_cache/*.h $(DEP_DIR)/lru_cache/*.cc
 $(INC_DIR)/dynamic/dynamic.hpp: $(DYNAMIC_DIR)/include/dynamic/*.hpp $(DYNAMIC_DIR)/include/dynamic/*/*.hpp
 	+rm -Rf $(INC_DIR)/dynamic.hpp $(INC_DIR)/dynamic
 	# annoyingly doesn't have an install option on the cmake, so we manually move their external dependency headers
-	+cd $(CWD)/$(DYNAMIC_DIR) && rm -Rf build && mkdir -p build && cd build && export CXXFLAGS="$(CPPFLAGS) $(CXXFLAGS)" && cmake -DCMAKE_VERBOSE_MAKEFILE=ON .. && make && cp -r $(CWD)/$(DYNAMIC_DIR)/deps/hopscotch_map/include/* $(CWD)/$(INC_DIR)/
+	+cd $(CWD)/$(DYNAMIC_DIR) && rm -Rf build && mkdir -p build && cd build && export CXXFLAGS="$(CPPFLAGS) $(CXXFLAGS)" && cmake -DCMAKE_VERBOSE_MAKEFILE=ON .. && $(MAKE)
 	# Do the copy of the main file last so we can tell if this recipe failed and redo it.
 	# Otherwise we get dynamic.hpp without its deps
 	+mkdir -p $(INC_DIR)/dynamic && cp -r $(CWD)/$(DYNAMIC_DIR)/include/dynamic/* $(INC_DIR)/dynamic/
diff --git a/deps/DYNAMIC/CMakeLists.txt b/deps/DYNAMIC/CMakeLists.txt
index 839589f..ea13ef3 100644
--- a/deps/DYNAMIC/CMakeLists.txt
+++ b/deps/DYNAMIC/CMakeLists.txt
@@ -19,7 +19,8 @@ include_directories(${PROJECT_SOURCE_DIR}/include)
 #include_directories(${PROJECT_SOURCE_DIR}/include/dynamic/internal)
 #include_directories(${PROJECT_SOURCE_DIR}/include/dynamic/algorithms)
 #include_directories(${PROJECT_SOURCE_DIR}/include/dynamic/algorithms/cw-bwt)
-include_directories(${CMAKE_SOURCE_DIR}/deps/hopscotch_map/include)
+#include_directories(${CMAKE_SOURCE_DIR}/deps/hopscotch_map/include)
+find_package(tsl-hopscotch-map REQUIRED)
 
 message("Building in ${CMAKE_BUILD_TYPE} mode")
 
@@ -47,3 +48,12 @@ add_executable(rle_bwt rle_bwt.cpp)
 add_executable(cw-bwt cw-bwt.cpp)
 add_executable(benchmark benchmark.cpp)
 add_executable(wm_string wm_string.cpp)
+
+target_link_libraries(debug PRIVATE tsl::hopscotch_map)
+target_link_libraries(rle_lz77_v1 PRIVATE tsl::hopscotch_map)
+target_link_libraries(rle_lz77_v2 PRIVATE tsl::hopscotch_map)
+target_link_libraries(h0_lz77 PRIVATE tsl::hopscotch_map)
+target_link_libraries(rle_bwt PRIVATE tsl::hopscotch_map)
+target_link_libraries(cw-bwt PRIVATE tsl::hopscotch_map)
+target_link_libraries(benchmark PRIVATE tsl::hopscotch_map)
+target_link_libraries(wm_string PRIVATE tsl::hopscotch_map)
