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 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/CMakeLists.txt') 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) -- cgit v1.2.3