Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
52f8ae6b
Commit
52f8ae6b
authored
Apr 10, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modernize CMake scaffold
parent
ea970422
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
506 additions
and
786 deletions
+506
-786
CMakeLists.txt
CMakeLists.txt
+183
-471
examples/CMakeLists.txt
examples/CMakeLists.txt
+92
-104
libcaf_core/CMakeLists.txt
libcaf_core/CMakeLists.txt
+152
-139
libcaf_io/CMakeLists.txt
libcaf_io/CMakeLists.txt
+41
-37
libcaf_openssl/CMakeLists.txt
libcaf_openssl/CMakeLists.txt
+37
-31
tools/CMakeLists.txt
tools/CMakeLists.txt
+1
-4
No files found.
CMakeLists.txt
View file @
52f8ae6b
This diff is collapsed.
Click to expand it.
examples/CMakeLists.txt
View file @
52f8ae6b
add_custom_target
(
all_examples
)
include_directories
(
${
LIBCAF_INCLUDE_DIRS
}
)
macro
(
add folder name
)
function
(
add_example folder name
)
add_executable
(
${
name
}
${
folder
}
/
${
name
}
.cpp
${
ARGN
}
)
target_link_libraries
(
${
name
}
${
CAF_EXTRA_LDFLAGS
}
${
CAF_LIBRARIES
}
${
PTHREAD_LIBRARIES
}
)
install
(
FILES
${
folder
}
/
${
name
}
.cpp DESTINATION
${
CMAKE_INSTALL_DATADIR
}
/caf/examples/
${
folder
}
)
add_dependencies
(
${
name
}
all_examples
)
endmacro
()
endfunction
()
function
(
add_core_example folder name
)
add_example
(
${
folder
}
${
name
}
${
ARGN
}
)
target_link_libraries
(
${
name
}
CAF::core
)
endfunction
()
# -- examples for CAF::core ----------------------------------------------------
# introductionary applications
add
(
. aout
)
add
(
. hello_world
)
add
_core_example
(
. aout
)
add
_core_example
(
. hello_world
)
# basic message passing primitives
add
(
message_passing calculator
)
add
(
message_passing cell
)
add
(
message_passing dancing_kirby
)
add
(
message_passing delegating
)
add
(
message_passing divider
)
add
(
message_passing fan_out_request
)
add
(
message_passing fixed_stack
)
add
(
message_passing promises
)
add
(
message_passing request
)
add
(
message_passing typed_calculator
)
add
_core_example
(
message_passing calculator
)
add
_core_example
(
message_passing cell
)
add
_core_example
(
message_passing dancing_kirby
)
add
_core_example
(
message_passing delegating
)
add
_core_example
(
message_passing divider
)
add
_core_example
(
message_passing fan_out_request
)
add
_core_example
(
message_passing fixed_stack
)
add
_core_example
(
message_passing promises
)
add
_core_example
(
message_passing request
)
add
_core_example
(
message_passing typed_calculator
)
# streaming API
add
(
streaming integer_stream
)
add
_core_example
(
streaming integer_stream
)
# dynamic behavior changes using 'become'
add
(
dynamic_behavior skip_messages
)
add
(
dynamic_behavior dining_philosophers
)
add
_core_example
(
dynamic_behavior skip_messages
)
add
_core_example
(
dynamic_behavior dining_philosophers
)
# adding custom message types
add
(
custom_type custom_types_1
)
add
(
custom_type custom_types_2
)
add
(
custom_type custom_types_3
)
add
_core_example
(
custom_type custom_types_1
)
add
_core_example
(
custom_type custom_types_2
)
add
_core_example
(
custom_type custom_types_3
)
# basic remoting
add
(
remoting group_chat
)
add
(
remoting group_server
)
add
(
remoting remote_spawn
)
add
(
remoting distributed_calculator
)
# testing DSL
add_example
(
testing ping_pong
)
target_link_libraries
(
ping_pong CAF::core CAF::test
)
# basic I/O with brokers
add
(
broker simple_broker
)
add
(
broker simple_http_broker
)
# testing DSL
add
(
testing ping_pong
)
# -- examples for CAF::io ------------------------------------------------------
if
(
TARGET CAF::io
)
function
(
add_io_example folder name
)
add_example
(
${
folder
}
${
name
}
${
ARGN
}
)
target_link_libraries
(
${
name
}
CAF::io CAF::core
)
endfunction
()
# basic remoting
add_io_example
(
remoting group_chat
)
add_io_example
(
remoting group_server
)
add_io_example
(
remoting remote_spawn
)
add_io_example
(
remoting distributed_calculator
)
# basic I/O with brokers
add_io_example
(
broker simple_broker
)
add_io_example
(
broker simple_http_broker
)
if
(
CAF_BUILD_PROTOBUF_EXAMPLES
)
find_package
(
Protobuf
)
if
(
PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE
)
PROTOBUF_GENERATE_CPP
(
ProtoSources ProtoHeaders
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/remoting/pingpong.proto"
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
# add binary dir as include path as generated headers will be located there
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_executable
(
protobuf_broker broker/protobuf_broker.cpp
${
ProtoSources
}
)
target_link_libraries
(
protobuf_broker
${
CMAKE_DL_LIBS
}
${
CAF_LIBRARIES
}
${
PTHREAD_LIBRARIES
}
${
PROTOBUF_LIBRARIES
}
)
add_dependencies
(
protobuf_broker all_examples
)
endif
(
PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE
)
endif
()
if
(
CAF_BUILD_QT_EXAMPLES
)
find_package
(
Qt5 COMPONENTS Core Gui Widgets QUIET
)
if
(
Qt5_FOUND
)
message
(
STATUS
"Found Qt5"
)
#include(${QT_USE_FILE})
QT5_ADD_RESOURCES
(
GROUP_CHAT_RCS
)
QT5_WRAP_UI
(
GROUP_CHAT_UI_HDR qtsupport/chatwindow.ui
)
QT5_WRAP_CPP
(
GROUP_CHAT_MOC_SRC qtsupport/chatwidget.hpp
)
# generated headers will be in cmake build directory
#include_directories(. qtsupport ${CMAKE_CURRENT_BINARY_DIR} ${CPPA_INCLUDE})
include_directories
(
qtsupport
${
CMAKE_CURRENT_BINARY_DIR
}
${
Qt5Core_INCLUDE_DIRS
}
${
Qt5Gui_INCLUDE_DIRS
}
${
Qt5Widgets_INCLUDE_DIRS
}
)
set
(
GROUP_CHAT_SRC qtsupport/qt_group_chat.cpp qtsupport/chatwidget.cpp
)
add_executable
(
qt_group_chat
${
GROUP_CHAT_SRC
}
${
GROUP_CHAT_MOC_SRC
}
${
GROUP_CHAT_UI_HDR
}
)
target_link_libraries
(
qt_group_chat
${
CMAKE_DL_LIBS
}
${
CAF_LIBRARIES
}
Qt5::Core
Qt5::Gui
Qt5::Widgets
)
add_dependencies
(
qt_group_chat all_examples
)
else
()
find_package
(
Qt4
)
if
(
QT4_FOUND
)
message
(
STATUS
"Found Qt4"
)
include
(
${
QT_USE_FILE
}
)
QT4_ADD_RESOURCES
(
GROUP_CHAT_RCS
)
QT4_WRAP_UI
(
GROUP_CHAT_UI_HDR qtsupport/chatwindow.ui
)
QT4_WRAP_CPP
(
GROUP_CHAT_MOC_SRC qtsupport/chatwidget.hpp
)
# generated headers will be in cmake build directory
#include_directories(. qtsupport ${CMAKE_CURRENT_BINARY_DIR} ${CPPA_INCLUDE})
include_directories
(
qtsupport
${
CMAKE_CURRENT_BINARY_DIR
}
)
set
(
GROUP_CHAT_SRCS qtsupport/qt_group_chat.cpp qtsupport/chatwidget.cpp
)
add_executable
(
qt_group_chat
${
GROUP_CHAT_SRCS
}
${
GROUP_CHAT_MOC_SRC
}
${
GROUP_CHAT_UI_HDR
}
)
target_link_libraries
(
qt_group_chat
${
CMAKE_DL_LIBS
}
${
CAF_LIBRARIES
}
${
QT_LIBRARIES
}
)
add_dependencies
(
qt_group_chat all_examples
)
endif
()
if
(
CAF_BUILD_PROTOBUF_EXAMPLES
)
find_package
(
Protobuf REQUIRED
)
if
(
NOT PROTOBUF_PROTOC_EXECUTABLE
)
message
(
FATAL_ERROR
"CMake was unable to set PROTOBUF_PROTOC_EXECUTABLE"
)
endif
()
protobuf_generate_cpp
(
ProtoSources ProtoHeaders
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/remoting/pingpong.proto"
)
include_directories
(
${
PROTOBUF_INCLUDE_DIR
}
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_executable
(
protobuf_broker broker/protobuf_broker.cpp
${
ProtoSources
}
)
target_link_libraries
(
protobuf_broker
${
PROTOBUF_LIBRARIES
}
CAF::core CAF::io
)
add_dependencies
(
protobuf_broker all_examples
)
endif
()
if
(
CAF_BUILD_QT5_EXAMPLES
)
find_package
(
Qt5 COMPONENTS Core Gui Widgets REQUIRED
)
message
(
STATUS
"Found Qt5"
)
#include(${QT_USE_FILE})
QT5_ADD_RESOURCES
(
GROUP_CHAT_RCS
)
QT5_WRAP_UI
(
GROUP_CHAT_UI_HDR qtsupport/chatwindow.ui
)
QT5_WRAP_CPP
(
GROUP_CHAT_MOC_SRC qtsupport/chatwidget.hpp
)
# generated headers will be in cmake build directory
include_directories
(
qtsupport
${
CMAKE_CURRENT_BINARY_DIR
}
${
Qt5Core_INCLUDE_DIRS
}
${
Qt5Gui_INCLUDE_DIRS
}
${
Qt5Widgets_INCLUDE_DIRS
}
)
set
(
GROUP_CHAT_SRC qtsupport/qt_group_chat.cpp qtsupport/chatwidget.cpp
)
add_executable
(
qt_group_chat
${
GROUP_CHAT_SRC
}
${
GROUP_CHAT_MOC_SRC
}
${
GROUP_CHAT_UI_HDR
}
)
target_link_libraries
(
qt_group_chat
Qt5::Core
Qt5::Gui
Qt5::Widgets
CAF::core
CAF::io
)
add_dependencies
(
qt_group_chat all_examples
)
endif
()
if
(
NOT CAF_NO_CURL_EXAMPLES
)
find_package
(
CURL
)
if
(
CURL_FOUND
)
add_executable
(
curl_fuse curl/curl_fuse.cpp
)
include_directories
(
${
CURL_INCLUDE_DIRS
}
)
target_link_libraries
(
curl_fuse
${
CMAKE_DL_LIBS
}
${
CAF_LIBRARIES
}
${
PTHREAD_LIBRARIES
}
${
CURL_LIBRARY
}
)
add_dependencies
(
curl_fuse all_examples
)
endif
(
CURL_FOUND
)
if
(
CAF_BUILD_CURL_EXAMPLES
)
find_package
(
CURL REQUIRED
)
add_executable
(
curl_fuse curl/curl_fuse.cpp
)
include_directories
(
${
CURL_INCLUDE_DIRS
}
)
target_link_libraries
(
curl_fuse
${
CURL_LIBRARY
}
CAF::core CAF::io
)
add_dependencies
(
curl_fuse all_examples
)
endif
()
libcaf_core/CMakeLists.txt
View file @
52f8ae6b
...
...
@@ -19,9 +19,9 @@ add_enum_consistency_check("caf/intrusive/inbox_result.hpp"
add_enum_consistency_check
(
"caf/intrusive/task_result.hpp"
"src/intrusive/task_result_strings.cpp"
)
# --
list cpp files for libcaf_core
--------------------------------------------
# --
add library target ------------
--------------------------------------------
set
(
CAF_CORE_SOURCES
add_library
(
libcaf_core_obj OBJECT
${
CAF_CORE_HEADERS
}
src/abstract_actor.cpp
src/abstract_channel.cpp
src/abstract_group.cpp
...
...
@@ -154,140 +154,38 @@ set(CAF_CORE_SOURCES
src/uuid.cpp
)
# -- list cpp files for caf-core-test ------------------------------------------
target_include_directories
(
libcaf_core_obj PRIVATE
"
${
CMAKE_BINARY_DIR
}
"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
set
(
CAF_CORE_TEST_SOURCES
test/actor_clock.cpp
test/actor_factory.cpp
test/actor_lifetime.cpp
test/actor_pool.cpp
test/actor_profiler.cpp
test/actor_registry.cpp
test/actor_system_config.cpp
test/actor_termination.cpp
test/aout.cpp
test/behavior.cpp
test/binary_deserializer.cpp
test/binary_serializer.cpp
test/blocking_actor.cpp
test/broadcast_downstream_manager.cpp
test/byte.cpp
test/composition.cpp
test/config_option.cpp
test/config_option_set.cpp
test/config_value.cpp
test/config_value_adaptor.cpp
test/const_typed_message_view.cpp
test/constructor_attach.cpp
test/continuous_streaming.cpp
test/cow_tuple.cpp
test/custom_exception_handler.cpp
test/decorator/sequencer.cpp
test/deep_to_string.cpp
test/detached_actors.cpp
test/detail/bounds_checker.cpp
test/detail/ini_consumer.cpp
test/detail/limited_vector.cpp
test/detail/meta_object.cpp
test/detail/parse.cpp
test/detail/parser/read_bool.cpp
test/detail/parser/read_floating_point.cpp
test/detail/parser/read_ini.cpp
test/detail/parser/read_number.cpp
test/detail/parser/read_number_or_timespan.cpp
test/detail/parser/read_signed_integer.cpp
test/detail/parser/read_string.cpp
test/detail/parser/read_timespan.cpp
test/detail/parser/read_unsigned_integer.cpp
test/detail/ringbuffer.cpp
test/detail/ripemd_160.cpp
test/detail/serialized_size.cpp
test/detail/tick_emitter.cpp
test/detail/type_id_list_builder.cpp
test/detail/unique_function.cpp
test/detail/unordered_flat_map.cpp
test/dictionary.cpp
test/dynamic_spawn.cpp
test/error.cpp
test/expected.cpp
test/function_view.cpp
test/fused_downstream_manager.cpp
test/handles.cpp
test/hash/fnv.cpp
test/inspector.cpp
test/intrusive/drr_cached_queue.cpp
test/intrusive/drr_queue.cpp
test/intrusive/fifo_inbox.cpp
test/intrusive/lifo_inbox.cpp
test/intrusive/task_queue.cpp
test/intrusive/wdrr_dynamic_multiplexed_queue.cpp
test/intrusive/wdrr_fixed_multiplexed_queue.cpp
test/intrusive_ptr.cpp
test/ipv4_address.cpp
test/ipv4_endpoint.cpp
test/ipv4_subnet.cpp
test/ipv6_address.cpp
test/ipv6_endpoint.cpp
test/ipv6_subnet.cpp
test/local_group.cpp
test/logger.cpp
test/mailbox_element.cpp
test/make_config_value_field.cpp
test/message.cpp
test/message_id.cpp
test/message_lifetime.cpp
test/metaprogramming.cpp
test/mixin/requester.cpp
test/mixin/sender.cpp
test/mock_streaming_classes.cpp
test/native_streaming_classes.cpp
test/node_id.cpp
test/optional.cpp
test/or_else.cpp
test/pipeline_streaming.cpp
test/policy/categorized.cpp
test/policy/select_all.cpp
test/policy/select_any.cpp
test/request_timeout.cpp
test/result.cpp
test/selective_streaming.cpp
test/serialization.cpp
test/settings.cpp
test/simple_timeout.cpp
test/span.cpp
test/stateful_actor.cpp
test/string_algorithms.cpp
test/string_view.cpp
test/sum_type.cpp
test/thread_hook.cpp
test/tracing_data.cpp
test/type_id_list.cpp
test/typed_behavior.cpp
test/typed_message_view.cpp
test/typed_response_promise.cpp
test/typed_spawn.cpp
test/unit.cpp
test/uri.cpp
test/uuid.cpp
test/variant.cpp
)
add_library
(
libcaf_core
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_core_obj>
)
# -- add library target --------------------------------------------------------
target_include_directories
(
libcaf_core INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
)
add_library
(
libcaf_core_obj OBJECT
${
CAF_CORE_SOURCES
}
${
CAF_CORE_HEADERS
}
)
target_include_directories
(
libcaf_core INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_BINARY_DIR
}
>
)
add_library
(
libcaf_core
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_core_obj>
)
add_library
(
CAF::core ALIAS libcaf_core
)
add_library
(
caf::core ALIAS libcaf_core
)
# -- dependencies and compiler flags -------------------------------------------
if
(
BUILD_SHARED_LIBS AND NOT WIN32
)
target_compile_options
(
libcaf_core PRIVATE -fPIC
)
target_compile_options
(
libcaf_core_obj PRIVATE -fPIC
)
endif
()
target_link_libraries
(
libcaf_core PUBLIC
${
CAF_EXTRA_LDFLAGS
}
)
if
(
NOT TARGET Threads::Threads
)
find_package
(
Threads REQUIRED
)
endif
()
target_link_libraries
(
libcaf_core PUBLIC Threads::Threads
)
if
(
CAF_SANITIZERS
)
target_link_libraries
(
caf-incubator PUBLIC -fsanitize=
${
CAF_SANITIZERS
}
)
endif
()
# -- API exports ---------------------------------------------------------------
generate_export_header
(
libcaf_core
EXPORT_MACRO_NAME CAF_CORE_EXPORT
...
...
@@ -321,21 +219,136 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/caf"
# -- build unit tests ----------------------------------------------------------
if
(
NOT CAF_NO_UNIT_TESTS
)
add_executable
(
caf-core-test
test/core-test.cpp
${
CAF_CORE_TEST_SOURCES
}
$<TARGET_OBJECTS:libcaf_core_obj>
)
target_include_directories
(
caf-core-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
target_compile_definitions
(
caf-core-test PRIVATE libcaf_core_EXPORTS
)
target_link_libraries
(
caf-core-test
${
CAF_EXTRA_LDFLAGS
}
)
add_test_suites
(
caf-core-test
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
${
CAF_CORE_TEST_SOURCES
}
)
if
(
NOT CAF_BUILD_TESTING
)
return
()
endif
()
# -- add this library to the global CAF_LIBRARIES ------------------------------
add_executable
(
caf-core-test
test/core-test.cpp
$<TARGET_OBJECTS:libcaf_core_obj>
)
target_include_directories
(
caf-core-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
list
(
APPEND CAF_LIBRARIES libcaf_core
)
target_compile_definitions
(
caf-core-test PRIVATE libcaf_core_EXPORTS
)
set
(
CAF_LIBRARIES
${
CAF_LIBRARIES
}
PARENT_SCOPE
)
target_link_libraries
(
caf-core-test PUBLIC CAF::test
)
target_include_directories
(
caf-core-test PRIVATE
"
${
CMAKE_BINARY_DIR
}
"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
caf_add_test_suites
(
caf-core-test
actor_clock
actor_factory
actor_lifetime
actor_pool
actor_profiler
actor_registry
actor_system_config
actor_termination
aout
behavior
binary_deserializer
binary_serializer
blocking_actor
broadcast_downstream_manager
byte
composition
config_option
config_option_set
config_value
config_value_adaptor
const_typed_message_view
constructor_attach
continuous_streaming
cow_tuple
custom_exception_handler
decorator.sequencer
deep_to_string
detached_actors
detail.bounds_checker
detail.ini_consumer
detail.limited_vector
detail.meta_object
detail.parse
detail.parser.read_bool
detail.parser.read_floating_point
detail.parser.read_ini
detail.parser.read_number
detail.parser.read_number_or_timespan
detail.parser.read_signed_integer
detail.parser.read_string
detail.parser.read_timespan
detail.parser.read_unsigned_integer
detail.ringbuffer
detail.ripemd_160
detail.serialized_size
detail.tick_emitter
detail.type_id_list_builder
detail.unique_function
detail.unordered_flat_map
dictionary
dynamic_spawn
error
expected
function_view
fused_downstream_manager
handles
hash.fnv
inspector
intrusive.drr_cached_queue
intrusive.drr_queue
intrusive.fifo_inbox
intrusive.lifo_inbox
intrusive.task_queue
intrusive.wdrr_dynamic_multiplexed_queue
intrusive.wdrr_fixed_multiplexed_queue
intrusive_ptr
ipv4_address
ipv4_endpoint
ipv4_subnet
ipv6_address
ipv6_endpoint
ipv6_subnet
local_group
logger
mailbox_element
make_config_value_field
message
message_id
message_lifetime
metaprogramming
mixin.requester
mixin.sender
mock_streaming_classes
native_streaming_classes
node_id
optional
or_else
pipeline_streaming
policy.categorized
policy.select_all
policy.select_any
request_timeout
result
selective_streaming
serialization
settings
simple_timeout
span
stateful_actor
string_algorithms
string_view
sum_type
thread_hook
tracing_data
type_id_list
typed_behavior
typed_message_view
typed_response_promise
typed_spawn
unit
uri
uuid
variant
)
libcaf_io/CMakeLists.txt
View file @
52f8ae6b
...
...
@@ -10,9 +10,9 @@ add_enum_consistency_check("caf/io/basp/message_type.hpp"
add_enum_consistency_check
(
"caf/io/network/operation.hpp"
"src/io/network/operation_strings.cpp"
)
# --
list cpp files ----
--------------------------------------------------------
# --
add library target
--------------------------------------------------------
set
(
CAF_IO_SOURCES
add_library
(
libcaf_io_obj OBJECT
${
CAF_IO_HEADERS
}
src/detail/socket_guard.cpp
src/io/abstract_broker.cpp
src/io/basp/header.cpp
...
...
@@ -55,38 +55,29 @@ set(CAF_IO_SOURCES
src/policy/udp.cpp
)
set
(
CAF_IO_TEST_SOURCES
test/io/basp/message_queue.cpp
test/io/basp_broker.cpp
test/io/broker.cpp
test/io/http_broker.cpp
test/io/monitor.cpp
test/io/network/default_multiplexer.cpp
test/io/network/ip_endpoint.cpp
test/io/receive_buffer.cpp
test/io/remote_actor.cpp
test/io/remote_group.cpp
test/io/remote_spawn.cpp
test/io/unpublish.cpp
test/io/worker.cpp
)
# -- add library target --------------------------------------------------------
add_library
(
libcaf_io_obj OBJECT
${
CAF_IO_SOURCES
}
${
CAF_IO_HEADERS
}
)
target_include_directories
(
libcaf_io_obj PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
add_library
(
libcaf_io
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_io_obj>
)
add_library
(
caf::io ALIAS libcaf_io
)
target_include_directories
(
libcaf_io INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
)
add_library
(
CAF::io ALIAS libcaf_io
)
if
(
BUILD_SHARED_LIBS AND NOT WIN32
)
target_compile_options
(
libcaf_io PRIVATE -fPIC
)
target_compile_options
(
libcaf_io_obj PRIVATE -fPIC
)
endif
()
target_link_libraries
(
libcaf_io PUBLIC caf::core
${
CAF_EXTRA_LDFLAGS
}
)
target_link_libraries
(
libcaf_io_obj PRIVATE CAF::core
)
target_link_libraries
(
libcaf_io PUBLIC CAF::core
)
if
(
MSVC
)
target_link_libraries
(
libcaf_io PUBLIC ws2_32 iphlpapi
)
endif
()
generate_export_header
(
libcaf_io
EXPORT_MACRO_NAME CAF_IO_EXPORT
...
...
@@ -119,21 +110,34 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/caf"
# -- build unit tests ----------------------------------------------------------
if
(
NOT CAF_NO_UNIT_TESTS
)
add_executable
(
caf-io-test
test/io-test.cpp
${
CAF_IO_TEST_SOURCES
}
$<TARGET_OBJECTS:libcaf_io_obj>
)
target_include_directories
(
caf-io-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
target_compile_definitions
(
caf-io-test PRIVATE libcaf_io_EXPORTS
)
target_link_libraries
(
caf-io-test caf::core
${
CAF_EXTRA_LDFLAGS
}
)
add_test_suites
(
caf-io-test
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
${
CAF_IO_TEST_SOURCES
}
)
if
(
NOT CAF_BUILD_TESTING
)
return
()
endif
()
# -- add this library to the global CAF_LIBRARIES ------------------------------
add_executable
(
caf-io-test
test/io-test.cpp
$<TARGET_OBJECTS:libcaf_io_obj>
)
target_include_directories
(
caf-io-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
list
(
APPEND CAF_LIBRARIES libcaf_io
)
target_compile_definitions
(
caf-io-test PRIVATE libcaf_io_EXPORTS
)
set
(
CAF_LIBRARIES
${
CAF_LIBRARIES
}
PARENT_SCOPE
)
target_link_libraries
(
caf-io-test CAF::core CAF::test
)
target_include_directories
(
caf-io-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
caf_add_test_suites
(
caf-io-test
io.basp.message_queue
io.basp_broker
io.broker
io.http_broker
io.monitor
io.network.default_multiplexer
io.network.ip_endpoint
io.receive_buffer
io.remote_actor
io.remote_group
io.remote_spawn
io.unpublish
io.worker
)
libcaf_openssl/CMakeLists.txt
View file @
52f8ae6b
...
...
@@ -2,9 +2,9 @@
file
(
GLOB_RECURSE CAF_OPENSSL_HEADERS
"caf/*.hpp"
)
# --
list cpp files ----
--------------------------------------------------------
# --
add library target
--------------------------------------------------------
set
(
CAF_OPENSSL_SOURCES
add_library
(
libcaf_openssl_obj OBJECT
${
CAF_OPENSSL_HEADERS
}
src/openssl/manager.cpp
src/openssl/middleman_actor.cpp
src/openssl/publish.cpp
...
...
@@ -12,33 +12,35 @@ set(CAF_OPENSSL_SOURCES
src/openssl/session.cpp
)
set
(
CAF_OPENSSL_TEST_SOURCES
test/openssl/authentication.cpp
test/openssl/remote_actor.cpp
)
# -- add library target --------------------------------------------------------
add_library
(
libcaf_openssl_obj OBJECT
${
CAF_OPENSSL_SOURCES
}
${
CAF_OPENSSL_HEADERS
}
)
target_include_directories
(
libcaf_openssl_obj PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
add_library
(
libcaf_openssl
"
${
PROJECT_SOURCE_DIR
}
/cmake/dummy.cpp"
$<TARGET_OBJECTS:libcaf_openssl_obj>
)
add_library
(
caf::openssl ALIAS libcaf_openssl
)
target_include_directories
(
libcaf_openssl INTERFACE
$<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
>
)
add_library
(
CAF::openssl ALIAS libcaf_openssl
)
if
(
BUILD_SHARED_LIBS AND NOT WIN32
)
target_compile_options
(
libcaf_openssl PRIVATE -fPIC
)
target_compile_options
(
libcaf_openssl_obj PRIVATE -fPIC
)
endif
()
target_link_libraries
(
libcaf_openssl PUBLIC
caf::core caf::io
${
OPENSSL_LIBRARIES
}
)
if
(
NOT APPLE AND NOT WIN32
)
target_link_libraries
(
libcaf_openssl PUBLIC
"-pthread"
)
if
(
NOT TARGET OpenSSL::SSL OR NOT TARGET OpenSSL::Crypto
)
find_package
(
OpenSSL REQUIRED
)
endif
()
target_link_libraries
(
libcaf_openssl_obj PUBLIC
CAF::core CAF::io
OpenSSL::SSL OpenSSL::Crypto
)
target_link_libraries
(
libcaf_openssl PUBLIC
CAF::core CAF::io
OpenSSL::SSL OpenSSL::Crypto
)
generate_export_header
(
libcaf_openssl
EXPORT_MACRO_NAME CAF_OPENSSL_EXPORT
EXPORT_FILE_NAME
"
${
CMAKE_BINARY_DIR
}
/caf/detail/openssl_export.hpp"
...
...
@@ -75,22 +77,26 @@ install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/caf"
# -- build unit tests ----------------------------------------------------------
if
(
NOT CAF_NO_UNIT_TESTS
)
add_executable
(
caf-openssl-test
test/openssl-test.cpp
${
CAF_OPENSSL_TEST_SOURCES
}
$<TARGET_OBJECTS:libcaf_openssl_obj>
)
target_include_directories
(
caf-openssl-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
target_compile_definitions
(
caf-openssl-test PRIVATE libcaf_openssl_EXPORTS
)
target_link_libraries
(
caf-openssl-test caf::core caf::io
${
OPENSSL_LIBRARIES
}
${
CAF_EXTRA_LDFLAGS
}
)
add_test_suites
(
caf-openssl-test
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
${
CAF_OPENSSL_TEST_SOURCES
}
)
if
(
NOT CAF_BUILD_TESTING
)
return
()
endif
()
# -- add this library to the global CAF_LIBRARIES ------------------------------
add_executable
(
caf-openssl-test
test/openssl-test.cpp
${
CAF_OPENSSL_TEST_SOURCES
}
$<TARGET_OBJECTS:libcaf_openssl_obj>
)
target_include_directories
(
caf-openssl-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/test"
)
list
(
APPEND CAF_LIBRARIES libcaf_openssl
)
target_compile_definitions
(
caf-openssl-test PRIVATE libcaf_openssl_EXPORTS
)
set
(
CAF_LIBRARIES
${
CAF_LIBRARIES
}
PARENT_SCOPE
)
target_link_libraries
(
caf-openssl-test PRIVATE
CAF::io CAF::core CAF::test OpenSSL::SSL OpenSSL::Crypto
)
target_include_directories
(
caf-openssl-test PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
)
caf_add_test_suites
(
caf-openssl-test
openssl.authentication
openssl.remote_actor
)
tools/CMakeLists.txt
View file @
52f8ae6b
...
...
@@ -4,10 +4,7 @@ include_directories(${LIBCAF_INCLUDE_DIRS})
macro
(
add name
)
add_executable
(
${
name
}
${
name
}
.cpp
${
ARGN
}
)
target_link_libraries
(
${
name
}
${
CAF_EXTRA_LDFLAGS
}
${
CAF_LIBRARIES
}
${
PTHREAD_LIBRARIES
}
)
target_link_libraries
(
${
name
}
CAF::core CAF::io
)
install
(
FILES
${
name
}
.cpp DESTINATION
${
CMAKE_INSTALL_DATADIR
}
/caf/tools/
${
folder
}
)
add_dependencies
(
${
name
}
all_tools
)
endmacro
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment