diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-10-21 11:21:28 -0400 |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2014-10-23 16:42:34 -0400 |
commit | c773f465ca7e691b94394d8c7c682c8eb78e5c25 (patch) | |
tree | 608ab12a156706ef1c876a33614f3ac6b400d6c3 /src/CMakeLists.txt | |
parent | cmake: put each library into its own directory (diff) | |
download | monero-c773f465ca7e691b94394d8c7c682c8eb78e5c25.tar.xz |
cmake: refactor common code with executables
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 24 |
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) |