build: Allow installation

This commit is contained in:
Matt Smith 2020-09-20 12:34:19 +01:00
parent ac1b4013cd
commit 55c3c547ed
No known key found for this signature in database
GPG Key ID: 5162D20F840BDEF3
15 changed files with 28 additions and 13 deletions

View File

@ -1,6 +1,6 @@
# Copyright (c) 2020, tevador <tevador@gmail.com>
cmake_minimum_required(VERSION 2.8.7)
cmake_minimum_required(VERSION 3.13)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
@ -9,6 +9,8 @@ endif()
project(monero-seed)
include(GNUInstallDirs)
add_library(${PROJECT_NAME}
src/argon2/blake2/blake2b.c
src/argon2/argon2.c
@ -24,4 +26,17 @@ src/secure_random.cpp
src/wordlist.cpp)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)
target_include_directories(${PROJECT_NAME} PUBLIC src)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero_seed>)
install(TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(EXPORT ${PROJECT_NAME}
FILE ${PROJECT_NAME}Config.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

View File

@ -3,7 +3,7 @@
All rights reserved.
*/
#include "galois_field.hpp"
#include <monero_seed/galois_field.hpp>
template<unsigned bits, gf_item primitive>
galois_field<bits, primitive>::galois_field() {

View File

@ -3,6 +3,6 @@
All rights reserved.
*/
#include "gf_elem.hpp"
#include <monero_seed/gf_elem.hpp>
const gf_2048 gf_elem::field;

View File

@ -3,7 +3,7 @@
All rights reserved.
*/
#include "gf_poly.hpp"
#include <monero_seed/gf_poly.hpp>
gf_poly::gf_poly(gf_elem coeff, unsigned degree) : degree_(0) {
coeff_[degree] = coeff;

View File

@ -3,11 +3,11 @@
All rights reserved.
*/
#include "monero_seed.hpp"
#include "secure_random.hpp"
#include "wordlist.hpp"
#include "gf_poly.hpp"
#include "reed_solomon_code.hpp"
#include <monero_seed/monero_seed.hpp>
#include <monero_seed/secure_random.hpp>
#include <monero_seed/wordlist.hpp>
#include <monero_seed/gf_poly.hpp>
#include <monero_seed/reed_solomon_code.hpp>
#include "argon2/argon2.h"
#include "argon2/blake2/blake2-impl.h"
#include "pbkdf2.h"

View File

@ -3,7 +3,7 @@
All rights reserved.
*/
#include "reed_solomon_code.hpp"
#include <monero_seed/reed_solomon_code.hpp>
#include <cassert>
reed_solomon_code::reed_solomon_code(unsigned check_digits) : generator(1, 0) {

View File

@ -3,7 +3,7 @@
All rights reserved.
*/
#include "secure_random.hpp"
#include <monero_seed/secure_random.hpp>
#include <stdexcept>
#include <cstdlib>

View File

@ -3,7 +3,7 @@
All rights reserved.
*/
#include "wordlist.hpp"
#include <monero_seed/wordlist.hpp>
#include <algorithm>
const static std::string english_words[] = {