aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2017-09-14 08:28:23 +0900
committerstoffu <stoffu@protonmail.ch>2017-09-21 07:47:37 +0900
commite29282d2081709e126b1fb67f49e9d4a666794da (patch)
tree1787dbfeb55ffaa94a34813cf53c741544d2dd3e /src
parentMerge pull request #2441 (diff)
downloadmonero-e29282d2081709e126b1fb67f49e9d4a666794da.tar.xz
build: auto update version info without manually deleting version.h
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/blockchain_utilities/CMakeLists.txt6
-rw-r--r--src/cryptonote_core/CMakeLists.txt1
-rw-r--r--src/cryptonote_protocol/CMakeLists.txt2
-rw-r--r--src/daemon/CMakeLists.txt2
-rw-r--r--src/debug_utilities/CMakeLists.txt4
-rw-r--r--src/p2p/CMakeLists.txt2
-rw-r--r--src/rpc/CMakeLists.txt7
-rw-r--r--src/simplewallet/CMakeLists.txt3
-rw-r--r--src/version.cmake4
-rw-r--r--src/version.cpp.in9
-rw-r--r--src/version.h6
-rw-r--r--src/version.h.in4
-rw-r--r--src/wallet/CMakeLists.txt3
14 files changed, 26 insertions, 30 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e3cb7cfd6..3e0bfb59c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -96,6 +96,9 @@ function (monero_add_library name)
PRIVATE $<TARGET_PROPERTY:${name},INTERFACE_COMPILE_DEFINITIONS>)
endfunction ()
+set_source_files_properties(${CMAKE_BINARY_DIR}/version.cpp PROPERTIES GENERATED ON)
+monero_add_library(version ${CMAKE_BINARY_DIR}/version.cpp)
+
add_subdirectory(common)
add_subdirectory(crypto)
add_subdirectory(ringct)
diff --git a/src/blockchain_utilities/CMakeLists.txt b/src/blockchain_utilities/CMakeLists.txt
index ffdaad4af..0eaf71084 100644
--- a/src/blockchain_utilities/CMakeLists.txt
+++ b/src/blockchain_utilities/CMakeLists.txt
@@ -77,6 +77,7 @@ target_link_libraries(blockchain_import
cryptonote_core
blockchain_db
p2p
+ version
epee
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
@@ -89,8 +90,6 @@ if(ARCH_WIDTH)
PUBLIC -DARCH_WIDTH=${ARCH_WIDTH})
endif()
-add_dependencies(blockchain_import
- version)
set_property(TARGET blockchain_import
PROPERTY
OUTPUT_NAME "monero-blockchain-import")
@@ -104,6 +103,7 @@ target_link_libraries(blockchain_export
cryptonote_core
blockchain_db
p2p
+ version
epee
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
@@ -111,8 +111,6 @@ target_link_libraries(blockchain_export
${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES})
-add_dependencies(blockchain_export
- version)
set_property(TARGET blockchain_export
PROPERTY
OUTPUT_NAME "monero-blockchain-export")
diff --git a/src/cryptonote_core/CMakeLists.txt b/src/cryptonote_core/CMakeLists.txt
index 7c43323d4..7b73eebd1 100644
--- a/src/cryptonote_core/CMakeLists.txt
+++ b/src/cryptonote_core/CMakeLists.txt
@@ -55,6 +55,7 @@ monero_add_library(cryptonote_core
${cryptonote_core_private_headers})
target_link_libraries(cryptonote_core
PUBLIC
+ version
common
cncrypto
blockchain_db
diff --git a/src/cryptonote_protocol/CMakeLists.txt b/src/cryptonote_protocol/CMakeLists.txt
index 4ce380a48..347e48eee 100644
--- a/src/cryptonote_protocol/CMakeLists.txt
+++ b/src/cryptonote_protocol/CMakeLists.txt
@@ -39,5 +39,3 @@ target_link_libraries(cryptonote_protocol
p2p
PRIVATE
${EXTRA_LIBRARIES})
-add_dependencies(cryptonote_protocol
- version)
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index 782667867..d0fc1d846 100644
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -94,6 +94,7 @@ target_link_libraries(daemon
daemonizer
serialization
daemon_rpc_server
+ version
${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
@@ -102,7 +103,6 @@ target_link_libraries(daemon
${CMAKE_THREAD_LIBS_INIT}
${ZMQ_LIB}
${EXTRA_LIBRARIES})
-add_dependencies(daemon version)
set_property(TARGET daemon
PROPERTY
OUTPUT_NAME "monerod")
diff --git a/src/debug_utilities/CMakeLists.txt b/src/debug_utilities/CMakeLists.txt
index 99198dc57..7a82c12d9 100644
--- a/src/debug_utilities/CMakeLists.txt
+++ b/src/debug_utilities/CMakeLists.txt
@@ -42,8 +42,6 @@ target_link_libraries(cn_deserialize
epee
${CMAKE_THREAD_LIBS_INIT})
-add_dependencies(cn_deserialize
- version)
set_property(TARGET cn_deserialize
PROPERTY
OUTPUT_NAME "monero-utils-deserialize")
@@ -65,8 +63,6 @@ target_link_libraries(object_sizes
epee
${CMAKE_THREAD_LIBS_INIT})
-add_dependencies(object_sizes
- version)
set_property(TARGET object_sizes
PROPERTY
OUTPUT_NAME "monero-utils-object-sizes")
diff --git a/src/p2p/CMakeLists.txt b/src/p2p/CMakeLists.txt
index 0704940b5..2e34db5d1 100644
--- a/src/p2p/CMakeLists.txt
+++ b/src/p2p/CMakeLists.txt
@@ -47,5 +47,3 @@ target_link_libraries(p2p
${Boost_THREAD_LIBRARY}
PRIVATE
${EXTRA_LIBRARIES})
-add_dependencies(p2p
- version)
diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt
index b5c38b1a8..23bb6aaae 100644
--- a/src/rpc/CMakeLists.txt
+++ b/src/rpc/CMakeLists.txt
@@ -117,10 +117,3 @@ target_link_libraries(daemon_rpc_server
${EXTRA_LIBRARIES})
target_include_directories(daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH})
target_include_directories(obj_daemon_rpc_server PUBLIC ${ZMQ_INCLUDE_PATH})
-
-
-add_dependencies(rpc
- version)
-
-add_dependencies(daemon_rpc_server
- version)
diff --git a/src/simplewallet/CMakeLists.txt b/src/simplewallet/CMakeLists.txt
index 443e9b87e..b56085b8f 100644
--- a/src/simplewallet/CMakeLists.txt
+++ b/src/simplewallet/CMakeLists.txt
@@ -49,14 +49,13 @@ target_link_libraries(simplewallet
common
mnemonics
p2p
+ version
${Boost_CHRONO_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES})
-add_dependencies(simplewallet
- version)
set_property(TARGET simplewallet
PROPERTY
OUTPUT_NAME "monero-wallet-cli")
diff --git a/src/version.cmake b/src/version.cmake
index 623d3cf1f..45a97cd20 100644
--- a/src/version.cmake
+++ b/src/version.cmake
@@ -36,7 +36,7 @@ if(RET)
message(WARNING "Cannot determine current commit. Make sure that you are building either from a Git working tree or from a source archive.")
set(VERSIONTAG "unknown")
- configure_file("src/version.h.in" "${TO}")
+ configure_file("src/version.cpp.in" "${TO}")
else()
message(STATUS "You are currently on commit ${COMMIT}")
@@ -59,5 +59,5 @@ else()
endif()
endif()
- configure_file("src/version.h.in" "${TO}")
+ configure_file("src/version.cpp.in" "${TO}")
endif()
diff --git a/src/version.cpp.in b/src/version.cpp.in
new file mode 100644
index 000000000..320a8d58a
--- /dev/null
+++ b/src/version.cpp.in
@@ -0,0 +1,9 @@
+#define DEF_MONERO_VERSION_TAG "@VERSIONTAG@"
+#define DEF_MONERO_VERSION "0.11.0.0"
+#define DEF_MONERO_RELEASE_NAME "Helium Hydra"
+#define DEF_MONERO_VERSION_FULL DEF_MONERO_VERSION "-" DEF_MONERO_VERSION_TAG
+
+const char* const MONERO_VERSION_TAG = DEF_MONERO_VERSION_TAG;
+const char* const MONERO_VERSION = DEF_MONERO_VERSION;
+const char* const MONERO_RELEASE_NAME = DEF_MONERO_RELEASE_NAME;
+const char* const MONERO_VERSION_FULL = DEF_MONERO_VERSION_FULL;
diff --git a/src/version.h b/src/version.h
new file mode 100644
index 000000000..d1d06c790
--- /dev/null
+++ b/src/version.h
@@ -0,0 +1,6 @@
+#pragma once
+
+extern const char* const MONERO_VERSION_TAG;
+extern const char* const MONERO_VERSION;
+extern const char* const MONERO_RELEASE_NAME;
+extern const char* const MONERO_VERSION_FULL;
diff --git a/src/version.h.in b/src/version.h.in
deleted file mode 100644
index 281b52db4..000000000
--- a/src/version.h.in
+++ /dev/null
@@ -1,4 +0,0 @@
-#define MONERO_VERSION_TAG "@VERSIONTAG@"
-#define MONERO_VERSION "0.11.0.0"
-#define MONERO_RELEASE_NAME "Helium Hydra"
-#define MONERO_VERSION_FULL MONERO_VERSION "-" MONERO_VERSION_TAG
diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt
index 639080051..fe87d0de1 100644
--- a/src/wallet/CMakeLists.txt
+++ b/src/wallet/CMakeLists.txt
@@ -84,7 +84,6 @@ target_link_libraries(wallet
${Boost_REGEX_LIBRARY}
PRIVATE
${EXTRA_LIBRARIES})
-add_dependencies(wallet version)
if (NOT BUILD_GUI_DEPS)
set(wallet_rpc_sources
@@ -110,13 +109,13 @@ if (NOT BUILD_GUI_DEPS)
cryptonote_core
cncrypto
common
+ version
${Boost_CHRONO_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${EXTRA_LIBRARIES})
- add_dependencies(wallet_rpc_server version)
set_property(TARGET wallet_rpc_server
PROPERTY
OUTPUT_NAME "monero-wallet-rpc")