summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2023-04-06 10:48:27 +0300
committerPanu Matilainen <pmatilai@redhat.com>2023-04-06 11:07:04 +0300
commit7184fb80137363e39d79e2b5a0eb2c4fb060cc2e (patch)
tree666802b59a9c05d3f1fd0c3e01791e514a9029a3
parentc61da285a14e98592e5cac1966b169d178868471 (diff)
downloadrpm-7184fb80137363e39d79e2b5a0eb2c4fb060cc2e.tar.gz
Handle IMA as an imported target
Most of our dependencies are imported targets already, so while for just one site this isn't actually any shorter in terms of LoC it's more consistent with the surroundings in the consuming site, and more so if we ever need to link to this from some other place.
-rw-r--r--CMakeLists.txt6
-rw-r--r--sign/CMakeLists.txt3
2 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e965688a3..c65914558 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -196,6 +196,12 @@ if (WITH_IMAEVM)
list(APPEND REQFUNCS lsetxattr)
find_path(IMA_INCLUDE_DIR NAMES imaevm.h REQUIRED)
find_library(IMA_LIBRARY NAMES imaevm REQUIRED)
+
+ add_library(IMA::IMA UNKNOWN IMPORTED)
+ set_target_properties(IMA::IMA PROPERTIES
+ IMPORTED_LOCATION "${IMA_LIBRARY}"
+ INTERFACE "${IMA_HEADER}"
+ )
endif()
find_program(__FIND_DEBUGINFO find-debuginfo)
diff --git a/sign/CMakeLists.txt b/sign/CMakeLists.txt
index ff3270b97..854cef1a6 100644
--- a/sign/CMakeLists.txt
+++ b/sign/CMakeLists.txt
@@ -8,8 +8,7 @@ target_sources(librpmsign PRIVATE rpmgensig.c)
target_link_libraries(librpmsign PUBLIC librpmio librpm)
if (WITH_IMAEVM)
target_sources(librpmsign PRIVATE rpmsignfiles.c)
- target_link_libraries(librpmsign PRIVATE ${IMA_LIBRARY})
- target_include_directories(librpmsign PRIVATE ${IMA_INCLUDE_DIR})
+ target_link_libraries(librpmsign PRIVATE IMA::IMA)
endif()
if (WITH_FSVERITY)
target_sources(librpmsign PRIVATE rpmsignverity.c)