Commit fef6a373 authored by neverlord's avatar neverlord

added benchmarks to cmake

parent da448eb0
...@@ -149,6 +149,7 @@ set (EXECUTABLE_OUTPUT_PATH ${CPPA_BINARY_OUTPUT_PATH} ...@@ -149,6 +149,7 @@ set (EXECUTABLE_OUTPUT_PATH ${CPPA_BINARY_OUTPUT_PATH}
add_subdirectory(unit_testing) add_subdirectory(unit_testing)
add_subdirectory(examples) add_subdirectory(examples)
add_subdirectory(benchmarks)
#add_subdirectory(benchmarks) #add_subdirectory(benchmarks)
#add_dependencies(unit_tests libcppa) #add_dependencies(unit_tests libcppa)
#add_dependencies(benchmarks libcppa) #add_dependencies(benchmarks libcppa)
...@@ -162,4 +163,8 @@ add_dependencies(dining_philosophers libcppa) ...@@ -162,4 +163,8 @@ add_dependencies(dining_philosophers libcppa)
add_dependencies(hello_world_example libcppa) add_dependencies(hello_world_example libcppa)
add_dependencies(math_actor_example libcppa) add_dependencies(math_actor_example libcppa)
add_dependencies(unit_tests libcppa) add_dependencies(unit_tests libcppa)
add_dependencies(actor_creation libcppa)
add_dependencies(mailbox_performance libcppa)
add_dependencies(mixed_case libcppa)
add_dependencies(distributed libcppa)
add_dependencies(matching libcppa)
cmake_minimum_required(VERSION 2.6)
project(cppa_benchmarks)
# Set up environment paths to cmake modules and libcppa
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(actor_creation actor_creation.cpp)
add_executable(mailbox_performance mailbox_performance.cpp)
add_executable(mixed_case mixed_case.cpp)
add_executable(distributed distributed.cpp)
add_executable(matching matching.cpp)
# search for libs
if(NOT cppa_LIBRARY)
find_package(Libcppa REQUIRED)
endif (NOT cppa_LIBRARY)
find_package(Boost COMPONENTS thread REQUIRED)
link_directories(${Boost_LIBRARY_DIRS})
include_directories(. ${cppa_INCLUDE} ${Boost_INCLUDE_DIRS})
set(benchmark_LIBS ${CMAKE_DL_LIBS} ${CPPA_LIBRARY} ${Boost_THREAD_LIBRARY})
target_link_libraries(actor_creation ${benchmark_LIBS})
target_link_libraries(mailbox_performance ${benchmark_LIBS})
target_link_libraries(mixed_case ${benchmark_LIBS})
target_link_libraries(distributed ${benchmark_LIBS})
target_link_libraries(matching ${benchmark_LIBS})
# - Try to find libcppa
# Once done this will define
#
# CPPA_FOUND - system has libcppa
# CPPA_INCLUDE - libcppa include dir
# CPPA_LIBRARY - link againgst libcppa
#
if (CPPA_LIBRARY AND CPPA_INCLUDE)
set(CPPA_FOUND TRUE)
else (CPPA_LIBRARY AND CPPA_INCLUDE)
find_path(CPPA_INCLUDE
NAMES
cppa/cppa.hpp
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
${CPPA_INCLUDE_PATH}
${CPPA_LIBRARY_PATH}
${CMAKE_INCLUDE_PATH}
${CMAKE_INSTALL_PREFIX}/include
)
if (CPPA_INCLUDE)
message (STATUS "Header files found ...")
else (CPPA_INCLUDE)
message (SEND_ERROR "Header files NOT found. Provide absolute path with -DCPPA_INCLUDE_PATH=<path-to-header>.")
endif (CPPA_INCLUDE)
find_library(CPPA_LIBRARY
NAMES
libcppa
cppa
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
${CPPA_INCLUDE_PATH}
${CPPA_INCLUDE_PATH}/.libs
${CPPA_LIBRARY_PATH}
${CPPA_LIBRARY_PATH}/.libs
${CMAKE_LIBRARY_PATH}
${CMAKE_INSTALL_PREFIX}/lib
)
if (CPPA_LIBRARY)
message (STATUS "Library found ...")
else (CPPA_LIBRARY)
message (SEND_ERROR "Library NOT found. Provide absolute path with -DCPPA_LIBRARY_PATH=<path-to-library>.")
endif (CPPA_LIBRARY)
if (CPPA_INCLUDE AND CPPA_LIBRARY)
set(CPPA_FOUND TRUE)
set(CPPA_INCLUDE ${CPPA_INCLUDE})
set(CPPA_LIBRARY ${CPPA_LIBRARY})
else (CPPA_INCLUDE AND CPPA_LIBRARY)
message (FATAL_ERROR "CPPA LIBRARY AND/OR HEADER NOT FOUND!")
endif (CPPA_INCLUDE AND CPPA_LIBRARY)
endif (CPPA_LIBRARY AND CPPA_INCLUDE)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment