Skip to content

Commit

Permalink
Fix libtomcrypt detection in CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Dec 24, 2021
1 parent 24c56b3 commit 329dcde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,12 @@ else()

option(WITH_LIBTOMCRYPT "Use system LibTomCrypt library" OFF)
if(WITH_LIBTOMCRYPT)
set(LINK_LIBS ${LINK_LIBS} tomcrypt)
include(FindPkgConfig)
pkg_check_modules(PC_LIBTOMCRYPT libtomcrypt REQUIRED)
find_path(LIBTOMCRYPT_INCLUDE_DIR NAMES tomcrypt.h HINTS ${PC_LIBTOMCRYPT_INCLUDE_DIRS} REQUIRED)
find_library(LIBTOMCRYPT_LIBRARY NAMES tomcrypt HINTS ${PC_LIBTOMCRYPT_LIBRARY_DIRS} REQUIRED)
set(LINK_LIBS ${LINK_LIBS} ${LIBTOMCRYPT_LIBRARY})
include_directories(${LIBTOMCRYPT_INCLUDE_DIR})
else()
set(SRC_ADDITIONAL_FILES ${TOMCRYPT_FILES} ${TOMMATH_FILES})
endif()
Expand Down

0 comments on commit 329dcde

Please sign in to comment.