This commit is contained in:
dsc 2024-03-25 15:21:07 +02:00
parent e3d8ab8281
commit c2d1ac9f25
29 changed files with 394 additions and 257 deletions

View File

@ -1,24 +1,32 @@
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
#function(monero_register_lib LIB)
# set_property(GLOBAL PROPERTY source_list_property "${source_list}")
#endfunction()
function(monero_install_library targetName)
set(flags)
set(args)
set(listArgs INCLUDE_DIR HEADERS)
cmake_parse_arguments(arg "${flags}" "${args}" "${listArgs}" ${ARGN})
function(monero_install_library LIB)
set(HEADER_DESTINATION "${ARGN}")
set(include_dir "${arg_INCLUDE_DIR}")
set(headers "${arg_HEADERS}")
set(path_install ${CMAKE_INSTALL_LIBDIR}/cmake/monero)
if(NOT HEADER_DESTINATION)
set(HEADER_DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/monero/")
if(NOT include_dir)
set(include_dir "${CMAKE_INSTALL_INCLUDEDIR}/monero/")
endif()
install(TARGETS ${LIB} EXPORT MoneroTargets
if(${targetName} STREQUAL "device")
message(STATUS "lol")
endif()
if(headers AND include_dir)
install_with_directory(DESTINATION ${include_dir} FILES ${headers})
endif()
install(TARGETS ${targetName} EXPORT MoneroTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/monero/
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/monero/
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/monero/)
# FILE_SET HEADERS DESTINATION ${HEADER_DESTINATION})
endfunction()
function(print_cmake_summary)
@ -73,3 +81,15 @@ function(print_cmake_summary)
endif()
endfunction()
macro(install_with_directory)
set(optionsArgs "")
set(oneValueArgs "DESTINATION")
set(multiValueArgs "FILES")
cmake_parse_arguments(CAS "${optionsArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
foreach(FILE ${CAS_FILES})
get_filename_component(DIR ${FILE} DIRECTORY)
INSTALL(FILES ${FILE} DESTINATION ${CAS_DESTINATION}/${DIR})
endforeach()
endmacro(install_with_directory)

View File

@ -36,11 +36,6 @@ file(GLOB EPEE_SOURCES
add_library(epee)
target_sources(epee
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/
FILES
${EPEE_HEADERS_PUBLIC}
PRIVATE
${EPEE_SOURCES}
)
@ -59,6 +54,10 @@ target_link_libraries(epee
target_include_directories(epee
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/epee/>)
monero_install_library(epee "${CMAKE_INSTALL_INCLUDEDIR}/monero/epee/")
install(DIRECTORY ${EPEE_INCLUDE_DIR_BASE}/
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/monero/epee/")
monero_install_library(epee)

View File

@ -33,3 +33,6 @@ add_subdirectory(easylogging++)
add_subdirectory(qrcodegen)
add_subdirectory(randomwow)
add_subdirectory(supercop)
install(DIRECTORY boost
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/monero/")

View File

@ -37,6 +37,7 @@ target_sources(lmdb PRIVATE ${lmdb_sources})
target_include_directories(lmdb
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
target_link_libraries(lmdb PRIVATE Threads::Threads)
@ -59,4 +60,6 @@ set_target_properties(lmdb PROPERTIES
CXX_STANDARD_REQUIRED ON
)
monero_install_library(lmdb)
monero_install_library(lmdb
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/lmdb/"
HEADERS "midl.h;lmdb.h")

View File

@ -26,13 +26,12 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(EL_HEADERS
easylogging++.h
ea_config.h)
add_library(easylogging)
target_sources(easylogging
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/easylogging++.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/easylogging++.cc
)
@ -44,6 +43,7 @@ target_compile_definitions(easylogging PUBLIC
target_include_directories(easylogging
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/easylogging++/>
)
target_link_libraries(easylogging
@ -51,4 +51,6 @@ target_link_libraries(easylogging
Threads::Threads
${Backtrace_LIBRARIES})
monero_install_library(easylogging)
monero_install_library(easylogging
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/easylogging++/"
HEADERS ${EL_HEADERS})

View File

@ -1,11 +1,6 @@
add_library(qrcodegen)
target_sources(qrcodegen
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/QrCode.hpp
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/QrCode.cpp
)
@ -13,6 +8,9 @@ target_sources(qrcodegen
target_include_directories(qrcodegen
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(qrcodegen)
monero_install_library(qrcodegen
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/qrcodegen/"
HEADERS QrCode.hpp)

View File

@ -31,11 +31,6 @@
include(Version)
add_library(version)
target_sources(version
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/version.h
PRIVATE
${CMAKE_BINARY_DIR}/version.cpp
)
@ -44,9 +39,12 @@ target_include_directories(version
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(version)
monero_install_library(version
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/"
HEADERS version.h)
add_subdirectory(common)
add_subdirectory(crypto)
@ -81,3 +79,6 @@ if(PER_BLOCK_CHECKPOINT)
endif()
add_subdirectory(device)
install(FILES cryptonote_config.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/monero/")

View File

@ -26,19 +26,19 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB BCDB_HEADERS *.h)
file(GLOB BCDB_SOURCES *.cpp *.c *.cc)
list(APPEND BCDB_SOURCES lmdb/db_lmdb.cpp)
list(APPEND BCDB_HEADERS lmdb/db_lmdb.h)
set(BCDB_HEADERS
blockchain_db.h
locked_txn.h
testdb.h
lmdb/db_lmdb.h)
message(STATUS "${BCDB_HEADERS}")
add_library(blockchain_db)
target_sources(blockchain_db
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${BCDB_HEADERS}
PRIVATE
${BCDB_SOURCES}
)
@ -55,6 +55,9 @@ target_include_directories(blockchain_db
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(blockchain_db "${CMAKE_INSTALL_INCLUDEDIR}/monero/blockchain_db/")
monero_install_library(blockchain_db
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/blockchain_db/"
HEADERS ${BCDB_HEADERS})

View File

@ -59,11 +59,6 @@ endforeach()
add_library(blocks)
target_sources(blocks
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/blocks.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/blocks.cpp
${GENERATED_SOURCES}
@ -73,6 +68,9 @@ target_include_directories(blocks
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/contrib/epee/include>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(blocks "${CMAKE_INSTALL_INCLUDEDIR}/monero/blocks/")
monero_install_library(blocks
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/blocks/"
HEADERS blocks.h)

View File

@ -28,11 +28,6 @@
add_library(checkpoints)
target_sources(checkpoints
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/checkpoints.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/checkpoints.cpp
)
@ -50,6 +45,9 @@ target_link_libraries(checkpoints PUBLIC
target_include_directories(checkpoints
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(checkpoints "${CMAKE_INSTALL_INCLUDEDIR}/monero/checkpoints/")
monero_install_library(checkpoints
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/checkpoints/"
HEADERS checkpoints.h)

View File

@ -27,16 +27,43 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB COMMON_SOURCES "*.cpp" "*.c")
file(GLOB COMMON_HEADERS "*.h")
set(COMMON_HEADERS
aligned.h
apply_permutation.h
base58.h
boost_serialization_helper.h
combinator.h
command_line.h
common_fwd.h
data_cache.h
dns_utils.h
download.h
error.h
expect.h
http_connection.h
i18n.h
json_util.h
notify.h
password.h
perf_timer.h
pod-class.h
powerof.h
pruning.h
rpc_client.h
scoped_message_writer.h
sfinae_helpers.h
spawn.h
stack_trace.h
threadpool.h
timings.h
unordered_containers_boost_serialization.h
updates.h
utf8.h
util.h
varint.h)
add_library(common)
target_sources(common
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${COMMON_HEADERS}
PRIVATE
${COMMON_SOURCES}
)
@ -61,6 +88,7 @@ target_include_directories(common
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/translations>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
if(STATIC)
@ -69,4 +97,6 @@ endif()
add_dependencies(common generate_translations_header)
monero_install_library(common "${CMAKE_INSTALL_INCLUDEDIR}/monero/common/")
monero_install_library(common
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/common/"
HEADERS ${COMMON_HEADERS})

View File

@ -49,7 +49,34 @@ set(crypto_sources
rx-slow-hash.c
CryptonightR_JIT.c
tree-hash.c)
file(GLOB crypto_headers "*.h")
set(crypto_headers
CryptonightR_JIT.h
CryptonightR_template.h
blake256.h
c_threads.h
chacha.h
crypto-ops.h
crypto.h
duration.h
generic-ops.h
groestl.h
groestl_tables.h
hash-ops.h
hash.h
hmac-keccak.h
initializer.h
jh.h
keccak.h
oaes_config.h
oaes_lib.h
random.h
skein.h
skein_port.h
variant2_int_sqrt.h
variant4_random_math.h)
message(STATUS "${crypto_headers}")
if(NOT ARM)
list(APPEND crypto_sources CryptonightR_template.S)
@ -57,11 +84,6 @@ endif()
add_library(cncrypto)
target_sources(cncrypto
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${crypto_headers}
PRIVATE
${crypto_sources}
)
@ -79,6 +101,7 @@ target_link_libraries(cncrypto
target_include_directories(cncrypto
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
PUBLIC ${sodium_INCLUDE_DIR}
)
@ -102,4 +125,6 @@ set_property(SOURCE CryptonightR_template.S PROPERTY XCODE_EXPLICIT_FILE_TYPE so
# Must be done last, because it references libraries in this directory
add_subdirectory(wallet)
monero_install_library(cncrypto "${CMAKE_INSTALL_INCLUDEDIR}/monero/crypto/")
monero_install_library(cncrypto
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/crypto/"
HEADERS ${crypto_headers})

View File

@ -31,13 +31,6 @@ include(CheckLanguage)
check_language(ASM-ATT)
add_library(wallet-crypto crypto.h)
target_sources(wallet-crypto
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/crypto.h
)
target_include_directories(wallet-crypto
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
@ -46,4 +39,7 @@ target_include_directories(wallet-crypto
)
target_link_libraries(wallet-crypto PUBLIC cncrypto)
monero_install_library(wallet-crypto "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet-crypto/")
monero_install_library(wallet-crypto
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet-crypto/"
HEADERS crypto.h)

View File

@ -26,8 +26,25 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB CN_BASIC_HEADERS *.h)
file(GLOB CN_BASIC_SOURCES *.cpp *.c *.cc)
set(CN_BASIC_HEADERS
account.h
account_boost_serialization.h
blobdatatype.h
connection_context.h
cryptonote_basic.h
cryptonote_basic_impl.h
cryptonote_boost_serialization.h
cryptonote_format_utils.h
difficulty.h
events.h
fwd.h
hardfork.h
merge_mining.h
miner.h
subaddress_index.h
tx_extra.h
verification_context.h)
# cryptonote_format_utils_basic
add_library(cryptonote_format_utils_basic)
@ -40,16 +57,12 @@ target_link_libraries(cryptonote_format_utils_basic PUBLIC cncrypto)
target_include_directories(cryptonote_format_utils_basic
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
# cryptonote_basic
add_library(cryptonote_basic)
target_sources(cryptonote_basic
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${CN_BASIC_HEADERS}
PRIVATE
${CN_BASIC_SOURCES}
)
@ -70,7 +83,11 @@ target_link_libraries(cryptonote_basic
target_include_directories(cryptonote_basic
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic>
)
monero_install_library(cryptonote_format_utils_basic "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic/")
monero_install_library(cryptonote_basic "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic/")
monero_install_library(cryptonote_format_utils_basic)
monero_install_library(cryptonote_basic
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_basic/"
HEADERS ${CN_BASIC_HEADERS})

View File

@ -26,10 +26,18 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB CN_CORE_HEADERS *.h)
file(GLOB CN_CORE_SOURCES *.cpp *.c *.cc)
set(CN_CORE_HEADERS
blockchain.h
blockchain_storage_boost_serialization.h
cryptonote_core.h
cryptonote_tx_utils.h
i_core_events.h
tx_pool.h
tx_sanity_check.h
tx_verification_utils.h)
add_library(cryptonote_core ${CN_CORE_SOURCES})
add_library(cryptonote_core)
target_link_libraries(cryptonote_core
PUBLIC
version
@ -49,6 +57,7 @@ target_link_libraries(cryptonote_core
target_include_directories(cryptonote_core PRIVATE
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
if(PER_BLOCK_CHECKPOINT)
@ -56,11 +65,6 @@ if(PER_BLOCK_CHECKPOINT)
endif()
target_sources(cryptonote_core
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${CN_CORE_HEADERS}
PRIVATE
${CN_CORE_SOURCES}
)
@ -68,6 +72,9 @@ target_sources(cryptonote_core
target_include_directories(cryptonote_core
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(cryptonote_core "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_core/")
monero_install_library(cryptonote_core
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_core/"
HEADERS ${CN_CORE_HEADERS})

View File

@ -26,16 +26,18 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB CN_PROT_HEADERS *.h)
file(GLOB CN_PROT_SOURCES *.cpp *.c *.cc)
set(CN_PROT_HEADERS
block_queue.h
cryptonote_protocol_defs.h
cryptonote_protocol_handler.h
cryptonote_protocol_handler_common.h
enums.h
fwd.h
levin_notify.h)
add_library(cryptonote_protocol)
target_sources(cryptonote_protocol
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CN_PROT_HEADERS}
PRIVATE
${CN_PROT_SOURCES}
)
@ -45,7 +47,10 @@ target_link_libraries(cryptonote_protocol PUBLIC p2p)
target_include_directories(cryptonote_protocol
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(cryptonote_protocol "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_protocol/")
monero_install_library(cryptonote_protocol
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/cryptonote_protocol/"
HEADERS ${CN_PROT_HEADERS})

View File

@ -70,5 +70,4 @@ target_link_libraries(daemonizer
Boost::filesystem
Boost::program_options)
target_include_directories(daemonizer PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../)
target_include_directories(daemonizer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../)

View File

@ -26,17 +26,15 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set(HEADERS
device.hpp
device_io.hpp
device_default.hpp
device_cold.hpp
log.hpp)
add_library(device)
target_sources(device
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${CMAKE_CURRENT_SOURCE_DIR}/device.hpp
${CMAKE_CURRENT_SOURCE_DIR}/device_io.hpp
${CMAKE_CURRENT_SOURCE_DIR}/device_default.hpp
${CMAKE_CURRENT_SOURCE_DIR}/device_cold.hpp
${CMAKE_CURRENT_SOURCE_DIR}/log.hpp
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/device.cpp
${CMAKE_CURRENT_SOURCE_DIR}/device_default.cpp
@ -60,6 +58,9 @@ target_include_directories(device
PUBLIC $<TARGET_PROPERTY:monero-crypto-amd64-64-24k,INTERFACE_INCLUDE_DIRECTORIES>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(device "${CMAKE_INSTALL_INCLUDEDIR}/monero/device/")
monero_install_library(device
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/device/"
HEADERS "${HEADERS}")

View File

@ -28,15 +28,12 @@
add_library(hardforks)
target_sources(hardforks
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/hardforks.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/hardforks.cpp
)
target_link_libraries(hardforks PUBLIC version)
monero_install_library(hardforks "${CMAKE_INSTALL_INCLUDEDIR}/monero/hardforks/")
monero_install_library(hardforks
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/hardforks/"
HEADERS hardforks.h)

View File

@ -26,16 +26,18 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB LMDB_HEADERS *.h)
file(GLOB LMDB_SOURCES *.cpp *.c *.cc)
set(LMDB_HEADERS
database.h
error.h
key_stream.h
table.h
transaction.h
util.h
value_stream.h)
add_library(lmdb_lib ${LMDB_SOURCES})
add_library(lmdb_lib)
target_sources(lmdb_lib
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${LMDB_HEADERS}
PRIVATE
${LMDB_SOURCES}
)
@ -44,4 +46,6 @@ target_link_libraries(lmdb_lib PRIVATE
common
lmdb)
monero_install_library(lmdb_lib "${CMAKE_INSTALL_INCLUDEDIR}/monero/lmdb/")
monero_install_library(lmdb_lib
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/lmdb_lib/"
HEADERS ${LMDB_HEADERS})

View File

@ -26,16 +26,27 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB MN_HEADERS *.h)
file(GLOB MN_SOURCES *.cpp *.c *.cc)
set(MN_HEADERS
chinese_simplified.h
dutch.h
electrum-words.h
english.h
english_old.h
esperanto.h
french.h
german.h
italian.h
japanese.h
language_base.h
lojban.h
portuguese.h
russian.h
singleton.h
spanish.h)
add_library(mnemonics)
target_sources(mnemonics
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${MN_HEADERS}
PRIVATE
${MN_SOURCES}
)
@ -49,6 +60,9 @@ target_link_libraries(mnemonics
target_include_directories(mnemonics
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(mnemonics "${CMAKE_INSTALL_INCLUDEDIR}/monero/mnemonics/")
monero_install_library(mnemonics
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/mnemonics/"
HEADERS ${MN_HEADERS})

View File

@ -25,19 +25,17 @@
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB MULTISIG_HEADERS *.h)
file(GLOB MULTISIG_SOURCES
*.cpp
*.c
*.cc)
file(GLOB MULTISIG_SOURCES *.cpp *.c *.cc)
set(MULTISIG_HEADERS
multisig_account.h
multisig_clsag_context.h
multisig.h
multisig_kex_msg.h
multisig_kex_msg_serialization.h
multisig_tx_builder_ringct.h)
add_library(multisig)
target_sources(multisig
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${MULTISIG_HEADERS}
PRIVATE
${MULTISIG_SOURCES}
)
@ -53,6 +51,9 @@ target_link_libraries(multisig
target_include_directories(multisig
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(multisig "${CMAKE_INSTALL_INCLUDEDIR}/monero/multisig/")
monero_install_library(multisig
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/multisig/"
HEADERS ${MULTISIG_HEADERS})

View File

@ -27,16 +27,22 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB NET_HEADERS *.h)
SET(NET_HEADERS
dandelionpp.h
error.h
fwd.h
http.h
i2p_address.h
parse.h
resolve.h
socks_connect.h
socks.h
tor_address.h
zmq.h)
file(GLOB NET_SOURCES *.cpp *.c *.cc)
add_library(net)
target_sources(net
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${NET_HEADERS}
PRIVATE
${NET_SOURCES}
)
@ -50,8 +56,11 @@ target_link_libraries(net PUBLIC
target_include_directories(net
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
PRIVATE ${ZMQ_INCLUDE_DIRS}
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(net "${CMAKE_INSTALL_INCLUDEDIR}/monero/net/")
monero_install_library(net
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/net/"
HEADERS ${NET_HEADERS})

View File

@ -26,16 +26,16 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB P2P_HEADERS *.h)
file(GLOB P2P_SOURCES *.cpp *.c *.cc)
set(P2P_HEADERS
net_node_common.h
net_node.h
net_peerlist_boost_serialization.h
net_peerlist.h
p2p_protocol_defs.h)
add_library(p2p)
target_sources(p2p
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${P2P_HEADERS}
PRIVATE
${P2P_SOURCES}
)
@ -57,7 +57,10 @@ target_include_directories(p2p
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(p2p "${CMAKE_INSTALL_INCLUDEDIR}/monero/p2p/")
monero_install_library(p2p
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/p2p/"
HEADERS ${P2P_HEADERS})

View File

@ -46,11 +46,6 @@ set(ringct_basic_headers
add_library(ringct_basic)
target_sources(ringct_basic
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${ringct_basic_headers}
PRIVATE
${ringct_basic_sources}
)
@ -66,16 +61,12 @@ target_link_libraries(ringct_basic
target_include_directories(ringct_basic
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
add_library(ringct)
target_sources(ringct
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/rctSigs.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/rctSigs.cpp
)
@ -92,8 +83,14 @@ target_link_libraries(ringct
target_include_directories(ringct
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(ringct_basic "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/")
monero_install_library(ringct "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/")
monero_install_library(ringct_basic
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/"
HEADERS ${ringct_basic_headers})
monero_install_library(ringct
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/ringct/"
HEADERS rctSigs.h)

View File

@ -27,16 +27,13 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# rpc base
set(RPC_BASE_HEADERS
rpc_args.h
rpc_payment_signature.h
rpc_handler.h)
add_library(rpc_base)
target_sources(rpc_base
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/rpc_args.h
${CMAKE_CURRENT_SOURCE_DIR}/rpc_payment_signature.h
${CMAKE_CURRENT_SOURCE_DIR}/rpc_handler.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/rpc_args.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rpc_payment_signature.cpp
@ -58,23 +55,22 @@ target_include_directories(rpc_base
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(rpc_base "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc/")
monero_install_library(rpc_base
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc_base/"
HEADERS "${RPC_BASE_HEADERS}")
# rpc
set(RPC_HEADERS
rpc_version_str.h
rpc_handler.h
bootstrap_daemon.h
core_rpc_server.h
rpc_payment.h
core_rpc_server_commands_defs.h
core_rpc_server_error_codes.h)
add_library(rpc)
target_sources(rpc
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/rpc_version_str.h
${CMAKE_CURRENT_SOURCE_DIR}/rpc_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/bootstrap_daemon.h
${CMAKE_CURRENT_SOURCE_DIR}/core_rpc_server.h
${CMAKE_CURRENT_SOURCE_DIR}/rpc_payment.h
${CMAKE_CURRENT_SOURCE_DIR}/core_rpc_server_commands_defs.h
${CMAKE_CURRENT_SOURCE_DIR}/core_rpc_server_error_codes.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/bootstrap_daemon.cpp
${CMAKE_CURRENT_SOURCE_DIR}/bootstrap_node_selector.cpp
@ -84,7 +80,6 @@ target_sources(rpc
${CMAKE_CURRENT_SOURCE_DIR}/instanciations.cpp
)
target_link_libraries(rpc
PUBLIC
rpc_base
@ -99,21 +94,21 @@ target_link_libraries(rpc
target_include_directories(rpc
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
PRIVATE ${ZMQ_INCLUDE_DIRS}
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(rpc "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc/")
monero_install_library(rpc
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc/"
HEADERS "${RPC_HEADERS}")
# rpc pub
set(RPC_PUB_HEADERS
zmq_pub.h)
add_library(rpc_pub)
target_sources(rpc_pub
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/zmq_pub.h
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/zmq_pub.cpp
)
@ -129,19 +124,23 @@ target_link_libraries(rpc_pub
target_include_directories(rpc_pub
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
PRIVATE ${ZMQ_INCLUDE_DIRS}
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(rpc_pub "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc/")
monero_install_library(rpc_pub
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/rpc_pub/"
HEADERS "${RPC_PUB_HEADERS}")
# daemon messages
set(DAEMON_MESSAGES_HEADERS
message.h
daemon_messages.h)
add_library(daemon_messages
message.cpp
daemon_messages.cpp
message.h
daemon_messages.h)
daemon_messages.cpp)
target_link_libraries(daemon_messages
LINK_PRIVATE

View File

@ -26,16 +26,26 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
file(GLOB SER_HEADERS *.h)
file(GLOB SER_SOURCES *.cpp *.c *.cc)
set(SER_HEADERS
binary_archive.h
binary_utils.h
container.h
containers.h
crypto.h
debug_archive.h
difficulty_type.h
json_archive.h
json_object.h
json_utils.h
pair.h
serialization.h
string.h
tuple.h
variant.h)
add_library(serialization)
target_sources(serialization
PUBLIC
FILE_SET HEADERS
BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../
FILES
${SER_HEADERS}
PRIVATE
${SER_SOURCES}
)
@ -56,6 +66,9 @@ add_dependencies(serialization version)
target_include_directories(serialization
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>
)
monero_install_library(serialization "${CMAKE_INSTALL_INCLUDEDIR}/monero/serialization/")
monero_install_library(serialization
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/serialization/"
HEADERS "${SER_HEADERS}")

View File

@ -40,9 +40,7 @@ set(wallet_headers
api/pending_transaction_info.h
api/wallet.h
api/wallet2_api.h
wallet2.h)
set(wallet_private_headers
wallet2.h
api/address_book.h
api/coins.h
api/coins_info.h
@ -68,11 +66,8 @@ set(wallet_private_headers
add_library(wallet ${wallet_sources})
target_sources(wallet
PUBLIC
${wallet_headers}
PRIVATE
${wallet_sources}
${wallet_private_headers}
)
target_link_libraries(wallet
@ -100,7 +95,9 @@ target_include_directories(wallet
PRIVATE ${OPENSSL_INCLUDE_DIR}
)
monero_install_library(wallet "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/")
monero_install_library(wallet
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/"
HEADERS "${wallet_headers}")
# == rpc server

View File

@ -26,8 +26,6 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# include (${PROJECT_SOURCE_DIR}/cmake/libutils.cmake)
set(wallet_api_sources
wallet.cpp
wallet_manager.cpp
@ -62,7 +60,7 @@ set(wallet_api_private_headers
coins.h
coins_info.h)
add_library(wallet_api)
add_library(wallet_api ${wallet_api_sources})
target_link_libraries(wallet_api
PUBLIC
@ -82,13 +80,13 @@ target_link_libraries(wallet_api
${ICU_LIBRARIES})
target_include_directories(wallet_api
PRIVATE ${OPENSSL_INCLUDE_DIR})
PRIVATE ${OPENSSL_INCLUDE_DIR}
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monero/>)
target_sources(wallet_api
PRIVATE
${wallet_api_private_headers}
${wallet_api_sources}
PUBLIC
FILE_SET HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/src FILES ${wallet_api_headers})
${wallet_api_sources})
monero_install_library(wallet_api "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/api/")
monero_install_library(wallet_api
INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}/monero/wallet/api/"
HEADERS "${wallet_api_headers}")