--- CMakeLists.txt 2009-07-24 20:32:12.000000000 +0200 +++ CMakeLists.txt.new 2009-08-02 21:46:18.048387609 +0200 @@ -315,12 +315,17 @@ TARGET_LINK_LIBRARIES(fms tommath) INCLUDE_DIRECTORIES(libs/libtommath) ENDIF(TOMMATH_LIBRARY) - - # Force use of bundled tomcrypt, as the system library may have been compiled without the features we need - ADD_SUBDIRECTORY(libs/libtomcrypt) - TARGET_LINK_LIBRARIES(fms tomcrypt) - INCLUDE_DIRECTORIES(libs/libtomcrypt/headers) - + + FIND_LIBRARY(TOMCRYPT_LIBRARY NAMES tomcrypt libtomcrypt) + + IF(TOMCRYPT_LIBRARY) + TARGET_LINK_LIBRARIES(fms ${TOMCRYPT_LIBRARY}) + ELSE(TOMCRYPT_LIBRARY) + ADD_SUBDIRECTORY(libs/libtomcrypt) + TARGET_LINK_LIBRARIES(fms tomcrypt) + INCLUDE_DIRECTORIES(libs/libtomcrypt/headers) + ENDIF(TOMCRYPT_LIBRARY) + ADD_DEFINITIONS(-DFROST_SUPPORT) ENDIF(FROST_SUPPORT)