From 89cff7bddc6f76ae7382e92569f9a902b262cc5f Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 21 Oct 2014 11:13:59 -0400 Subject: cmake: put each library into its own directory This cleans up the CMake code and shows patterns more easily (to be refactored in the next commit). --- src/daemon/CMakeLists.txt | 89 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/daemon/CMakeLists.txt (limited to 'src/daemon') diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt new file mode 100644 index 000000000..6cb5f8625 --- /dev/null +++ b/src/daemon/CMakeLists.txt @@ -0,0 +1,89 @@ +# Copyright (c) 2014, The Monero Project +# +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, are +# permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other +# materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be +# used to endorse or promote products derived from this software without specific +# prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# 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. + +set(daemon_sources + daemon.cpp) + +set(daemon_headers + daemon_commands_handler.h + + # cryptonote_protocol + ../cryptonote_protocol/blobdatatype.h + ../cryptonote_protocol/cryptonote_protocol_defs.h + ../cryptonote_protocol/cryptonote_protocol_handler.h + ../cryptonote_protocol/cryptonote_protocol_handler.inl + ../cryptonote_protocol/cryptonote_protocol_handler_common.h + + # p2p + ../p2p/net_node.h + ../p2p/net_node.inl + ../p2p/net_node_common.h + ../p2p/net_peerlist.h + ../p2p/net_peerlist_boost_serialization.h + ../p2p/p2p_protocol_defs.h + ../p2p/stdafx.h) + +source_group(daemon + FILES + ${daemon_sources} + ${daemon_headers}) + +add_executable(daemon + ${daemon_sources} + ${daemon_headers}) +target_link_libraries(daemon + PRIVATE + rpc + cryptonote_core + crypto + common + ${Boost_CHRONO_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${Boost_REGEX_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${UPNP_LIBRARIES} + ${EXTRA_LIBRARIES}) +add_dependencies(daemon + version) +set_property(TARGET daemon + PROPERTY + FOLDER "prog") +set_property(TARGET daemon + PROPERTY + OUTPUT_NAME "bitmonerod") + +if (STATIC) + set_property(TARGET daemon + PROPERTY + LINK_SEARCH_START_STATIC 1) + set_property(TARGET daemon + PROPERTY + LINK_SEARCH_END_STATIC 1) +endif () -- cgit v1.2.3 From c773f465ca7e691b94394d8c7c682c8eb78e5c25 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 21 Oct 2014 11:21:28 -0400 Subject: cmake: refactor common code with executables --- src/CMakeLists.txt | 24 ++++++++++++++++++++++++ src/connectivity_tool/CMakeLists.txt | 19 +------------------ src/daemon/CMakeLists.txt | 19 +------------------ src/miner/CMakeLists.txt | 19 +------------------ src/simplewallet/CMakeLists.txt | 19 +------------------ 5 files changed, 28 insertions(+), 72 deletions(-) (limited to 'src/daemon') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 790b44593..868bdc2e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,6 +32,30 @@ add_definitions(-DSTATICLIB) # miniupnp changed their static define add_definitions(-DMINIUPNP_STATICLIB) +function (bitmonero_add_executable name) + source_group("${name}" + FILES + ${ARGN}) + + add_executable("${name}" + ${ARGN}) + target_link_libraries("${name}" + PRIVATE + ${EXTRA_LIBRARIES}) + set_property(TARGET "${name}" + PROPERTY + FOLDER "prog") + + if (STATIC) + set_property(TARGET "${name}" + PROPERTY + LINK_SEARCH_START_STATIC 1) + set_property(TARGET "${name}" + PROPERTY + LINK_SEARCH_END_STATIC 1) + endif () +endfunction () + add_subdirectory(common) add_subdirectory(crypto) add_subdirectory(cryptonote_core) diff --git a/src/connectivity_tool/CMakeLists.txt b/src/connectivity_tool/CMakeLists.txt index 150815a5d..de52b0648 100644 --- a/src/connectivity_tool/CMakeLists.txt +++ b/src/connectivity_tool/CMakeLists.txt @@ -31,12 +31,7 @@ set(connectivity_tool_sources set(connectivity_tool_headers) -source_group(connectivity-tool - FILES - ${connectivity_tool_sources} - ${connectivity_tool_headers}) - -add_executable(connectivity_tool +bitmonero_add_executable(connectivity_tool ${connectivity_tool_sources} ${connectivity_tool_headers}) target_link_libraries(connectivity_tool @@ -48,15 +43,3 @@ target_link_libraries(connectivity_tool ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_SYSTEM_LIBRARY}) -set_property(TARGET connectivity_tool - PROPERTY - FOLDER "prog") - -if (STATIC) - set_property(TARGET connectivity_tool - PROPERTY - LINK_SEARCH_START_STATIC 1) - set_property(TARGET connectivity_tool - PROPERTY - LINK_SEARCH_END_STATIC 1) -endif () diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index 6cb5f8625..fdf6d697c 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -48,12 +48,7 @@ set(daemon_headers ../p2p/p2p_protocol_defs.h ../p2p/stdafx.h) -source_group(daemon - FILES - ${daemon_sources} - ${daemon_headers}) - -add_executable(daemon +bitmonero_add_executable(daemon ${daemon_sources} ${daemon_headers}) target_link_libraries(daemon @@ -72,18 +67,6 @@ target_link_libraries(daemon ${EXTRA_LIBRARIES}) add_dependencies(daemon version) -set_property(TARGET daemon - PROPERTY - FOLDER "prog") set_property(TARGET daemon PROPERTY OUTPUT_NAME "bitmonerod") - -if (STATIC) - set_property(TARGET daemon - PROPERTY - LINK_SEARCH_START_STATIC 1) - set_property(TARGET daemon - PROPERTY - LINK_SEARCH_END_STATIC 1) -endif () diff --git a/src/miner/CMakeLists.txt b/src/miner/CMakeLists.txt index 551d9e70a..7f8669665 100644 --- a/src/miner/CMakeLists.txt +++ b/src/miner/CMakeLists.txt @@ -34,12 +34,7 @@ set(simpleminer_headers simpleminer_protocol_defs.h target_helper.h) -source_group(simpleminer - FILES - ${simpleminer_sources} - ${simpleminer_headers}) - -add_executable(simpleminer +bitmonero_add_executable(simpleminer ${simpleminer_sources} ${simpleminer_headers}) target_link_libraries(simpleminer @@ -52,15 +47,3 @@ target_link_libraries(simpleminer ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${EXTRA_LIBRARIES}) -set_property(TARGET simpleminer - PROPERTY - FOLDER "prog") - -if (STATIC) - set_property(TARGET simpleminer - PROPERTY - LINK_SEARCH_START_STATIC 1) - set_property(TARGET simpleminer - PROPERTY - LINK_SEARCH_END_STATIC 1) -endif () diff --git a/src/simplewallet/CMakeLists.txt b/src/simplewallet/CMakeLists.txt index 756b8d753..310efc2f1 100644 --- a/src/simplewallet/CMakeLists.txt +++ b/src/simplewallet/CMakeLists.txt @@ -34,12 +34,7 @@ set(simplewallet_headers simplewallet.h password_container.h) -source_group(simplewallet - FILES - ${simplewallet_sources} - ${simplewallet_headers}) - -add_executable(simplewallet +bitmonero_add_executable(simplewallet ${simplewallet_sources} ${simplewallet_headers}) target_link_libraries(simplewallet @@ -56,15 +51,3 @@ target_link_libraries(simplewallet ${EXTRA_LIBRARIES}) add_dependencies(simplewallet version) -set_property(TARGET simplewallet - PROPERTY - FOLDER "prog") - -if (STATIC) - set_property(TARGET simplewallet - PROPERTY - LINK_SEARCH_START_STATIC 1) - set_property(TARGET simplewallet - PROPERTY - LINK_SEARCH_END_STATIC 1) -endif () -- cgit v1.2.3 From f53f04724c714a40c10e8c0afdca465054fabca8 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 21 Oct 2014 12:38:00 -0400 Subject: cmake: handle private vs. public headers --- src/CMakeLists.txt | 13 +++++++++++++ src/common/CMakeLists.txt | 12 ++++++++++-- src/connectivity_tool/CMakeLists.txt | 4 ++-- src/crypto/CMakeLists.txt | 9 +++++++-- src/cryptonote_core/CMakeLists.txt | 9 +++++++-- src/daemon/CMakeLists.txt | 9 +++++++-- src/miner/CMakeLists.txt | 9 +++++++-- src/mnemonics/CMakeLists.txt | 9 +++++++-- src/rpc/CMakeLists.txt | 9 +++++++-- src/simplewallet/CMakeLists.txt | 9 +++++++-- src/wallet/CMakeLists.txt | 9 +++++++-- 11 files changed, 81 insertions(+), 20 deletions(-) (limited to 'src/daemon') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a229ddda..ec773ae02 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,6 +32,19 @@ add_definitions(-DSTATICLIB) # miniupnp changed their static define add_definitions(-DMINIUPNP_STATICLIB) +function (bitmonero_private_headers group) + source_group("${group}\\Private" + FILES + ${ARGN}) +endfunction () + +function (bitmonero_install_headers subdir) + install( + FILES ${ARGN} + DESTINATION "include/${subdir}" + COMPONENT development) +endfunction () + function (bitmonero_add_executable name) source_group("${name}" FILES diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 47456afbd..fcc30e192 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -32,7 +32,9 @@ set(common_sources dns_utils.cpp util.cpp) -set(common_headers +set(common_headers) + +set(common_private_headers base58.h boost_serialization_helper.h command_line.h @@ -43,9 +45,12 @@ set(common_headers util.h varint.h) +bitmonero_private_headers(common + ${common_private_headers}) bitmonero_add_library(common ${common_sources} - ${common_headers}) + ${common_headers} + ${common_private_headers}) target_link_libraries(common PRIVATE crypto @@ -54,3 +59,6 @@ target_link_libraries(common ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${EXTRA_LIBRARIES}) + +#bitmonero_install_headers(common +# ${common_headers}) diff --git a/src/connectivity_tool/CMakeLists.txt b/src/connectivity_tool/CMakeLists.txt index de52b0648..b3a495af9 100644 --- a/src/connectivity_tool/CMakeLists.txt +++ b/src/connectivity_tool/CMakeLists.txt @@ -29,11 +29,11 @@ set(connectivity_tool_sources conn_tool.cpp) -set(connectivity_tool_headers) +set(connectivity_tool_private_headers) bitmonero_add_executable(connectivity_tool ${connectivity_tool_sources} - ${connectivity_tool_headers}) + ${connectivity_tool_private_headers}) target_link_libraries(connectivity_tool PRIVATE cryptonote_core diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt index d13b9c8bc..4afcab9c8 100644 --- a/src/crypto/CMakeLists.txt +++ b/src/crypto/CMakeLists.txt @@ -47,7 +47,9 @@ set(crypto_sources slow-hash.c tree-hash.c) -set(crypto_headers +set(crypto_headers) + +set(crypto_private_headers blake256.h chacha8.h crypto-ops.h @@ -66,6 +68,9 @@ set(crypto_headers skein.h skein_port.h) +bitmonero_private_headers(crypto + ${crypto_private_headers}) bitmonero_add_library(crypto ${crypto_sources} - ${crypto_headers}) + ${crypto_headers} + ${crypto_private_headers}) diff --git a/src/cryptonote_core/CMakeLists.txt b/src/cryptonote_core/CMakeLists.txt index fd84a75ca..c18b01b5d 100644 --- a/src/cryptonote_core/CMakeLists.txt +++ b/src/cryptonote_core/CMakeLists.txt @@ -38,7 +38,9 @@ set(cryptonote_core_sources miner.cpp tx_pool.cpp) -set(cryptonote_core_headers +set(cryptonote_core_headers) + +set(cryptonote_core_private_headers account.h account_boost_serialization.h blockchain_storage.h @@ -58,9 +60,12 @@ set(cryptonote_core_headers tx_pool.h verification_context.h) +bitmonero_private_headers(cryptonote_core + ${crypto_private_headers}) bitmonero_add_library(cryptonote_core ${cryptonote_core_sources} - ${cryptonote_core_headers}) + ${cryptonote_core_headers} + ${cryptonote_core_private_headers}) target_link_libraries(cryptonote_core PUBLIC common diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index fdf6d697c..3fbac07ed 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -29,7 +29,9 @@ set(daemon_sources daemon.cpp) -set(daemon_headers +set(daemon_headers) + +set(daemon_private_headers daemon_commands_handler.h # cryptonote_protocol @@ -48,9 +50,12 @@ set(daemon_headers ../p2p/p2p_protocol_defs.h ../p2p/stdafx.h) +bitmonero_private_headers(daemon + ${daemon_private_headers}) bitmonero_add_executable(daemon ${daemon_sources} - ${daemon_headers}) + ${daemon_headers} + ${daemon_private_headers}) target_link_libraries(daemon PRIVATE rpc diff --git a/src/miner/CMakeLists.txt b/src/miner/CMakeLists.txt index 7f8669665..1c26e759e 100644 --- a/src/miner/CMakeLists.txt +++ b/src/miner/CMakeLists.txt @@ -29,14 +29,19 @@ set(simpleminer_sources simpleminer.cpp) -set(simpleminer_headers +set(simpleminer_headers) + +set(simpleminer_private_headers simpleminer.h simpleminer_protocol_defs.h target_helper.h) +bitmonero_private_headers(simpleminer + ${simpleminer_private_headers}) bitmonero_add_executable(simpleminer ${simpleminer_sources} - ${simpleminer_headers}) + ${simpleminer_headers} + ${simpleminer_private_headers}) target_link_libraries(simpleminer PRIVATE cryptonote_core diff --git a/src/mnemonics/CMakeLists.txt b/src/mnemonics/CMakeLists.txt index 845856538..4f2c36f4e 100644 --- a/src/mnemonics/CMakeLists.txt +++ b/src/mnemonics/CMakeLists.txt @@ -29,7 +29,9 @@ set(mnemonics_sources electrum-words.cpp) -set(mnemonics_headers +set(mnemonics_headers) + +set(mnemonics_private_headers electrum-words.h english.h japanese.h @@ -39,9 +41,12 @@ set(mnemonics_headers singleton.h spanish.h) +bitmonero_private_headers(mnemonics + ${mnemonics_private_headers}) bitmonero_add_library(mnemonics ${mnemonics_sources} - ${mnemonics_headers}) + ${mnemonics_headers} + ${mnemonics_private_headers}) target_link_libraries(mnemonics PRIVATE ${Boost_SYSTEM_LIBRARY}) diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index 31efe7d4c..ba71c8e63 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -29,14 +29,19 @@ set(rpc_sources core_rpc_server.cpp) -set(rpc_headers +set(rpc_headers) + +set(rpc_private_headers core_rpc_server.h core_rpc_server_commands_defs.h core_rpc_server_error_codes.h) +bitmonero_private_headers(rpc + ${rpc_private_headers}) bitmonero_add_library(rpc ${rpc_sources} - ${rpc_headers}) + ${rpc_headers} + ${rpc_private_headers}) target_link_libraries(rpc PRIVATE cryptonote_core diff --git a/src/simplewallet/CMakeLists.txt b/src/simplewallet/CMakeLists.txt index 310efc2f1..682e660da 100644 --- a/src/simplewallet/CMakeLists.txt +++ b/src/simplewallet/CMakeLists.txt @@ -30,13 +30,18 @@ set(simplewallet_sources simplewallet.cpp password_container.cpp) -set(simplewallet_headers +set(simplewallet_headers) + +set(simplewallet_private_headers simplewallet.h password_container.h) +bitmonero_private_headers(simplewallet + ${simplewallet_private_headers}) bitmonero_add_executable(simplewallet ${simplewallet_sources} - ${simplewallet_headers}) + ${simplewallet_headers} + ${simplewallet_private_headers}) target_link_libraries(simplewallet PRIVATE wallet diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt index d7fae541d..e32d86a59 100644 --- a/src/wallet/CMakeLists.txt +++ b/src/wallet/CMakeLists.txt @@ -30,16 +30,21 @@ set(wallet_sources wallet2.cpp wallet_rpc_server.cpp) -set(wallet_headers +set(wallet_headers) + +set(wallet_private_headers wallet2.h wallet_errors.h wallet_rpc_server.h wallet_rpc_server_commands_defs.h wallet_rpc_server_error_codes.h) +bitmonero_private_headers(wallet + ${wallet_private_headers}) bitmonero_add_library(wallet ${wallet_sources} - ${wallet_headers}) + ${wallet_headers} + ${wallet_private_headers}) target_link_libraries(wallet PUBLIC cryptonote_core -- cgit v1.2.3 From 7d708e422397fb0ba8ac29855eb27964115e7217 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 24 Oct 2014 14:48:14 -0400 Subject: cmake: support 2.8.7 Older versions of CMake support LINK_{PUBLIC,PRIVATE} while newer versions prefer PUBLIC and PRIVATE instead, but still support the LINK_ prefix. --- CMakeLists.txt | 2 +- external/unbound/CMakeLists.txt | 8 ++++---- src/CMakeLists.txt | 2 +- src/common/CMakeLists.txt | 2 +- src/connectivity_tool/CMakeLists.txt | 2 +- src/cryptonote_core/CMakeLists.txt | 4 ++-- src/daemon/CMakeLists.txt | 2 +- src/miner/CMakeLists.txt | 2 +- src/mnemonics/CMakeLists.txt | 2 +- src/rpc/CMakeLists.txt | 2 +- src/simplewallet/CMakeLists.txt | 2 +- src/wallet/CMakeLists.txt | 4 ++-- tests/CMakeLists.txt | 2 +- tests/core_proxy/CMakeLists.txt | 2 +- tests/core_tests/CMakeLists.txt | 2 +- tests/daemon_tests/CMakeLists.txt | 2 +- tests/difficulty/CMakeLists.txt | 2 +- tests/functional_tests/CMakeLists.txt | 2 +- tests/hash/CMakeLists.txt | 2 +- tests/net_load_tests/CMakeLists.txt | 4 ++-- tests/performance_tests/CMakeLists.txt | 2 +- tests/unit_tests/CMakeLists.txt | 2 +- 22 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src/daemon') diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dcb36d85..75b7bf60f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ # # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers -cmake_minimum_required(VERSION 2.8.6) +cmake_minimum_required(VERSION 2.8.7) project(bitmonero) diff --git a/external/unbound/CMakeLists.txt b/external/unbound/CMakeLists.txt index a81e80314..08f47cc17 100644 --- a/external/unbound/CMakeLists.txt +++ b/external/unbound/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.8) +cmake_minimum_required(VERSION 2.8.7) project(unbound C) @@ -163,18 +163,18 @@ add_library(unbound ${compat_src} ${libunbound_src}) target_link_libraries(unbound - PRIVATE + LINK_PRIVATE ${OPENSSL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) if (LIBEVENT2_FOUND) target_link_libraries(unbound - PRIVATE + LINK_PRIVATE ${LIBEVENT2_LIBRARIES}) endif () if (WIN32) target_link_libraries(unbound - PRIVATE + LINK_PRIVATE iphlpapi ws2_32) endif () diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dfdf90b97..8cd39a544 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -55,7 +55,7 @@ function (bitmonero_add_executable name) add_executable("${name}" ${ARGN}) target_link_libraries("${name}" - PRIVATE + LINK_PRIVATE ${EXTRA_LIBRARIES}) set_property(TARGET "${name}" PROPERTY diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index fcc30e192..739c0adee 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -52,7 +52,7 @@ bitmonero_add_library(common ${common_headers} ${common_private_headers}) target_link_libraries(common - PRIVATE + LINK_PRIVATE crypto ${UNBOUND_LIBRARY} ${Boost_DATE_TIME_LIBRARY} diff --git a/src/connectivity_tool/CMakeLists.txt b/src/connectivity_tool/CMakeLists.txt index b3a495af9..b0178c70a 100644 --- a/src/connectivity_tool/CMakeLists.txt +++ b/src/connectivity_tool/CMakeLists.txt @@ -35,7 +35,7 @@ bitmonero_add_executable(connectivity_tool ${connectivity_tool_sources} ${connectivity_tool_private_headers}) target_link_libraries(connectivity_tool - PRIVATE + LINK_PRIVATE cryptonote_core crypto common diff --git a/src/cryptonote_core/CMakeLists.txt b/src/cryptonote_core/CMakeLists.txt index c18b01b5d..3c2e097c1 100644 --- a/src/cryptonote_core/CMakeLists.txt +++ b/src/cryptonote_core/CMakeLists.txt @@ -67,13 +67,13 @@ bitmonero_add_library(cryptonote_core ${cryptonote_core_headers} ${cryptonote_core_private_headers}) target_link_libraries(cryptonote_core - PUBLIC + LINK_PUBLIC common crypto ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY} - PRIVATE + LINK_PRIVATE ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index 3fbac07ed..0c9fca880 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -57,7 +57,7 @@ bitmonero_add_executable(daemon ${daemon_headers} ${daemon_private_headers}) target_link_libraries(daemon - PRIVATE + LINK_PRIVATE rpc cryptonote_core crypto diff --git a/src/miner/CMakeLists.txt b/src/miner/CMakeLists.txt index 1c26e759e..3829e5528 100644 --- a/src/miner/CMakeLists.txt +++ b/src/miner/CMakeLists.txt @@ -43,7 +43,7 @@ bitmonero_add_executable(simpleminer ${simpleminer_headers} ${simpleminer_private_headers}) target_link_libraries(simpleminer - PRIVATE + LINK_PRIVATE cryptonote_core common ${Boost_FILESYSTEM_LIBRARY} diff --git a/src/mnemonics/CMakeLists.txt b/src/mnemonics/CMakeLists.txt index 4f2c36f4e..66ef4f3f1 100644 --- a/src/mnemonics/CMakeLists.txt +++ b/src/mnemonics/CMakeLists.txt @@ -48,5 +48,5 @@ bitmonero_add_library(mnemonics ${mnemonics_headers} ${mnemonics_private_headers}) target_link_libraries(mnemonics - PRIVATE + LINK_PRIVATE ${Boost_SYSTEM_LIBRARY}) diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index ba71c8e63..5417a0ec1 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -43,7 +43,7 @@ bitmonero_add_library(rpc ${rpc_headers} ${rpc_private_headers}) target_link_libraries(rpc - PRIVATE + LINK_PRIVATE cryptonote_core ${Boost_CHRONO_LIBRARY} ${Boost_REGEX_LIBRARY} diff --git a/src/simplewallet/CMakeLists.txt b/src/simplewallet/CMakeLists.txt index 682e660da..304063b7a 100644 --- a/src/simplewallet/CMakeLists.txt +++ b/src/simplewallet/CMakeLists.txt @@ -43,7 +43,7 @@ bitmonero_add_executable(simplewallet ${simplewallet_headers} ${simplewallet_private_headers}) target_link_libraries(simplewallet - PRIVATE + LINK_PRIVATE wallet rpc cryptonote_core diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt index e32d86a59..af3ec0fb8 100644 --- a/src/wallet/CMakeLists.txt +++ b/src/wallet/CMakeLists.txt @@ -46,10 +46,10 @@ bitmonero_add_library(wallet ${wallet_headers} ${wallet_private_headers}) target_link_libraries(wallet - PUBLIC + LINK_PUBLIC cryptonote_core mnemonics - PRIVATE + LINK_PRIVATE ${Boost_SERIALIZATION_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0f99cab73..ae20b8754 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -75,7 +75,7 @@ add_executable(hash-target-tests ${hash_targets_sources} ${hash_targets_headers}) target_link_libraries(hash-target-tests - PRIVATE + LINK_PRIVATE cryptonote_core) set_property(TARGET hash-target-tests PROPERTY diff --git a/tests/core_proxy/CMakeLists.txt b/tests/core_proxy/CMakeLists.txt index 7186f2c21..ab6f7d043 100644 --- a/tests/core_proxy/CMakeLists.txt +++ b/tests/core_proxy/CMakeLists.txt @@ -36,7 +36,7 @@ add_executable(core_proxy ${core_proxy_sources} ${core_proxy_headers}) target_link_libraries(core_proxy - PRIVATE + LINK_PRIVATE cryptonote_core ${UPNP_LIBRARIES} ${Boost_CHRONO_LIBRARY} diff --git a/tests/core_tests/CMakeLists.txt b/tests/core_tests/CMakeLists.txt index b8f07b3d2..72c079554 100644 --- a/tests/core_tests/CMakeLists.txt +++ b/tests/core_tests/CMakeLists.txt @@ -58,7 +58,7 @@ add_executable(coretests ${core_tests_sources} ${core_tests_headers}) target_link_libraries(coretests - PRIVATE + LINK_PRIVATE cryptonote_core ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} diff --git a/tests/daemon_tests/CMakeLists.txt b/tests/daemon_tests/CMakeLists.txt index 2b7c82ff0..b7a93481c 100644 --- a/tests/daemon_tests/CMakeLists.txt +++ b/tests/daemon_tests/CMakeLists.txt @@ -35,7 +35,7 @@ add_executable(transfers ${transfers_sources} ${transfers_headers}) target_link_libraries(transfers - PRIVATE + LINK_PRIVATE useragent rpc cryptonote_core diff --git a/tests/difficulty/CMakeLists.txt b/tests/difficulty/CMakeLists.txt index d4ec5bd86..20600a15a 100644 --- a/tests/difficulty/CMakeLists.txt +++ b/tests/difficulty/CMakeLists.txt @@ -35,7 +35,7 @@ add_executable(difficulty-tests ${difficulty_sources} ${difficulty_headers}) target_link_libraries(difficulty-tests - PRIVATE + LINK_PRIVATE cryptonote_core) set_property(TARGET difficulty-tests PROPERTY diff --git a/tests/functional_tests/CMakeLists.txt b/tests/functional_tests/CMakeLists.txt index f778d3265..b91f8afec 100644 --- a/tests/functional_tests/CMakeLists.txt +++ b/tests/functional_tests/CMakeLists.txt @@ -39,7 +39,7 @@ add_executable(functional_tests ${functional_tests_sources} ${functional_tests_headers}) target_link_libraries(functional_tests - PRIVATE + LINK_PRIVATE cryptonote_core wallet common diff --git a/tests/hash/CMakeLists.txt b/tests/hash/CMakeLists.txt index 4f55552d0..2f441d623 100644 --- a/tests/hash/CMakeLists.txt +++ b/tests/hash/CMakeLists.txt @@ -35,7 +35,7 @@ add_executable(hash-tests ${hash_sources} ${hash_headers}) target_link_libraries(hash-tests - PRIVATE + LINK_PRIVATE crypto) set_property(TARGET hash-tests PROPERTY diff --git a/tests/net_load_tests/CMakeLists.txt b/tests/net_load_tests/CMakeLists.txt index 8303b50c0..114d0e680 100644 --- a/tests/net_load_tests/CMakeLists.txt +++ b/tests/net_load_tests/CMakeLists.txt @@ -36,7 +36,7 @@ add_executable(net_load_tests_clt ${clt_sources} ${clt_headers}) target_link_libraries(net_load_tests_clt - PRIVATE + LINK_PRIVATE ${GTEST_MAIN_LIBRARIES} ${Boost_CHRONO_LIBRARY} ${Boost_DATE_TIME_LIBRARY} @@ -55,7 +55,7 @@ add_executable(net_load_tests_srv ${srv_sources} ${srv_headers}) target_link_libraries(net_load_tests_srv - PRIVATE + LINK_PRIVATE ${GTEST_MAIN_LIBRARIES} ${Boost_CHRONO_LIBRARY} ${Boost_DATE_TIME_LIBRARY} diff --git a/tests/performance_tests/CMakeLists.txt b/tests/performance_tests/CMakeLists.txt index f842eee7e..f1734b2a0 100644 --- a/tests/performance_tests/CMakeLists.txt +++ b/tests/performance_tests/CMakeLists.txt @@ -48,7 +48,7 @@ add_executable(performance_tests ${performance_tests_sources} ${performance_tests_headers}) target_link_libraries(performance_tests - PRIVATE + LINK_PRIVATE cryptonote_core common crypto diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index 0a2247084..251f6b66e 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -54,7 +54,7 @@ add_executable(unit_tests ${unit_tests_sources} ${unit_tests_headers}) target_link_libraries(unit_tests - PRIVATE + LINK_PRIVATE cryptonote_core rpc wallet -- cgit v1.2.3 From 01895dd0676cb8252ed5274c15000e361c965370 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 24 Oct 2014 15:30:57 -0400 Subject: cmake: fix up link lines --- src/daemon/CMakeLists.txt | 1 + src/miner/CMakeLists.txt | 1 + src/simplewallet/CMakeLists.txt | 2 +- tests/functional_tests/CMakeLists.txt | 3 ++- tests/performance_tests/CMakeLists.txt | 3 ++- 5 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index 0c9fca880..adcc61c43 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -68,6 +68,7 @@ target_link_libraries(daemon ${Boost_REGEX_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} ${UPNP_LIBRARIES} ${EXTRA_LIBRARIES}) add_dependencies(daemon diff --git a/src/miner/CMakeLists.txt b/src/miner/CMakeLists.txt index 3829e5528..83bda57cc 100644 --- a/src/miner/CMakeLists.txt +++ b/src/miner/CMakeLists.txt @@ -51,4 +51,5 @@ target_link_libraries(simpleminer ${Boost_REGEX_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBRARIES}) diff --git a/src/simplewallet/CMakeLists.txt b/src/simplewallet/CMakeLists.txt index 304063b7a..14f877907 100644 --- a/src/simplewallet/CMakeLists.txt +++ b/src/simplewallet/CMakeLists.txt @@ -52,7 +52,7 @@ target_link_libraries(simplewallet mnemonics ${UNBOUND_LIBRARY} ${UPNP_LIBRARIES} - ${Boost_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBRARIES}) add_dependencies(simplewallet version) diff --git a/tests/functional_tests/CMakeLists.txt b/tests/functional_tests/CMakeLists.txt index b91f8afec..71b7c6e01 100644 --- a/tests/functional_tests/CMakeLists.txt +++ b/tests/functional_tests/CMakeLists.txt @@ -45,7 +45,8 @@ target_link_libraries(functional_tests common crypto ${UNBOUND_LIBRARY} - ${Boost_LIBRARIES} + ${Boost_REGEX_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBRARIES}) set_property(TARGET functional_tests PROPERTY diff --git a/tests/performance_tests/CMakeLists.txt b/tests/performance_tests/CMakeLists.txt index f1734b2a0..ed4d3d4b6 100644 --- a/tests/performance_tests/CMakeLists.txt +++ b/tests/performance_tests/CMakeLists.txt @@ -53,7 +53,8 @@ target_link_libraries(performance_tests common crypto ${UNBOUND_LIBRARY} - ${Boost_LIBRARIES} + ${Boost_CHRONO_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBRARIES}) set_property(TARGET performance_tests PROPERTY -- cgit v1.2.3