[CMake] Can't find crypt

Razaj edgarwatson at gmail.com
Sat Sep 13 12:36:32 EDT 2008


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
configure.in code as well as my cmake code.

__Configure.in snippet__
AC_CHECK_FUNC(crypt, AC_DEFINE(GOT_CRYPT),
    [AC_CHECK_LIB(crypt, crypt, AC_DEFINE(GOT_CRYPT) CRYPTLIB="-lcrypt")]
    )

__CMakeLists.txt snippet__
# Check for crypt, if not found check for crypt in libcrypt
CHECK_FUNCTION_EXISTS(crypt CRYPT_EXISTS)
IF(NOT ${CRYPT_EXISTS})
    CHECK_LIBRARY_EXISTS(crypt crypt "" CRYPT_LIB_EXISTS)
ENDIF(NOT ${CRYPT_EXISTS})

IF(${CRYPT_LIB_EXISTS})
    SET(BLISS2_LIBRARIES "${BLISS2_LIBRARIES} crypt")
    MESSAGE(STATUS "Found crypt in libcrypt")
    SET(GOT_CRYPT 1)
ELSEIF(${CRYPT_EXISTS})
    MESSAGE(STATUS "Found crypt")
    SET(CIRCLE_CRYPT 1)
ELSE(${CRYPT_LIB_EXISTS})
    MESSAGE(STATUS "Could not find crypt")
ENDIF(${CRYPT_LIB_EXISTS})

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!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080913/3068399e/attachment.htm>


More information about the CMake mailing list