Skip to content

Commit

Permalink
Merge pull request #278 from Niautanor/improve-packagability
Browse files Browse the repository at this point in the history
Packaging improvements
  • Loading branch information
jlucas9 authored Aug 20, 2024
2 parents ee6d707 + 0989519 commit ae02d55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ IF(KMC_MDB_DB)
ENDIF(KMC_MDB_DB)

if(SYSTEM_INSTALL)
set(CMAKE_INSTALL_PREFIX /usr/local)
# The library will be installed to /usr/local unless overridden with
# -DCMAKE_INSTALL_PREFIX=/some/path
# See https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html
elseif(NOT DEFINED CFE_SYSTEM_PSPNAME)
# Not cFE / cFS
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ endif()

file(GLOB CRYPTO_INCLUDES ../include/*.h)
set_target_properties(crypto PROPERTIES PUBLIC_HEADER "${CRYPTO_INCLUDES}")
# This causes the library to be installed as libcryptolib.so while still being
# referred to as crypto from CMake. Without this, the library filename would be
# libcrypto.so which would conflict with openssl
set_target_properties(crypto PROPERTIES OUTPUT_NAME "cryptolib")

add_custom_command(TARGET crypto POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:crypto> ${PROJECT_BINARY_DIR}/lib/libcrypto.so
Expand Down

0 comments on commit ae02d55

Please sign in to comment.