basic signing capabilities - initial implementation, lots of kinks to work out
parent
c733bb634c
commit
9642581509
|
@ -5,9 +5,9 @@ set(CMAKE_CXX_STANDARD 20)
|
||||||
|
|
||||||
# Set DPM_ROOT_DIR based on whether this is a standalone build or part of the main build
|
# Set DPM_ROOT_DIR based on whether this is a standalone build or part of the main build
|
||||||
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
set(DPM_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")
|
set(DPM_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")
|
||||||
else()
|
else()
|
||||||
set(DPM_ROOT_DIR "${CMAKE_SOURCE_DIR}")
|
set(DPM_ROOT_DIR "${CMAKE_SOURCE_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Find OpenSSL
|
# Find OpenSSL
|
||||||
|
@ -16,48 +16,57 @@ find_package(OpenSSL REQUIRED)
|
||||||
# Find LibArchive
|
# Find LibArchive
|
||||||
find_package(LibArchive REQUIRED)
|
find_package(LibArchive REQUIRED)
|
||||||
|
|
||||||
|
# Find GPGME
|
||||||
|
find_path(GPGME_INCLUDE_DIR gpgme.h)
|
||||||
|
find_library(GPGME_LIBRARY NAMES gpgme)
|
||||||
|
|
||||||
|
if(NOT GPGME_INCLUDE_DIR OR NOT GPGME_LIBRARY)
|
||||||
|
message(FATAL_ERROR "GPGME library not found. Please install libgpgme-dev or equivalent package.")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Module version - used by DPM
|
# Module version - used by DPM
|
||||||
add_library(build MODULE
|
add_library(build MODULE
|
||||||
build.cpp
|
build.cpp
|
||||||
src/helpers.cpp
|
src/helpers.cpp
|
||||||
src/cli_parsers.cpp
|
src/cli_parsers.cpp
|
||||||
src/commands.cpp
|
src/commands.cpp
|
||||||
src/staging.cpp
|
src/staging.cpp
|
||||||
src/signing.cpp
|
src/signing.cpp
|
||||||
src/checksums.cpp
|
src/checksums.cpp
|
||||||
src/metadata.cpp
|
src/metadata.cpp
|
||||||
src/sealing.cpp
|
src/sealing.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Set output properties
|
# Set output properties
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
build PROPERTIES
|
build PROPERTIES
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
SUFFIX ".so"
|
SUFFIX ".so"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Include directories
|
# Include directories
|
||||||
target_include_directories(build PRIVATE
|
target_include_directories(build PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
${DPM_ROOT_DIR}
|
${DPM_ROOT_DIR}
|
||||||
${OPENSSL_INCLUDE_DIR}
|
${OPENSSL_INCLUDE_DIR}
|
||||||
${LibArchive_INCLUDE_DIRS}
|
${LibArchive_INCLUDE_DIRS}
|
||||||
|
${GPGME_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Link with filesystem library and OpenSSL
|
# Link with libraries
|
||||||
target_link_libraries(build stdc++fs ${OPENSSL_LIBRARIES} ${LibArchive_LIBRARIES})
|
target_link_libraries(build stdc++fs ${OPENSSL_LIBRARIES} ${LibArchive_LIBRARIES} ${GPGME_LIBRARY})
|
||||||
|
|
||||||
# Standalone version - used for debugging
|
# Standalone version - used for debugging
|
||||||
add_executable(build_standalone
|
add_executable(build_standalone
|
||||||
build.cpp
|
build.cpp
|
||||||
src/helpers.cpp
|
src/helpers.cpp
|
||||||
src/cli_parsers.cpp
|
src/cli_parsers.cpp
|
||||||
src/commands.cpp
|
src/commands.cpp
|
||||||
src/staging.cpp
|
src/staging.cpp
|
||||||
src/signing.cpp
|
src/signing.cpp
|
||||||
src/checksums.cpp
|
src/checksums.cpp
|
||||||
src/metadata.cpp
|
src/metadata.cpp
|
||||||
src/sealing.cpp
|
src/sealing.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# Define the BUILD_STANDALONE macro for the standalone build
|
# Define the BUILD_STANDALONE macro for the standalone build
|
||||||
|
@ -65,17 +74,18 @@ target_compile_definitions(build_standalone PRIVATE BUILD_STANDALONE)
|
||||||
|
|
||||||
# Include directories for standalone
|
# Include directories for standalone
|
||||||
target_include_directories(build_standalone PRIVATE
|
target_include_directories(build_standalone PRIVATE
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
${DPM_ROOT_DIR}
|
${DPM_ROOT_DIR}
|
||||||
${OPENSSL_INCLUDE_DIR}
|
${OPENSSL_INCLUDE_DIR}
|
||||||
${LibArchive_INCLUDE_DIRS}
|
${LibArchive_INCLUDE_DIRS}
|
||||||
|
${GPGME_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Link with filesystem library and OpenSSL for standalone
|
# Link with libraries for standalone
|
||||||
target_link_libraries(build_standalone stdc++fs ${OPENSSL_LIBRARIES} ${LibArchive_LIBRARIES})
|
target_link_libraries(build_standalone stdc++fs ${OPENSSL_LIBRARIES} ${LibArchive_LIBRARIES} ${GPGME_LIBRARY})
|
||||||
|
|
||||||
# Set the output name for the standalone executable
|
# Set the output name for the standalone executable
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
build_standalone PROPERTIES
|
build_standalone PROPERTIES
|
||||||
OUTPUT_NAME "build_debug"
|
OUTPUT_NAME "build_debug"
|
||||||
)
|
)
|
Loading…
Reference in New Issue