|
| 1 | +option(ABY_BUILD_EXE "Build executables" OFF) |
| 2 | +set(ABY_LIBRARY_TYPE |
| 3 | + CACHE STRING "[STATIC | SHARED | MODULE] The type of library in which ABY will be built. Default: STATIC" |
| 4 | +) |
| 5 | +set_property(CACHE ABY_LIBRARY_TYPE PROPERTY STRINGS "STATIC" "SHARED" "MODULE") |
| 6 | + |
| 7 | +string(TOUPPER "${ABY_LIBRARY_TYPE}" ABY_LIBRARY_TYPE) |
| 8 | +if("${ABY_LIBRARY_TYPE}" STREQUAL "") |
| 9 | + set(ABY_LIBRARY_TYPE "SHARED") |
| 10 | +elseif(NOT "${ABY_LIBRARY_TYPE}" STREQUAL "STATIC" AND |
| 11 | + NOT "${ABY_LIBRARY_TYPE}" STREQUAL "SHARED" AND |
| 12 | + NOT "${ABY_LIBRARY_TYPE}" STREQUAL "MODULE") |
| 13 | + message(WARNING |
| 14 | + "Unknown library type: ${ABY_LIBRARY_TYPE}. " |
| 15 | + "Setting ABY_LIBRARY_TYPE to default value." |
| 16 | + ) |
| 17 | + set(ABY_LIBRARY_TYPE "SHARED") |
| 18 | +endif() |
| 19 | + |
| 20 | +set(DEPENDENCY_DIR "${DEPENDENCY_DIR}" CACHE PATH "Path to directory, where dependencies will be downloaded.") |
| 21 | +if(DEPENDENCY_DIR STREQUAL "") |
| 22 | + if(NOT EXISTS "${CMAKE_SOURCE_DIR}/extern/dependencies") |
| 23 | + file(MAKE_DIRECTORY "${CMAKE_SOURCE_DIR}/extern/dependencies") |
| 24 | + endif() |
| 25 | + set(DEPENDENCY_DIR "${CMAKE_SOURCE_DIR}/extern/dependencies") |
| 26 | +endif() |
| 27 | + |
| 28 | +# Set build type to `Release` if none was specified: |
| 29 | +# (cf. https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-can-i-change-the-default-build-mode-and-see-it-reflected-in-the-gui) |
| 30 | +if(NOT CMAKE_BUILD_TYPE) |
| 31 | + set(CMAKE_BUILD_TYPE Release |
| 32 | + CACHE STRING "Choose the type of build." FORCE) |
| 33 | + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS |
| 34 | + "None" "Debug" "Release" "RelWithDebInfo" "MinSizeRel") |
| 35 | +endif(NOT CMAKE_BUILD_TYPE) |
| 36 | + |
| 37 | +#Cache Variables related to ENCRYPTO_utils dependency |
| 38 | +set(ENCRYPTO_utils_SOURCE |
| 39 | + CACHE PATH "Path to ENCRYPTO_utils source.") |
| 40 | +set(ENCRYPTO_utils_REPOSITORY https://github.com/oliver-schick/ENCRYPTO_utils.git |
| 41 | + CACHE STRING "Git repository of ENCRYPTO_utils project.") |
| 42 | +set(ENCRYPTO_utils_TAG origin/master |
| 43 | + CACHE STRING "Git tag of downloaded ENCRYPTO_utils project.") |
| 44 | + |
| 45 | +#Cache Variables related to OTExtension dependency |
| 46 | +set(OTExtension_SOURCE |
| 47 | + CACHE PATH "Path to OTExtension source.") |
| 48 | +set(OTExtension_REPOSITORY https://github.com/oliver-schick/OTExtension.git |
| 49 | + CACHE STRING "Git repository of OTExtension project.") |
| 50 | +set(OTExtension_TAG origin/master |
| 51 | + CACHE STRING "Git tag of downloaded OTExtension project.") |
| 52 | + |
| 53 | +#Cache Variables related to BOOST dependency |
| 54 | +option(DOWNLOAD_BOOST "Set to download boost libraries." OFF) |
| 55 | +set(BOOST_SOURCE |
| 56 | + CACHE PATH "Path to boost source location.") |
| 57 | +set(BOOST_URL https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.bz2 |
| 58 | + CACHE STRING "Boost download URL.") |
| 59 | +set(BOOST_URL_HASH SHA256=8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406 |
| 60 | + CACHE STRING "Boost download URL SHA256 checksum.") |
| 61 | + |
| 62 | +#Cache Variables related to BOOST_CMAKE dependency |
| 63 | +set(BOOST_CMAKE_SOURCE |
| 64 | + CACHE PATH "Path to boost-cmake source.") |
| 65 | +set(BOOST_CMAKE_REPOSITORY https://github.com/Orphis/boost-cmake.git |
| 66 | + CACHE STRING "Repository to boost-cmake project.") |
| 67 | +set(BOOST_CMAKE_TAG 70b12f62da331dd402b78102ec8f6a15d59a7af9 |
| 68 | + CACHE STRING "Git tag of boost-cmake") |
| 69 | + |
| 70 | +#Cache Variables related to GMP dependency |
| 71 | +option(BUILD_GMP "Build GMP library if none is found." OFF) |
| 72 | +option(FORCE_GMP_BUILD "Force building of GMP library (use if installed GMP library is not compatible with build)." OFF) |
| 73 | +set(GMP_LIBRARY_DIR |
| 74 | + CACHE PATH "Path to GMP library.") |
| 75 | +set(GMP_INCLUDES |
| 76 | + CACHE PATH "Path to GMP include directories.") |
| 77 | +set(GMP_SOURCE |
| 78 | + CACHE PATH "Path to GMP source (If building GMP).") |
| 79 | +set(GMP_URL https://gmplib.org/download/gmp/gmp-6.2.0.tar.lz |
| 80 | + CACHE STRING "URL of GMP source.") |
| 81 | +set(GMP_URL_HASH SHA512=9975e8766e62a1d48c0b6d7bbdd2fccb5b22243819102ca6c8d91f0edd2d3a1cef21c526d647c2159bb29dd2a7dcbd0d621391b2e4b48662cf63a8e6749561cd |
| 82 | + CACHE STRING "Hash of GMP source archive.") |
| 83 | +set(GMP_LIBRARY_TYPE |
| 84 | + CACHE STRING "[SHARED | STATIC]: Type of GMP library linked to project.") |
| 85 | +set_property(CACHE GMP_LIBRARY_TYPE PROPERTY STRINGS STATIC SHARED) |
| 86 | +mark_as_advanced(FORCE_GMP_BUILD) |
| 87 | + |
| 88 | +include(AndroidCacheVariables) |
0 commit comments