Post-quantum cryptography tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.4KB

  1. # Alternative way for building the project from git, viable for less-unixy
  2. # platforms. Do _NOT_ use this for packaging; _DO_ use autotools instead.
  3. #
  4. # (c) 2018- tearsofphoenix <tearsofphoenix@icloud.com>
  5. cmake_minimum_required(VERSION 3.8)
  6. project(ccr)
  7. set(CMAKE_CXX_STANDARD 11)
  8. if (APPLE)
  9. include_directories(/usr/local/opt/gmp/include /usr/local/opt/fftw/include)
  10. link_directories(/usr/local/opt/gmp/lib /usr/local/opt/fftw/lib)
  11. add_definitions(-DHAVE_READPASSPHRASE=1)
  12. find_library(HAVE_CRYPTOPP cryptopp)
  13. if(HAVE_CRYPTOPP)
  14. add_definitions(-DHAVE_CRYPTOPP=1)
  15. include_directories(/usr/local/opt/cryptopp/include)
  16. link_directories(/usr/local/opt/cryptopp/lib)
  17. else()
  18. message(WARNING "install cryptopp by homebrew is better")
  19. endif()
  20. elseif(UNIX)
  21. include_directories(/usr/include)
  22. link_directories(/usr/lib)
  23. find_library(HAVE_BSDREADPASSPHRASE bsd)
  24. if (HAVE_BSDREADPASSPHRASE)
  25. add_definitions(-DHAVE_BSDREADPASSPHRASE=1)
  26. else()
  27. message(FATAL_ERROR "libbsd missing, you can install libbsd-dev package!")
  28. endif()
  29. find_library(HAVE_CRYPTOPP crypto++)
  30. if(HAVE_CRYPTOPP)
  31. add_definitions(-DHAVE_CRYPTOPP=1 -DCRYPTOPP_DIR_PLUS=1)
  32. else()
  33. message(WARNING "use crypto++ is better")
  34. endif()
  35. endif (APPLE)
  36. add_definitions(-DPACKAGE_VERSION="1.8")
  37. add_executable(ccr
  38. src/actions.cpp
  39. src/algo_suite.cpp
  40. src/algos_enc.cpp
  41. src/algos_sig.cpp
  42. src/base64.cpp
  43. src/bvector.cpp
  44. src/chacha.cpp
  45. src/envelope.cpp
  46. src/fft.cpp
  47. src/fmtseq.cpp
  48. src/generator.cpp
  49. src/gf2m.cpp
  50. src/hash.cpp
  51. src/hashfile.cpp
  52. src/iohelpers.cpp
  53. src/ios.cpp
  54. src/keyring.cpp
  55. src/main.cpp
  56. src/matrix.cpp
  57. src/mce_qcmdpc.cpp
  58. src/message.cpp
  59. src/permutation.cpp
  60. src/privfile.cpp
  61. src/polynomial.cpp
  62. src/sc.cpp
  63. src/seclock.cpp
  64. src/sencode.cpp
  65. src/serialization.cpp
  66. src/str_match.cpp
  67. src/symkey.cpp
  68. src/pwrng.cpp
  69. src/xsynd.cpp)
  70. target_link_libraries(ccr fftw3 gmp)
  71. if (APPLE)
  72. elseif(UNIX)
  73. if (HAVE_BSDREADPASSPHRASE)
  74. target_link_libraries(ccr bsd)
  75. endif()
  76. endif (APPLE)
  77. if (HAVE_CRYPTOPP)
  78. if(CRYPTOPP_DIR_PLUS)
  79. target_link_libraries(ccr crypto++)
  80. else()
  81. target_link_libraries(ccr cryptopp)
  82. endif()
  83. endif ()