aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-10-21 11:24:14 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2014-10-23 16:42:34 -0400
commit55ca7d3b34762d9184090d659189959261bcb9a1 (patch)
treebb43a29d200f1414e46d6a8e07c8cf12069b6067 /src
parentcmake: refactor common code with executables (diff)
downloadmonero-55ca7d3b34762d9184090d659189959261bcb9a1.tar.xz
cmake: refactor common code with libraries
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt12
-rw-r--r--src/common/CMakeLists.txt10
-rw-r--r--src/crypto/CMakeLists.txt10
-rw-r--r--src/cryptonote_core/CMakeLists.txt10
-rw-r--r--src/mnemonics/CMakeLists.txt7
-rw-r--r--src/rpc/CMakeLists.txt10
-rw-r--r--src/wallet/CMakeLists.txt10
7 files changed, 18 insertions, 51 deletions
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")