| 1 |
# Copyright (c) 2014-2022, The Monero Project |
| 2 |
# |
| 3 |
# All rights reserved. |
| 4 |
# |
| 5 |
# Redistribution and use in source and binary forms, with or without modification, are |
| 6 |
# permitted provided that the following conditions are met: |
| 7 |
# |
| 8 |
# 1. Redistributions of source code must retain the above copyright notice, this list of |
| 9 |
# conditions and the following disclaimer. |
| 10 |
# |
| 11 |
# 2. Redistributions in binary form must reproduce the above copyright notice, this list |
| 12 |
# of conditions and the following disclaimer in the documentation and/or other |
| 13 |
# materials provided with the distribution. |
| 14 |
# |
| 15 |
# 3. Neither the name of the copyright holder nor the names of its contributors may be |
| 16 |
# used to endorse or promote products derived from this software without specific |
| 17 |
# prior written permission. |
| 18 |
# |
| 19 |
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY |
| 20 |
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 21 |
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
| 22 |
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 |
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 24 |
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 |
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 26 |
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 27 |
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 |
# |
| 29 |
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers |
| 30 |
|
| 31 |
if (WIN32 OR STATIC) |
| 32 |
add_definitions(-DSTATICLIB) |
| 33 |
endif () |
| 34 |
|
| 35 |
function (monero_private_headers group) |
| 36 |
source_group("${group}\\Private" |
| 37 |
FILES |
| 38 |
${ARGN}) |
| 39 |
endfunction () |
| 40 |
|
| 41 |
function (monero_install_headers subdir) |
| 42 |
install( |
| 43 |
FILES ${ARGN} |
| 44 |
DESTINATION "include/${subdir}" |
| 45 |
COMPONENT development) |
| 46 |
endfunction () |
| 47 |
|
| 48 |
function (enable_stack_trace target) |
| 49 |
if(STACK_TRACE) |
| 50 |
set_property(TARGET ${target} |
| 51 |
APPEND PROPERTY COMPILE_DEFINITIONS "STACK_TRACE") |
| 52 |
if (STATIC) |
| 53 |
set_property(TARGET "${target}" |
| 54 |
APPEND PROPERTY LINK_FLAGS "-Wl,--wrap=__cxa_throw") |
| 55 |
endif() |
| 56 |
endif() |
| 57 |
endfunction() |
| 58 |
|
| 59 |
function (monero_add_executable name) |
| 60 |
source_group("${name}" |
| 61 |
FILES |
| 62 |
${ARGN}) |
| 63 |
|
| 64 |
add_executable("${name}" |
| 65 |
${ARGN}) |
| 66 |
target_link_libraries("${name}" |
| 67 |
PRIVATE |
| 68 |
${EXTRA_LIBRARIES}) |
| 69 |
set_property(TARGET "${name}" |
| 70 |
PROPERTY |
| 71 |
FOLDER "prog") |
| 72 |
set_property(TARGET "${name}" |
| 73 |
PROPERTY |
| 74 |
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") |
| 75 |
enable_stack_trace("${name}") |
| 76 |
|
| 77 |
monero_set_target_no_relink("${name}") |
| 78 |
monero_set_target_strip ("${name}") |
| 79 |
endfunction () |
| 80 |
|
| 81 |
include(Version) |
| 82 |
monero_add_library(version SOURCES ${CMAKE_BINARY_DIR}/version.cpp DEPENDS genversion) |
| 83 |
|
| 84 |
add_subdirectory(common) |
| 85 |
add_subdirectory(crypto) |
| 86 |
add_subdirectory(ringct) |
| 87 |
add_subdirectory(checkpoints) |
| 88 |
add_subdirectory(cryptonote_basic) |
| 89 |
add_subdirectory(cryptonote_core) |
| 90 |
add_subdirectory(lmdb) |
| 91 |
add_subdirectory(multisig) |
| 92 |
add_subdirectory(net) |
| 93 |
add_subdirectory(hardforks) |
| 94 |
add_subdirectory(blockchain_db) |
| 95 |
add_subdirectory(mnemonics) |
| 96 |
add_subdirectory(rpc) |
| 97 |
if(NOT IOS) |
| 98 |
add_subdirectory(serialization) |
| 99 |
endif() |
| 100 |
add_subdirectory(wallet) |
| 101 |
if(NOT IOS) |
| 102 |
add_subdirectory(p2p) |
| 103 |
endif() |
| 104 |
add_subdirectory(cryptonote_protocol) |
| 105 |
if(NOT IOS) |
| 106 |
add_subdirectory(simplewallet) |
| 107 |
add_subdirectory(gen_multisig) |
| 108 |
add_subdirectory(gen_ssl_cert) |
| 109 |
add_subdirectory(daemonizer) |
| 110 |
add_subdirectory(daemon) |
| 111 |
add_subdirectory(blockchain_utilities) |
| 112 |
endif() |
| 113 |
|
| 114 |
if(BUILD_DEBUG_UTILITIES) |
| 115 |
add_subdirectory(debug_utilities) |
| 116 |
endif() |
| 117 |
|
| 118 |
if(PER_BLOCK_CHECKPOINT) |
| 119 |
add_subdirectory(blocks) |
| 120 |
endif() |
| 121 |
|
| 122 |
add_subdirectory(device) |
| 123 |
add_subdirectory(device_trezor) |