From 02bc4b465453bb80d36d8dbbbf8c6f7548dd1175 Mon Sep 17 00:00:00 2001 From: friendlyanon Date: Wed, 30 Dec 2020 22:00:19 +0000 Subject: [PATCH 1/3] Move the library header to the include folder --- .../consteval_huffman/consteval_huffman.hpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename consteval_huffman.hpp => include/consteval_huffman/consteval_huffman.hpp (100%) diff --git a/consteval_huffman.hpp b/include/consteval_huffman/consteval_huffman.hpp similarity index 100% rename from consteval_huffman.hpp rename to include/consteval_huffman/consteval_huffman.hpp From 2415a71e3c41316656d09c5ea7a3f24a21d812ca Mon Sep 17 00:00:00 2001 From: friendlyanon Date: Wed, 30 Dec 2020 22:07:09 +0000 Subject: [PATCH 2/3] Add root lists file --- CMakeLists.txt | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..277bb63 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,63 @@ +cmake_minimum_required(VERSION 3.14) + +project(consteval_huffman + VERSION 0.0.1 + DESCRIPTION "Compile-time Huffman coding compression using C++20" + HOMEPAGE_URL "https://github.com/tcsullivan/consteval-huffman" + LANGUAGES CXX) + +# ---- Warning guard ---- + +# Protect dependents from this project's warnings if the guard isn't disabled +set(consteval_huffman_warning_guard SYSTEM) +if(consteval_huffman_INCLUDE_WITHOUT_SYSTEM) + set(consteval_huffman_warning_guard "") +endif() + +# ---- Declare library ---- + +add_library(consteval_huffman INTERFACE) +add_library(tcsullivan::consteval_huffman ALIAS consteval_huffman) + +target_include_directories(consteval_huffman + ${consteval_huffman_warning_guard} + INTERFACE + "$") + +target_compile_features(consteval_huffman INTERFACE cxx_std_20) + +# ---- Install ---- + +include(CPack) +include(GNUInstallDirs) +include(CMakePackageConfigHelpers) + +set(consteval_huffman_directory "consteval_huffman-${PROJECT_VERSION}") +set(consteval_huffman_include_directory + "${CMAKE_INSTALL_INCLUDEDIR}/${consteval_huffman_directory}") + +install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/" + DESTINATION "${consteval_huffman_include_directory}" + COMPONENT consteval_huffman_Development) + +install(TARGETS consteval_huffman + EXPORT consteval_huffmanTargets + INCLUDES DESTINATION "${consteval_huffman_include_directory}") + +write_basic_package_version_file( + consteval_huffman-config-version.cmake + COMPATIBILITY SameMajorVersion + ARCH_INDEPENDENT) + +set(consteval_huffman_install_cmakedir + "${CMAKE_INSTALL_LIBDIR}/cmake/${consteval_huffman_directory}") + +install(FILES "${PROJECT_BINARY_DIR}/consteval_huffman-config-version.cmake" + DESTINATION "${consteval_huffman_install_cmakedir}" + COMPONENT consteval_huffman_Package) + +install(EXPORT consteval_huffmanTargets + FILE consteval_huffman-config.cmake + NAMESPACE tcsullivan:: + DESTINATION "${consteval_huffman_install_cmakedir}" + COMPONENT consteval_huffman_Package) From cc0f7a11515c641acd23985e72d1a8fce3c2a67b Mon Sep 17 00:00:00 2001 From: friendlyanon Date: Wed, 30 Dec 2020 22:07:53 +0000 Subject: [PATCH 3/3] Fix include path in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f1b5fe2..52bca89 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ A string of numbers 1 to 100 separated with spaces can be compressed to 64% of i ```cpp // 1. Include -#include "consteval_huffman.hpp" +#include // 2. Use _huffman suffix (data now stores compressed string) auto data = "This is my string of data"_huffman; // "\0\x1 Non-text data works too!"