From b64aba6ea614033cd882bdd2983df84399c8940e Mon Sep 17 00:00:00 2001 From: mitko501 <422190@mail.muni.cz> Date: Fri, 14 Apr 2017 13:57:09 +0200 Subject: [PATCH] Refactoring of cmake for eacirc-streams --- CMakeLists.txt | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6d4ba8a..16d7b532 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,38 +14,37 @@ else() message(FATAL_ERROR "unsuported compiler id:${CMAKE_CXX_COMPILER_ID}, path: ${CMAKE_CXX_COMPILER}") endif() -add_executable(eacirc-streams main.cc - generator - stream.h - streams.cc + +# === Provide sources as library +add_library(eacirc-streams-lib STATIC + stream streams.h + streams.cc + ) + +set_target_properties(eacirc-streams-lib PROPERTIES + LINKER_LANGUAGE CXX ) +target_link_libraries(eacirc-streams-lib eacirc-core) + + +# === eacirc generator executable +add_executable(eacirc-streams main.cc generator) + set_target_properties(eacirc-streams PROPERTIES LINKER_LANGUAGE CXX ) + add_subdirectory(eacirc-core) add_subdirectory(streams/estream) add_subdirectory(streams/sha3) add_subdirectory(streams/block) -target_link_libraries(eacirc-streams eacirc-core) +target_link_libraries(eacirc-streams eacirc-core eacirc-streams-lib) build_stream(eacirc-streams estream) build_stream(eacirc-streams sha3) build_stream(eacirc-streams block) - -# === Provide sources as Library === -add_library(eacirc-streams-lib STATIC - stream - streams.h - streams.cc - ) - -set_target_properties(eacirc-streams-lib PROPERTIES - LINKER_LANGUAGE CXX - ) - -target_link_libraries(eacirc-streams-lib eacirc-core) \ No newline at end of file