From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: Use the tsl-hopscotch-map cmake target
--- vg.orig/deps/DYNAMIC/CMakeLists.txt
+++ vg/deps/DYNAMIC/CMakeLists.txt
@@ -14,23 +14,12 @@
 
 include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
 
-# hopscotch_map
-ExternalProject_Add(hopscotch_map
-  GIT_REPOSITORY "https://github.com/Tessil/hopscotch-map.git"
-  BUILD_IN_SOURCE TRUE
-  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR} # TODO ADD static build flag
-  UPDATE_COMMAND ""
-  INSTALL_COMMAND ""
-  BUILD_COMMAND ""
-  CONFIGURE_COMMAND "")
-ExternalProject_Get_property(hopscotch_map INSTALL_DIR)
-set(hopscotch_map_INCLUDE "${INSTALL_DIR}/src/hopscotch_map/include/")
+find_package(tsl-hopscotch-map REQUIRED)
 
 include_directories(${PROJECT_SOURCE_DIR}/include)
 include_directories(${PROJECT_SOURCE_DIR}/include/internal)
 include_directories(${PROJECT_SOURCE_DIR}/include/algorithms)
 include_directories(${PROJECT_SOURCE_DIR}/include/algorithms/cw-bwt)
-include_directories(${INSTALL_DIR}/src/hopscotch_map/include)
 
 message("Building in ${CMAKE_BUILD_TYPE} mode")
 
@@ -54,11 +43,10 @@
 add_executable(cw-bwt cw-bwt.cpp)
 add_executable(benchmark benchmark.cpp)
 
-add_dependencies(debug hopscotch_map)
-add_dependencies(rle_lz77_v1 hopscotch_map)
-add_dependencies(rle_lz77_v2 hopscotch_map)
-add_dependencies(h0_lz77 hopscotch_map)
-add_dependencies(rle_bwt hopscotch_map)
-add_dependencies(cw-bwt hopscotch_map)
-add_dependencies(benchmark hopscotch_map)
-
+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)
--- vg.orig/Makefile
+++ vg/Makefile
@@ -431,7 +431,7 @@
 $(INC_DIR)/dynamic/dynamic.hpp: $(DYNAMIC_DIR)/include/*.hpp $(DYNAMIC_DIR)/include/internal/*.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 hopscotch_map-prefix/src/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/* $(INC_DIR)/dynamic
