rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
Compiling & building

Conan

The recommended way to install rotor is to use conan package manager.

Among the various ways to include rotor in a project, but the most trivial one is to just check install it to local conan cache via:

conan install rotor/0.26

Please note, that it might take some some time before the new rotor release appears in conan center as this is intentionally non-automated and human-supervised process for inclusion.

Dependencies

C++ 17 is required to use rotor.

The core dependency rotor-core needs intrusive pointer support from boost-smartptr and boost::posix_time::time_duration. (That might be changed in future, PRs are welcome).

The optional event-loop specific supervisors depend on corresponding loop libraries, i.e. rotor-asio depends on boost-asio; the rotor-wx depends wx-widgets.

Compiling

rotor uses cmake for building; it supports the following building options

  • BUILD_BOOST_ASIO - build with boost-asio support (off by default)
  • BUILD_WX build with wx-widgets support (off by default)
  • BUILD_EV build with libev support (off by default)
  • BUILD_EXAMPLES build examples (off by default)
  • BUILD_DOC generate doxygen documentation (off by default, only for release builds)
  • BUILD_THREAD_UNSAFE builds thread-unsafe library (off by default). Enable this option if you are sure, that rotor-objects (i.e. messages and actors) are accessed only from single thread.
  • ROTOR_DEBUG_DELIVERY allow runtime messages inspection (off by default, enabled by default for debug builds)
git clone https://github.com/basiliscos/cpp-rotor rotor
cd rotor
mkdir build
cd build
cmake --build .. --config Release -DBUILD_BOOST_ASIO=on -DBUILD_WX=on

Adding rotor into a project (modern way)

Your CMakeLists.txt should have something like

include(FetchContent)
set(BUILD_BOOST_ASIO ON CACHE BOOL "with asio") # pick options you need
FetchContent_Declare(
rotor
GIT_REPOSITORY https://github.com/basiliscos/cpp-rotor.git
GIT_TAG v0.07
)
FetchContent_MakeAvailable(rotor)
target_include_directories(my_target PUBLIC ${rotor_SOURCE_DIR}/include)
target_link_libraries(my_target rotor::asio)

Adding rotor into a project (classical way)

git clone https://github.com/basiliscos/cpp-rotor.git external/rotor lib/rotor --branch=v0.09

Your CMakeLists.txt should have something like

set(BUILD_BOOST_ASIO ON CACHE BOOL "with asio")
add_subdirectory("lib/rotor")
target_include_directories(my_target PUBLIC
${PROJECT_SOURCE_DIR}/lib/rotor/include
)
target_link_libraries(my_lib rotor::asio)