project (scrypt) cmake_minimum_required(VERSION 2.8) include(CheckIncludeFile) include(CheckSymbolExists) check_include_file (sys/endian.h HAVE_SYS_ENDIAN_H) check_symbol_exists (be64enc sys/endian.h HAVE_DECL_BE64ENC) check_symbol_exists (posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) #The scrypt library does not use a config.h, so we must introduce a number #of -D arguments instead of generating a config.h. The right thing to do would #be to introduce a config.h, but that would require modifying all source files #by adding include(config.h). We would rather avoid that and keep all #modifications in this drop-in CMakeLists.txt file. if (HAVE_SYS_ENDIAN_H) add_definitions (-DHAVE_SYS_ENDIAN_H) endif (HAVE_SYS_ENDIAN_H) if (HAVE_DECL_BE64ENC) add_definitions (-DHAVE_DECL_BE64ENC) endif (HAVE_DECL_BE64ENC) if (HAVE_POSIX_MEMALIGN) add_definitions (-DHAVE_POSIX_MEMALIGN) endif (HAVE_POSIX_MEMALIGN) add_library (scrypt b64.c crypto-mcf.c crypto_scrypt-check.c crypto_scrypt-nosse.c sha256.c slowequals.c b64.h libscrypt.h sha256.h slowequals.h sysendian.h ) install(TARGETS scrypt RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) install(FILES libscrypt.h DESTINATION include)