|
| 1 | +cmake_minimum_required(VERSION 2.4) |
| 2 | +project(cppa) |
| 3 | + |
| 4 | +set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) |
| 5 | + |
| 6 | +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wextra -Wall -Werror -pedantic") |
| 7 | + |
| 8 | +set(LIBCPPA_SRC |
| 9 | + src/abstract_event_based_actor.cpp |
| 10 | + src/abstract_tuple.cpp |
| 11 | + src/actor.cpp |
| 12 | + src/actor_count.cpp |
| 13 | + src/actor_proxy.cpp |
| 14 | + src/actor_proxy_cache.cpp |
| 15 | + src/actor_registry.cpp |
| 16 | + src/addressed_message.cpp |
| 17 | + src/any_tuple.cpp |
| 18 | + src/atom.cpp |
| 19 | + src/attachable.cpp |
| 20 | + src/binary_deserializer.cpp |
| 21 | + src/binary_serializer.cpp |
| 22 | + src/channel.cpp |
| 23 | + src/converted_thread_context.cpp |
| 24 | + src/cppa.cpp |
| 25 | + src/demangle.cpp |
| 26 | + src/deserializer.cpp |
| 27 | + src/duration.cpp |
| 28 | + src/empty_tuple.cpp |
| 29 | + src/event_based_actor.cpp |
| 30 | + src/exception.cpp |
| 31 | + src/fiber.cpp |
| 32 | + src/group.cpp |
| 33 | + src/group_manager.cpp |
| 34 | + src/invokable.cpp |
| 35 | + src/local_actor.cpp |
| 36 | + src/mailman.cpp |
| 37 | + src/mock_scheduler.cpp |
| 38 | + src/native_socket.cpp |
| 39 | + src/network_manager.cpp |
| 40 | + src/object.cpp |
| 41 | + src/object_array.cpp |
| 42 | + src/partial_function.cpp |
| 43 | + src/pattern.cpp |
| 44 | + src/post_office.cpp |
| 45 | + src/primitive_variant.cpp |
| 46 | + src/process_information.cpp |
| 47 | + src/receive.cpp |
| 48 | + src/ripemd_160.cpp |
| 49 | + src/scheduled_actor.cpp |
| 50 | + src/scheduled_actor_dummy.cpp |
| 51 | + src/scheduler.cpp |
| 52 | + src/self.cpp |
| 53 | + src/serializer.cpp |
| 54 | + src/shared_spinlock.cpp |
| 55 | + src/singleton_manager.cpp |
| 56 | + src/stacked_event_based_actor.cpp |
| 57 | + src/string_serialization.cpp |
| 58 | + src/thread_pool_scheduler.cpp |
| 59 | + src/to_uniform_name.cpp |
| 60 | + src/unicast_network.cpp |
| 61 | + src/uniform_type_info.cpp |
| 62 | + src/yield_interface.cpp |
| 63 | + src/yielding_actor.cpp |
| 64 | +) |
| 65 | + |
| 66 | +find_package(Boost COMPONENTS thread REQUIRED) |
| 67 | + |
| 68 | +link_directories(${Boost_LIBRARY_DIRS}) |
| 69 | +include_directories(. ${Boost_INCLUDE_DIRS}) |
| 70 | + |
| 71 | +add_library(libcppa SHARED ${LIBCPPA_SRC}) |
| 72 | + |
| 73 | +target_link_libraries(libcppa ${CMAKE_LD_LIBS} ${Boost_THREAD_LIBRARY}) |
| 74 | + |
| 75 | +set(LIBCPPA_VERSION_MAJOR 0) |
| 76 | +set(LIBCPPA_VERSION_MINOR 2) |
| 77 | +set(LIBCPPA_VERSION_PATCH 0) |
| 78 | +set(LIBRARY_VERSION ${LIBCPPA_VERSION_MAJOR}.${LIBCPPA_VERSION_MINOR}.${LIBCPPA_VERSION_PATCH}) |
| 79 | +set(LIBRARY_SOVERSION ${LIBCPPA_VERSION_MAJOR}) |
| 80 | + |
| 81 | +set_target_properties(libcppa PROPERTIES SOVERSION ${LIBRARY_SOVERSION} VERSION ${LIBRARY_VERSION} OUTPUT_NAME cppa) |
| 82 | +install(TARGETS libcppa LIBRARY DESTINATION lib) |
| 83 | + |
| 84 | +# install includes |
| 85 | +install(DIRECTORY cppa/ DESTINATION include/cppa |
| 86 | + FILES_MATCHING PATTERN "*.hpp") |
| 87 | +# uninstall target |
| 88 | +configure_file( |
| 89 | + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" |
| 90 | + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" |
| 91 | + IMMEDIATE @ONLY) |
| 92 | + |
| 93 | +add_custom_target(uninstall |
| 94 | + COMMAND ${CMAKE_COMMAND} -P |
| 95 | + ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) |
| 96 | + |
| 97 | +set (CPPA_BINARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin) |
| 98 | +set (CPPA_LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib) |
| 99 | +# setting path to cppa headers and libcppa |
| 100 | +set (CPPA_INCLUDE_PATH ${CMAKE_SOURCE_DIR}/libcppa) |
| 101 | +set (CPPA_LIBRARY_PATH ${CPPA_LIBRARY_OUTPUT_PATH}) |
| 102 | +set (CPPA_INCLUDE ${CPPA_INCLUDE_PATH}) |
| 103 | +if (APPLE) |
| 104 | + set (CPPA_LIBRARY ${CPPA_LIBRARY_PATH}/libcppa.dylib) |
| 105 | +elseif (UNIX) |
| 106 | + set (CPPA_LIBRARY ${CPPA_LIBRARY_PATH}/libcppa.so) |
| 107 | +else () |
| 108 | + message (SEND_FATAL "Host platform not supported ...") |
| 109 | +endif () |
| 110 | + |
| 111 | +set (LIBRARY_OUTPUT_PATH ${CPPA_LIBRARY_OUTPUT_PATH} |
| 112 | + CACHE PATH "Single directory for all libraries") |
| 113 | +set (EXECUTABLE_OUTPUT_PATH ${CPPA_BINARY_OUTPUT_PATH} |
| 114 | + CACHE PATH "Single directory for all executables") |
| 115 | + |
| 116 | +add_subdirectory(unit_testing) |
| 117 | +add_subdirectory(examples) |
| 118 | +#add_subdirectory(benchmarks) |
| 119 | +#add_dependencies(unit_tests libcppa) |
| 120 | +#add_dependencies(benchmarks libcppa) |
| 121 | +add_dependencies(announce_example_1 libcppa) |
| 122 | +add_dependencies(announce_example_2 libcppa) |
| 123 | +add_dependencies(announce_example_3 libcppa) |
| 124 | +add_dependencies(announce_example_4 libcppa) |
| 125 | +add_dependencies(announce_example_5 libcppa) |
| 126 | +add_dependencies(dancing_kirby libcppa) |
| 127 | +add_dependencies(dining_philosophers libcppa) |
| 128 | +add_dependencies(hello_world_example libcppa) |
| 129 | +add_dependencies(math_actor_example libcppa) |
| 130 | +add_dependencies(unit_tests libcppa) |
| 131 | + |
0 commit comments