2018-12-31 20:04:05 +01:00
|
|
|
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
|
|
|
|
|
2020-01-24 01:03:18 +01:00
|
|
|
if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
|
|
|
set(CMAKE_INSTALL_LIBDIR "lib")
|
|
|
|
endif()
|
|
|
|
|
2018-12-31 20:04:05 +01:00
|
|
|
#SOURCE SETS
|
|
|
|
set(TDACTOR_SOURCE
|
2020-11-23 01:24:36 +01:00
|
|
|
td/actor/ConcurrentScheduler.cpp
|
2018-12-31 20:04:05 +01:00
|
|
|
td/actor/impl/Scheduler.cpp
|
|
|
|
td/actor/MultiPromise.cpp
|
|
|
|
td/actor/Timeout.cpp
|
|
|
|
|
2020-11-23 01:24:36 +01:00
|
|
|
td/actor/actor.h
|
|
|
|
td/actor/ConcurrentScheduler.h
|
2018-12-31 20:04:05 +01:00
|
|
|
td/actor/impl/Actor-decl.h
|
|
|
|
td/actor/impl/Actor.h
|
|
|
|
td/actor/impl/ActorId-decl.h
|
|
|
|
td/actor/impl/ActorId.h
|
|
|
|
td/actor/impl/ActorInfo-decl.h
|
|
|
|
td/actor/impl/ActorInfo.h
|
|
|
|
td/actor/impl/EventFull-decl.h
|
|
|
|
td/actor/impl/EventFull.h
|
|
|
|
td/actor/impl/Event.h
|
|
|
|
td/actor/impl/Scheduler-decl.h
|
|
|
|
td/actor/impl/Scheduler.h
|
|
|
|
td/actor/MultiPromise.h
|
|
|
|
td/actor/PromiseFuture.h
|
|
|
|
td/actor/SchedulerLocalStorage.h
|
|
|
|
td/actor/SignalSlot.h
|
|
|
|
td/actor/SleepActor.h
|
|
|
|
td/actor/Timeout.h
|
|
|
|
)
|
|
|
|
|
|
|
|
set(TDACTOR_TEST_SOURCE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/actors_main.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/actors_simple.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/actors_workers.cpp
|
2018-01-29 11:29:24 +01:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/test/actors_bugs.cpp
|
2018-12-31 20:04:05 +01:00
|
|
|
PARENT_SCOPE
|
|
|
|
)
|
|
|
|
|
|
|
|
#RULES
|
|
|
|
|
|
|
|
#LIBRARIES
|
|
|
|
|
|
|
|
add_library(tdactor STATIC ${TDACTOR_SOURCE})
|
|
|
|
target_include_directories(tdactor PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
|
|
|
target_link_libraries(tdactor PUBLIC tdutils)
|
|
|
|
|
2019-11-17 22:03:03 +01:00
|
|
|
if (NOT CMAKE_CROSSCOMPILING)
|
|
|
|
add_executable(example example/example.cpp)
|
|
|
|
target_link_libraries(example PRIVATE tdactor)
|
|
|
|
endif()
|
2018-12-31 20:04:05 +01:00
|
|
|
|
|
|
|
install(TARGETS tdactor EXPORT TdTargets
|
2020-01-24 00:01:07 +01:00
|
|
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
|
|
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
2018-12-31 20:04:05 +01:00
|
|
|
)
|