-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(examples): Deduplicate code into
add_example
helper
- Loading branch information
1 parent
8960ce9
commit 3781495
Showing
13 changed files
with
211 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,9 @@ | ||
################################################################################ | ||
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # | ||
# Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # | ||
# # | ||
# This software is distributed under the terms of the # | ||
# GNU Lesser General Public Licence (LGPL) version 3, # | ||
# copied verbatim in the file "LICENSE" # | ||
################################################################################ | ||
|
||
add_executable(fairmq-ex-1-1-sampler sampler.cxx) | ||
target_link_libraries(fairmq-ex-1-1-sampler PRIVATE FairMQ) | ||
|
||
add_executable(fairmq-ex-1-1-sink sink.cxx) | ||
target_link_libraries(fairmq-ex-1-1-sink PRIVATE FairMQ) | ||
|
||
add_custom_target(Example11 DEPENDS fairmq-ex-1-1-sampler fairmq-ex-1-1-sink) | ||
|
||
set(EX_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
set(FAIRMQ_BIN_DIR ${CMAKE_BINARY_DIR}/fairmq) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fairmq-start-ex-1-1.sh.in ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-1-1.sh) | ||
|
||
# test | ||
|
||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test-ex-1-1.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test-ex-1-1.sh) | ||
|
||
add_test(NAME Example.1-1.zeromq COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-1-1.sh zeromq) | ||
set_tests_properties(Example.1-1.zeromq PROPERTIES TIMEOUT "30") | ||
|
||
add_test(NAME Example.1-1.shmem COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-1-1.sh shmem) | ||
set_tests_properties(Example.1-1.shmem PROPERTIES TIMEOUT "30") | ||
|
||
# install | ||
|
||
install( | ||
TARGETS | ||
fairmq-ex-1-1-sampler | ||
fairmq-ex-1-1-sink | ||
|
||
LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${PROJECT_INSTALL_BINDIR} | ||
) | ||
|
||
# configure run script with different executable paths for build and for install directories | ||
set(EX_BIN_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_INSTALL_BINDIR}) | ||
set(FAIRMQ_BIN_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_INSTALL_BINDIR}/fairmq) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fairmq-start-ex-1-1.sh.in ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-1-1.sh_install) | ||
|
||
install( | ||
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-1-1.sh_install | ||
DESTINATION ${PROJECT_INSTALL_BINDIR} | ||
RENAME fairmq-start-ex-1-1.sh | ||
) | ||
add_example(NAME 1-1 DEVICE sampler sink) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,9 @@ | ||
################################################################################ | ||
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # | ||
# Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # | ||
# # | ||
# This software is distributed under the terms of the # | ||
# GNU Lesser General Public Licence (LGPL) version 3, # | ||
# copied verbatim in the file "LICENSE" # | ||
################################################################################ | ||
|
||
add_executable(fairmq-ex-1-n-1-sampler sampler.cxx) | ||
target_link_libraries(fairmq-ex-1-n-1-sampler PRIVATE FairMQ) | ||
|
||
add_executable(fairmq-ex-1-n-1-processor processor.cxx) | ||
target_link_libraries(fairmq-ex-1-n-1-processor PRIVATE FairMQ) | ||
|
||
add_executable(fairmq-ex-1-n-1-sink sink.cxx) | ||
target_link_libraries(fairmq-ex-1-n-1-sink PRIVATE FairMQ) | ||
|
||
add_custom_target(Example1N1 DEPENDS fairmq-ex-1-n-1-sampler fairmq-ex-1-n-1-processor fairmq-ex-1-n-1-sink) | ||
|
||
set(EX_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
set(EX_CONF_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
set(FAIRMQ_BIN_DIR ${CMAKE_BINARY_DIR}/fairmq) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fairmq-start-ex-1-n-1.sh.in ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-1-n-1.sh) | ||
|
||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ex-1-n-1.json ${CMAKE_CURRENT_BINARY_DIR}/ex-1-n-1.json) | ||
|
||
# test | ||
|
||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test-ex-1-n-1.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test-ex-1-n-1.sh) | ||
|
||
add_test(NAME Example.1-n-1.zeromq COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-1-n-1.sh zeromq) | ||
set_tests_properties(Example.1-n-1.zeromq PROPERTIES TIMEOUT "30") | ||
|
||
add_test(NAME Example.1-n-1.shmem COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-1-n-1.sh shmem) | ||
set_tests_properties(Example.1-n-1.shmem PROPERTIES TIMEOUT "30") | ||
|
||
# install | ||
|
||
install( | ||
TARGETS | ||
fairmq-ex-1-n-1-sampler | ||
fairmq-ex-1-n-1-processor | ||
fairmq-ex-1-n-1-sink | ||
|
||
LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${PROJECT_INSTALL_BINDIR} | ||
) | ||
|
||
# configure run script with different executable paths for build and for install directories | ||
set(EX_BIN_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_INSTALL_BINDIR}) | ||
set(EX_CONF_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_INSTALL_DATADIR}) | ||
set(FAIRMQ_BIN_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_INSTALL_BINDIR}/fairmq) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fairmq-start-ex-1-n-1.sh.in ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-1-n-1.sh_install) | ||
|
||
install( | ||
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-1-n-1.sh_install | ||
DESTINATION ${PROJECT_INSTALL_BINDIR} | ||
RENAME fairmq-start-ex-1-n-1.sh | ||
) | ||
|
||
install( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/ex-1-n-1.json | ||
DESTINATION ${PROJECT_INSTALL_DATADIR} | ||
) | ||
add_example(NAME 1-n-1 DEVICE sampler processor sink CONFIG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,11 @@ | ||
################################################################################ | ||
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # | ||
# # | ||
# This software is distributed under the terms of the # | ||
# GNU Lesser General Public Licence (LGPL) version 3, # | ||
# copied verbatim in the file "LICENSE" # | ||
################################################################################ | ||
|
||
set(EX_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
set(FAIRMQ_BIN_DIR ${CMAKE_BINARY_DIR}/fairmq) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fairmq-start-ex-builtin-devices.sh.in ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-builtin-devices.sh) | ||
|
||
# test | ||
|
||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test-ex-builtin-devices.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test-ex-builtin-devices.sh) | ||
|
||
add_test(NAME Example.BuiltinDevices.zeromq COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-builtin-devices.sh zeromq) | ||
set_tests_properties(Example.BuiltinDevices.zeromq PROPERTIES TIMEOUT "30") | ||
|
||
add_test(NAME Example.BuiltinDevices.shmem COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-builtin-devices.sh shmem) | ||
set_tests_properties(Example.BuiltinDevices.shmem PROPERTIES TIMEOUT "30") | ||
|
||
add_test(NAME Example.BuiltinDevices.multipart.zeromq COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-builtin-devices.sh zeromq true 2) | ||
set_tests_properties(Example.BuiltinDevices.multipart.zeromq PROPERTIES TIMEOUT "30") | ||
|
||
add_test(NAME Example.BuiltinDevices.multipart.shmem COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-builtin-devices.sh shmem true 2) | ||
set_tests_properties(Example.BuiltinDevices.multipart.shmem PROPERTIES TIMEOUT "30") | ||
|
||
# install | ||
|
||
# configure run script with different executable paths for build and for install directories | ||
set(EX_BIN_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_INSTALL_BINDIR}) | ||
set(FAIRMQ_BIN_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_INSTALL_BINDIR}/fairmq) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fairmq-start-ex-builtin-devices.sh.in ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-builtin-devices.sh_install) | ||
|
||
install( | ||
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-builtin-devices.sh_install | ||
DESTINATION ${PROJECT_INSTALL_BINDIR} | ||
RENAME fairmq-start-ex-builtin-devices.sh | ||
################################################################################ | ||
# Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # | ||
# # | ||
# This software is distributed under the terms of the # | ||
# GNU Lesser General Public Licence (LGPL) version 3, # | ||
# copied verbatim in the file "LICENSE" # | ||
################################################################################ | ||
|
||
add_example(NAME builtin-devices | ||
VARIANT single_msg multipart | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,11 @@ | ||
################################################################################ | ||
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # | ||
# Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # | ||
# # | ||
# This software is distributed under the terms of the # | ||
# GNU Lesser General Public Licence (LGPL) version 3, # | ||
# copied verbatim in the file "LICENSE" # | ||
################################################################################ | ||
|
||
|
||
add_executable(fairmq-ex-copypush-sampler sampler.cxx) | ||
target_link_libraries(fairmq-ex-copypush-sampler PRIVATE FairMQ) | ||
|
||
add_executable(fairmq-ex-copypush-sink sink.cxx) | ||
target_link_libraries(fairmq-ex-copypush-sink PRIVATE FairMQ) | ||
|
||
add_custom_target(ExampleCopyPush DEPENDS fairmq-ex-copypush-sampler fairmq-ex-copypush-sink) | ||
|
||
set(EX_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}) | ||
set(FAIRMQ_BIN_DIR ${CMAKE_BINARY_DIR}/fairmq) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fairmq-start-ex-copypush.sh.in ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-copypush.sh) | ||
|
||
# test | ||
|
||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test-ex-copypush.sh.in ${CMAKE_CURRENT_BINARY_DIR}/test-ex-copypush.sh) | ||
|
||
add_test(NAME Example.CopyPush.zeromq COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-copypush.sh zeromq) | ||
set_tests_properties(Example.CopyPush.zeromq PROPERTIES TIMEOUT "30") | ||
|
||
add_test(NAME Example.CopyPush.shmem COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test-ex-copypush.sh shmem) | ||
set_tests_properties(Example.CopyPush.shmem PROPERTIES TIMEOUT "30") | ||
|
||
# install | ||
|
||
install( | ||
TARGETS | ||
fairmq-ex-copypush-sampler | ||
fairmq-ex-copypush-sink | ||
|
||
LIBRARY DESTINATION ${PROJECT_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${PROJECT_INSTALL_BINDIR} | ||
) | ||
|
||
# configure run script with different executable paths for build and for install directories | ||
set(EX_BIN_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_INSTALL_BINDIR}) | ||
set(FAIRMQ_BIN_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_INSTALL_BINDIR}/fairmq) | ||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fairmq-start-ex-copypush.sh.in ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-copypush.sh_install) | ||
|
||
install( | ||
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/fairmq-start-ex-copypush.sh_install | ||
DESTINATION ${PROJECT_INSTALL_BINDIR} | ||
RENAME fairmq-start-ex-copypush.sh | ||
add_example(NAME copypush | ||
DEVICE sampler sink | ||
) |
Oops, something went wrong.