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/CMakeLists.txt | 61 ++++-------------------- src/common/CMakeLists.txt | 64 ++++++++++++++++++++++++++ src/connectivity_tool/CMakeLists.txt | 62 +++++++++++++++++++++++++ src/crypto/CMakeLists.txt | 79 ++++++++++++++++++++++++++++++++ src/cryptonote_core/CMakeLists.txt | 83 +++++++++++++++++++++++++++++++++ src/daemon/CMakeLists.txt | 89 ++++++++++++++++++++++++++++++++++++ src/miner/CMakeLists.txt | 66 ++++++++++++++++++++++++++ src/mnemonics/CMakeLists.txt | 52 +++++++++++++++++++++ src/rpc/CMakeLists.txt | 57 +++++++++++++++++++++++ src/simplewallet/CMakeLists.txt | 70 ++++++++++++++++++++++++++++ src/wallet/CMakeLists.txt | 59 ++++++++++++++++++++++++ 11 files changed, 691 insertions(+), 51 deletions(-) create mode 100644 src/common/CMakeLists.txt create mode 100644 src/connectivity_tool/CMakeLists.txt create mode 100644 src/crypto/CMakeLists.txt create mode 100644 src/cryptonote_core/CMakeLists.txt create mode 100644 src/daemon/CMakeLists.txt create mode 100644 src/miner/CMakeLists.txt create mode 100644 src/mnemonics/CMakeLists.txt create mode 100644 src/rpc/CMakeLists.txt create mode 100644 src/simplewallet/CMakeLists.txt create mode 100644 src/wallet/CMakeLists.txt (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aec615eb2..790b44593 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,55 +32,14 @@ add_definitions(-DSTATICLIB) # miniupnp changed their static define add_definitions(-DMINIUPNP_STATICLIB) -file(GLOB_RECURSE COMMON common/*) -file(GLOB_RECURSE CRYPTO crypto/*) -file(GLOB_RECURSE CRYPTONOTE_CORE cryptonote_core/*) -file(GLOB_RECURSE CRYPTONOTE_PROTOCOL cryptonote_protocol/*) -file(GLOB_RECURSE DAEMON daemon/*) -file(GLOB_RECURSE P2P p2p/*) -file(GLOB_RECURSE RPC rpc/*) -file(GLOB_RECURSE SIMPLEWALLET simplewallet/*) -file(GLOB_RECURSE CONN_TOOL connectivity_tool/*) -file(GLOB_RECURSE WALLET wallet/*) -file(GLOB_RECURSE MINER miner/*) -file(GLOB MNEMONICS mnemonics/*) +add_subdirectory(common) +add_subdirectory(crypto) +add_subdirectory(cryptonote_core) +add_subdirectory(mnemonics) +add_subdirectory(rpc) +add_subdirectory(wallet) -source_group(common FILES ${COMMON}) -source_group(crypto FILES ${CRYPTO}) -source_group(cryptonote_core FILES ${CRYPTONOTE_CORE}) -source_group(cryptonote_protocol FILES ${CRYPTONOTE_PROTOCOL}) -source_group(daemon FILES ${DAEMON}) -source_group(p2p FILES ${P2P}) -source_group(rpc FILES ${RPC}) -source_group(simplewallet FILES ${SIMPLEWALLET}) -source_group(connectivity-tool FILES ${CONN_TOOL}) -source_group(wallet FILES ${WALLET}) -source_group(simpleminer FILES ${MINER}) -source_group(mnemonics FILES ${MNEMONICS}) - -add_library(common ${COMMON}) -add_library(crypto ${CRYPTO}) -add_library(cryptonote_core ${CRYPTONOTE_CORE}) -add_library(mnemonics ${MNEMONICS}) -add_executable(daemon ${DAEMON} ${P2P} ${CRYPTONOTE_PROTOCOL}) -add_executable(connectivity_tool ${CONN_TOOL}) -add_executable(simpleminer ${MINER}) -target_link_libraries(daemon rpc cryptonote_core crypto common ${UNBOUND_LIBRARY} ${UPNP_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBRARIES}) -target_link_libraries(connectivity_tool cryptonote_core crypto common ${UNBOUND_LIBRARY} ${Boost_LIBRARIES} ${EXTRA_LIBRARIES}) -target_link_libraries(simpleminer cryptonote_core crypto common ${UNBOUND_LIBRARY} ${Boost_LIBRARIES} ${EXTRA_LIBRARIES}) -add_library(rpc ${RPC}) -add_library(wallet ${WALLET}) -target_link_libraries(wallet mnemonics) -add_executable(simplewallet ${SIMPLEWALLET} ) -target_link_libraries(simplewallet wallet rpc cryptonote_core crypto common mnemonics ${UNBOUND_LIBRARY} ${UPNP_LIBRARIES} ${Boost_LIBRARIES} ${EXTRA_LIBRARIES}) -add_dependencies(daemon version) -add_dependencies(rpc version) -add_dependencies(simplewallet version) - -set_property(TARGET common crypto cryptonote_core rpc wallet PROPERTY FOLDER "libs") -set_property(TARGET daemon simplewallet connectivity_tool simpleminer PROPERTY FOLDER "prog") -if (STATIC) - set_property(TARGET daemon simplewallet connectivity_tool simpleminer PROPERTY LINK_SEARCH_START_STATIC 1) - set_property(TARGET daemon simplewallet connectivity_tool simpleminer PROPERTY LINK_SEARCH_END_STATIC 1) -endif() -set_property(TARGET daemon PROPERTY OUTPUT_NAME "bitmonerod") +add_subdirectory(connectivity_tool) +add_subdirectory(miner) +add_subdirectory(simplewallet) +add_subdirectory(daemon) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt new file mode 100644 index 000000000..347bee05b --- /dev/null +++ b/src/common/CMakeLists.txt @@ -0,0 +1,64 @@ +# 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(common_sources + base58.cpp + command_line.cpp + dns_utils.cpp + util.cpp) + +set(common_headers + base58.h + boost_serialization_helper.h + command_line.h + dns_utils.h + int-util.h + pod-class.h + unordered_containers_boost_serialization.h + util.h + varint.h) + +source_group(common + FILES + ${common_sources} + ${common_headers}) + +add_library(common + ${common_sources} + ${common_headers}) +target_link_libraries(common + PRIVATE + crypto + ${UNBOUND_LIBRARY} + ${Boost_DATE_TIME_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${EXTRA_LIBRARIES}) +set_property(TARGET common + PROPERTY + FOLDER "libs") diff --git a/src/connectivity_tool/CMakeLists.txt b/src/connectivity_tool/CMakeLists.txt new file mode 100644 index 000000000..150815a5d --- /dev/null +++ b/src/connectivity_tool/CMakeLists.txt @@ -0,0 +1,62 @@ +# 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(connectivity_tool_sources + conn_tool.cpp) + +set(connectivity_tool_headers) + +source_group(connectivity-tool + FILES + ${connectivity_tool_sources} + ${connectivity_tool_headers}) + +add_executable(connectivity_tool + ${connectivity_tool_sources} + ${connectivity_tool_headers}) +target_link_libraries(connectivity_tool + PRIVATE + cryptonote_core + crypto + common + ${CMAKE_THREAD_LIBS_INIT} + ${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/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt new file mode 100644 index 000000000..d21551d14 --- /dev/null +++ b/src/crypto/CMakeLists.txt @@ -0,0 +1,79 @@ +# 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(crypto_sources + aesb.c + blake256.c + chacha8.c + crypto-ops-data.c + crypto-ops.c + crypto.cpp + groestl.c + hash-extra-blake.c + hash-extra-groestl.c + hash-extra-jh.c + hash-extra-skein.c + hash.c + jh.c + keccak.c + oaes_lib.c + random.c + skein.c + slow-hash.c + tree-hash.c) + +set(crypto_headers + blake256.h + chacha8.h + crypto-ops.h + crypto.h + generic-ops.h + groestl.h + groestl_tables.h + hash-ops.h + hash.h + initializer.h + jh.h + keccak.h + oaes_config.h + oaes_lib.h + random.h + skein.h + skein_port.h) + +source_group(crypto + FILES + ${crypto_sources} + ${crypto_headers}) + +add_library(crypto + ${crypto_sources} + ${crypto_headers}) +set_property(TARGET crypto + PROPERTY + FOLDER "libs") diff --git a/src/cryptonote_core/CMakeLists.txt b/src/cryptonote_core/CMakeLists.txt new file mode 100644 index 000000000..dcca6e543 --- /dev/null +++ b/src/cryptonote_core/CMakeLists.txt @@ -0,0 +1,83 @@ +# 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(cryptonote_core_sources + account.cpp + blockchain_storage.cpp + checkpoints.cpp + checkpoints_create.cpp + cryptonote_basic_impl.cpp + cryptonote_core.cpp + cryptonote_format_utils.cpp + difficulty.cpp + miner.cpp + tx_pool.cpp) + +set(cryptonote_core_headers + account.h + account_boost_serialization.h + blockchain_storage.h + blockchain_storage_boost_serialization.h + checkpoints.h + checkpoints_create.h + connection_context.h + cryptonote_basic.h + cryptonote_basic_impl.h + cryptonote_boost_serialization.h + cryptonote_core.h + cryptonote_format_utils.h + cryptonote_stat_info.h + difficulty.h + miner.h + tx_extra.h + tx_pool.h + verification_context.h) + +source_group(cryptonote_core + FILES + ${cryptonote_core_sources} + ${cryptonote_core_headers}) + +add_library(cryptonote_core + ${cryptonote_core_sources} + ${cryptonote_core_headers}) +target_link_libraries(cryptonote_core + PUBLIC + common + crypto + ${Boost_DATE_TIME_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${Boost_SERIALIZATION_LIBRARY} + PRIVATE + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${EXTRA_LIBRARIES}) +set_property(TARGET cryptonote_core + PROPERTY + FOLDER "libs") 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 () diff --git a/src/miner/CMakeLists.txt b/src/miner/CMakeLists.txt new file mode 100644 index 000000000..551d9e70a --- /dev/null +++ b/src/miner/CMakeLists.txt @@ -0,0 +1,66 @@ +# 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(simpleminer_sources + simpleminer.cpp) + +set(simpleminer_headers + simpleminer.h + simpleminer_protocol_defs.h + target_helper.h) + +source_group(simpleminer + FILES + ${simpleminer_sources} + ${simpleminer_headers}) + +add_executable(simpleminer + ${simpleminer_sources} + ${simpleminer_headers}) +target_link_libraries(simpleminer + PRIVATE + cryptonote_core + common + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${Boost_REGEX_LIBRARY} + ${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/mnemonics/CMakeLists.txt b/src/mnemonics/CMakeLists.txt new file mode 100644 index 000000000..b0dc956ea --- /dev/null +++ b/src/mnemonics/CMakeLists.txt @@ -0,0 +1,52 @@ +# 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(mnemonics_sources + electrum-words.cpp) + +set(mnemonics_headers + electrum-words.h + english.h + japanese.h + language_base.h + old_english.h + portuguese.h + singleton.h + spanish.h) + +source_group(mnemonics + FILES + ${mnemonics_sources} + ${mnemonics_headers}) + +add_library(mnemonics + ${mnemonics_sources} + ${mnemonics_headers}) +target_link_libraries(mnemonics + PRIVATE + ${Boost_SYSTEM_LIBRARY}) diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt new file mode 100644 index 000000000..552655dc4 --- /dev/null +++ b/src/rpc/CMakeLists.txt @@ -0,0 +1,57 @@ +# 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(rpc_sources + core_rpc_server.cpp) + +set(rpc_headers + core_rpc_server.h + core_rpc_server_commands_defs.h + core_rpc_server_error_codes.h) + +source_group(rpc + FILES + ${rpc_sources} + ${rpc_headers}) + +add_library(rpc + ${rpc_sources} + ${rpc_headers}) +target_link_libraries(rpc + PRIVATE + cryptonote_core + ${Boost_CHRONO_LIBRARY} + ${Boost_REGEX_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${EXTRA_LIBRARIES}) +add_dependencies(rpc + version) +set_property(TARGET rpc + PROPERTY + FOLDER "libs") diff --git a/src/simplewallet/CMakeLists.txt b/src/simplewallet/CMakeLists.txt new file mode 100644 index 000000000..756b8d753 --- /dev/null +++ b/src/simplewallet/CMakeLists.txt @@ -0,0 +1,70 @@ +# 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(simplewallet_sources + simplewallet.cpp + password_container.cpp) + +set(simplewallet_headers + simplewallet.h + password_container.h) + +source_group(simplewallet + FILES + ${simplewallet_sources} + ${simplewallet_headers}) + +add_executable(simplewallet + ${simplewallet_sources} + ${simplewallet_headers}) +target_link_libraries(simplewallet + PRIVATE + wallet + rpc + cryptonote_core + crypto + common + mnemonics + ${UNBOUND_LIBRARY} + ${UPNP_LIBRARIES} + ${Boost_LIBRARIES} + ${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 () diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt new file mode 100644 index 000000000..7428cc390 --- /dev/null +++ b/src/wallet/CMakeLists.txt @@ -0,0 +1,59 @@ +# 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(wallet_sources + wallet2.cpp + wallet_rpc_server.cpp) + +set(wallet_headers + wallet2.h + wallet_errors.h + wallet_rpc_server.h + wallet_rpc_server_commands_defs.h + wallet_rpc_server_error_codes.h) + +source_group(wallet + FILES + ${wallet_sources} + ${wallet_headers}) + +add_library(wallet + ${wallet_sources} + ${wallet_headers}) +target_link_libraries(wallet + PUBLIC + cryptonote_core + mnemonics + PRIVATE + ${Boost_SERIALIZATION_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${EXTRA_LIBRARIES}) +set_property(TARGET wallet + PROPERTY + FOLDER "libs") -- 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') 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 55ca7d3b34762d9184090d659189959261bcb9a1 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 21 Oct 2014 11:24:14 -0400 Subject: cmake: refactor common code with libraries --- src/CMakeLists.txt | 12 ++++++++++++ src/common/CMakeLists.txt | 10 +--------- src/crypto/CMakeLists.txt | 10 +--------- src/cryptonote_core/CMakeLists.txt | 10 +--------- src/mnemonics/CMakeLists.txt | 7 +------ src/rpc/CMakeLists.txt | 10 +--------- src/wallet/CMakeLists.txt | 10 +--------- 7 files changed, 18 insertions(+), 51 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 868bdc2e9..3a229ddda 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,6 +56,18 @@ function (bitmonero_add_executable name) endif () endfunction () +function (bitmonero_add_library name) + source_group("${name}" + FILES + ${ARGN}) + + add_library("${name}" + ${ARGN}) + set_property(TARGET "${name}" + PROPERTY + FOLDER "libs") +endfunction () + add_subdirectory(common) add_subdirectory(crypto) add_subdirectory(cryptonote_core) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 347bee05b..47456afbd 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -43,12 +43,7 @@ set(common_headers util.h varint.h) -source_group(common - FILES - ${common_sources} - ${common_headers}) - -add_library(common +bitmonero_add_library(common ${common_sources} ${common_headers}) target_link_libraries(common @@ -59,6 +54,3 @@ target_link_libraries(common ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${EXTRA_LIBRARIES}) -set_property(TARGET common - PROPERTY - FOLDER "libs") diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt index d21551d14..d13b9c8bc 100644 --- a/src/crypto/CMakeLists.txt +++ b/src/crypto/CMakeLists.txt @@ -66,14 +66,6 @@ set(crypto_headers skein.h skein_port.h) -source_group(crypto - FILES - ${crypto_sources} - ${crypto_headers}) - -add_library(crypto +bitmonero_add_library(crypto ${crypto_sources} ${crypto_headers}) -set_property(TARGET crypto - PROPERTY - FOLDER "libs") diff --git a/src/cryptonote_core/CMakeLists.txt b/src/cryptonote_core/CMakeLists.txt index dcca6e543..fd84a75ca 100644 --- a/src/cryptonote_core/CMakeLists.txt +++ b/src/cryptonote_core/CMakeLists.txt @@ -58,12 +58,7 @@ set(cryptonote_core_headers tx_pool.h verification_context.h) -source_group(cryptonote_core - FILES - ${cryptonote_core_sources} - ${cryptonote_core_headers}) - -add_library(cryptonote_core +bitmonero_add_library(cryptonote_core ${cryptonote_core_sources} ${cryptonote_core_headers}) target_link_libraries(cryptonote_core @@ -78,6 +73,3 @@ target_link_libraries(cryptonote_core ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${EXTRA_LIBRARIES}) -set_property(TARGET cryptonote_core - PROPERTY - FOLDER "libs") diff --git a/src/mnemonics/CMakeLists.txt b/src/mnemonics/CMakeLists.txt index b0dc956ea..845856538 100644 --- a/src/mnemonics/CMakeLists.txt +++ b/src/mnemonics/CMakeLists.txt @@ -39,12 +39,7 @@ set(mnemonics_headers singleton.h spanish.h) -source_group(mnemonics - FILES - ${mnemonics_sources} - ${mnemonics_headers}) - -add_library(mnemonics +bitmonero_add_library(mnemonics ${mnemonics_sources} ${mnemonics_headers}) target_link_libraries(mnemonics diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index 552655dc4..31efe7d4c 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -34,12 +34,7 @@ set(rpc_headers core_rpc_server_commands_defs.h core_rpc_server_error_codes.h) -source_group(rpc - FILES - ${rpc_sources} - ${rpc_headers}) - -add_library(rpc +bitmonero_add_library(rpc ${rpc_sources} ${rpc_headers}) target_link_libraries(rpc @@ -52,6 +47,3 @@ target_link_libraries(rpc ${EXTRA_LIBRARIES}) add_dependencies(rpc version) -set_property(TARGET rpc - PROPERTY - FOLDER "libs") diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt index 7428cc390..d7fae541d 100644 --- a/src/wallet/CMakeLists.txt +++ b/src/wallet/CMakeLists.txt @@ -37,12 +37,7 @@ set(wallet_headers wallet_rpc_server_commands_defs.h wallet_rpc_server_error_codes.h) -source_group(wallet - FILES - ${wallet_sources} - ${wallet_headers}) - -add_library(wallet +bitmonero_add_library(wallet ${wallet_sources} ${wallet_headers}) target_link_libraries(wallet @@ -54,6 +49,3 @@ target_link_libraries(wallet ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${EXTRA_LIBRARIES}) -set_property(TARGET wallet - PROPERTY - FOLDER "libs") -- 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') 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 c24d22b44e1c6a0c30c7e85da9e828810141f313 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 21 Oct 2014 14:17:32 -0400 Subject: cmake: clean up if auto-dereferencing CMake will auto-dereference variable names in if statements, so there's no need to dereference them manually. --- CMakeLists.txt | 6 +++--- src/version.cmake | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/CMakeLists.txt b/CMakeLists.txt index bdb347191..35dd132ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") if (NOT DEFINED ENV{DEVELOPER_LOCAL_TOOLS}) message(STATUS "Could not find DEVELOPER_LOCAL_TOOLS in env (not required)") set(BOOST_IGNORE_SYSTEM_PATHS_DEFAULT OFF) -elseif ("$ENV{DEVELOPER_LOCAL_TOOLS}" EQUAL 1) +elseif (ENV{DEVELOPER_LOCAL_TOOLS} EQUAL 1) message(STATUS "Found: env DEVELOPER_LOCAL_TOOLS = 1") set(BOOST_IGNORE_SYSTEM_PATHS_DEFAULT ON) else() @@ -130,7 +130,7 @@ if(MSVC) include_directories(SYSTEM src/platform/msc) else() set(ARCH native CACHE STRING "CPU to build for: -march value or default") - if("${ARCH}" STREQUAL "default") + if(ARCH STREQUAL "default") set(ARCH_FLAG "") else() set(ARCH_FLAG "-march=${ARCH}") @@ -212,7 +212,7 @@ if(NOT Boost_FOUND) die("Could not find Boost libraries, please make sure you have installed Boost or libboost-all-dev (1.53 or 1.55+) or the equivalent") endif() -if((${Boost_MAJOR_VERSION} EQUAL 1) AND (${Boost_MINOR_VERSION} EQUAL 54)) +if((Boost_MAJOR_VERSION EQUAL 1) AND (Boost_MINOR_VERSION EQUAL 54)) die("Boost version 1.54 is unsupported due to a bug (see: http://goo.gl/RrCFmA), please install Boost 1.53 or 1.55 and above") endif() diff --git a/src/version.cmake b/src/version.cmake index 2f3aa0b25..0baee19fd 100644 --- a/src/version.cmake +++ b/src/version.cmake @@ -68,7 +68,7 @@ else() message(STATUS "The most recent tag was at ${TAGGEDCOMMIT}") # Check if we're building that tagged commit or a different one - if(${COMMIT} MATCHES ${TAGGEDCOMMIT}) + if(COMMIT MATCHES TAGGEDCOMMIT) message(STATUS "You are building a tagged release") set(VERSIONTAG "release") else() -- cgit v1.2.3 From 464c2805e5512117970974d5cadc4e59eee5d921 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 23 Oct 2014 16:34:42 -0400 Subject: cmake: fix up miniupnpc's define It's only necessary on Windows builds and new versions renamed the define without any compatibility bridge. --- src/CMakeLists.txt | 8 +++++--- tests/CMakeLists.txt | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ec773ae02..dfdf90b97 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,9 +28,11 @@ # # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers -add_definitions(-DSTATICLIB) -# miniupnp changed their static define -add_definitions(-DMINIUPNP_STATICLIB) +if (WIN32 AND STATIC) + add_definitions(-DSTATICLIB) + # miniupnp changed their static define + add_definitions(-DMINIUPNP_STATICLIB) +endif () function (bitmonero_private_headers group) source_group("${group}\\Private" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 3da9fdb6b..0f99cab73 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -28,9 +28,11 @@ # # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers -add_definitions(-DSTATICLIB) -# miniupnp changed their static define -add_definitions(-DMINIUPNP_STATICLIB) +if (WIN32 AND STATIC) + add_definitions(-DSTATICLIB) + # miniupnp changed their static define + add_definitions(-DMINIUPNP_STATICLIB) +endif () find_package(GTest) -- 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') 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') 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 From e3776876af57756a3fdafd168df9d680a6ee69f2 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 24 Oct 2014 15:52:01 -0400 Subject: cmake: Windows and static builds need this --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8cd39a544..a77c232ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,7 +28,7 @@ # # Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers -if (WIN32 AND STATIC) +if (WIN32 OR STATIC) add_definitions(-DSTATICLIB) # miniupnp changed their static define add_definitions(-DMINIUPNP_STATICLIB) -- cgit v1.2.3 From ec54e2f82be0aa8a1bdea8549640698e0ff2a371 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 18 Nov 2014 17:02:28 -0500 Subject: cmake: place binaries together in the build tree This allows Windows to copy binaries to one place rather than to each executable directory. --- src/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a77c232ca..43c5740af 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -60,6 +60,9 @@ function (bitmonero_add_executable name) set_property(TARGET "${name}" PROPERTY FOLDER "prog") + set_property(TARGET "${name}" + PROPERTY + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") if (STATIC) set_property(TARGET "${name}" -- cgit v1.2.3