aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-10-21 11:21:28 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2014-10-23 16:42:34 -0400
commitc773f465ca7e691b94394d8c7c682c8eb78e5c25 (patch)
tree608ab12a156706ef1c876a33614f3ac6b400d6c3 /src/CMakeLists.txt
parentcmake: put each library into its own directory (diff)
downloadmonero-c773f465ca7e691b94394d8c7c682c8eb78e5c25.tar.xz
cmake: refactor common code with executables
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt24
1 files changed, 24 insertions, 0 deletions
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)