Skip to content

Commit 329dcde

Browse files
committed
Fix libtomcrypt detection in CMake
1 parent 24c56b3 commit 329dcde

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,12 @@ else()
296296

297297
option(WITH_LIBTOMCRYPT "Use system LibTomCrypt library" OFF)
298298
if(WITH_LIBTOMCRYPT)
299-
set(LINK_LIBS ${LINK_LIBS} tomcrypt)
299+
include(FindPkgConfig)
300+
pkg_check_modules(PC_LIBTOMCRYPT libtomcrypt REQUIRED)
301+
find_path(LIBTOMCRYPT_INCLUDE_DIR NAMES tomcrypt.h HINTS ${PC_LIBTOMCRYPT_INCLUDE_DIRS} REQUIRED)
302+
find_library(LIBTOMCRYPT_LIBRARY NAMES tomcrypt HINTS ${PC_LIBTOMCRYPT_LIBRARY_DIRS} REQUIRED)
303+
set(LINK_LIBS ${LINK_LIBS} ${LIBTOMCRYPT_LIBRARY})
304+
include_directories(${LIBTOMCRYPT_INCLUDE_DIR})
300305
else()
301306
set(SRC_ADDITIONAL_FILES ${TOMCRYPT_FILES} ${TOMMATH_FILES})
302307
endif()

0 commit comments

Comments
 (0)