summaryrefslogtreecommitdiff
path: root/apt-pkg/CMakeLists.txt
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-09-27 17:32:24 +0200
committerJulian Andres Klode <jak@debian.org>2016-11-22 22:57:46 +0100
commitabfd07702c1bbc3ed489d015b43db58ab677af0c (patch)
treef0a17b59197362b909f2b70ddbc6f3fed5049778 /apt-pkg/CMakeLists.txt
parente07f3d5a9ed2870a0e2909cc1e5e55e826086c53 (diff)
TagSection: Introduce functions for looking up by key ids
Introduce a new enum class and add functions that can do a lookup with that enum class. This uses triehash.
Diffstat (limited to 'apt-pkg/CMakeLists.txt')
-rw-r--r--apt-pkg/CMakeLists.txt15
1 files changed, 14 insertions, 1 deletions
diff --git a/apt-pkg/CMakeLists.txt b/apt-pkg/CMakeLists.txt
index 1b493c819..25ed13ec3 100644
--- a/apt-pkg/CMakeLists.txt
+++ b/apt-pkg/CMakeLists.txt
@@ -3,6 +3,19 @@ include_directories(${PROJECT_BINARY_DIR}/include/apt-pkg)
add_definitions("-DAPT_PKG_EXPOSE_STRING_VIEW")
+file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/apt-pkg/)
+execute_process(COMMAND ${PROJECT_SOURCE_DIR}/triehash/triehash.pl
+ --ignore-case
+ --header ${PROJECT_BINARY_DIR}/include/apt-pkg/tagfile-keys.h
+ --code ${CMAKE_CURRENT_BINARY_DIR}/tagfile-keys.cc
+ --enum-class
+ --enum-name pkgTagSection::Key
+ --function-name pkgTagHash
+ --include "<apt-pkg/tagfile.h>"
+ ${CMAKE_CURRENT_SOURCE_DIR}/tagfile-keys.list)
+set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "tagfile-keys.list")
+
+
# Set the version of the library
execute_process(COMMAND awk -v ORS=. "/^\#define APT_PKG_M/ {print \$3}"
COMMAND sed "s/\\.\$//"
@@ -17,7 +30,7 @@ message(STATUS "Building libapt-pkg ${MAJOR} (release ${MINOR})")
set(APT_PKG_MAJOR ${MAJOR} PARENT_SCOPE) # exporting for methods/CMakeLists.txt
# Definition of the C++ files used to build the library
-file(GLOB_RECURSE library "*.cc")
+file(GLOB_RECURSE library "*.cc" "${CMAKE_CURRENT_BINARY_DIR}/tagfile-keys.cc")
file(GLOB_RECURSE headers "*.h")
# Create a library using the C++ files