<div dir="ltr">I'm attempting to convert a multi-platform autotools system to a cmake system and learning cmake in the process. Cmake is having a problem finding crypt on my system whereas configure has no problem, I'm attaching the <a href="http://configure.in">configure.in</a> code as well as my cmake code.<br>
<br>__Configure.in snippet__<br>AC_CHECK_FUNC(crypt, AC_DEFINE(GOT_CRYPT),<br> [AC_CHECK_LIB(crypt, crypt, AC_DEFINE(GOT_CRYPT) CRYPTLIB="-lcrypt")]<br> )<br><br>__CMakeLists.txt snippet__<br># Check for crypt, if not found check for crypt in libcrypt<br>
CHECK_FUNCTION_EXISTS(crypt CRYPT_EXISTS)<br>IF(NOT ${CRYPT_EXISTS})<br> CHECK_LIBRARY_EXISTS(crypt crypt "" CRYPT_LIB_EXISTS)<br>ENDIF(NOT ${CRYPT_EXISTS})<br><br>IF(${CRYPT_LIB_EXISTS})<br> SET(BLISS2_LIBRARIES "${BLISS2_LIBRARIES} crypt")<br>
MESSAGE(STATUS "Found crypt in libcrypt")<br> SET(GOT_CRYPT 1)<br>ELSEIF(${CRYPT_EXISTS})<br> MESSAGE(STATUS "Found crypt")<br> SET(CIRCLE_CRYPT 1)<br>ELSE(${CRYPT_LIB_EXISTS})<br> MESSAGE(STATUS "Could not find crypt")<br>
ENDIF(${CRYPT_LIB_EXISTS})<br><br>The autoconf code finds crypt in libcrypt on my system, the cmake does not. I use the same cmake code to find socket, gethostbyaddr, etc and they all work, just not for crypt. Any help will be greatly appreciated!<br>
<br></div>