CMakeLists.txt 2.38 KB
Newer Older
1
cmake_minimum_required(VERSION 3.10)
2 3
project(predictable_parallel_patterns
        VERSION 0.0.1
4 5
        DESCRIPTION "predictable parallel patterns for scalable smart systems using work stealing"
        LANGUAGES CXX ASM)
6

7
set(CMAKE_CXX_STANDARD 17)
8 9 10

# seperate library and test/example executable output paths.
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
11
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
12 13 14 15

# specific setup code is located in individual files.
include(cmake/DisabelInSource.cmake)
include(cmake/SetupOptimizationLevel.cmake)
16
include(cmake/SetupAssemblyOutput.cmake)
17
include(cmake/SetupThreadingSupport.cmake)
18
include(cmake/SetupThreadSanitizer.cmake)
19
include(cmake/SetupAddressSanitizer.cmake)
20
include(cmake/SetupEasyProfiler.cmake)
21
include(cmake/SetupDebugSymbols.cmake)
22 23 24 25 26 27 28 29

# make our internal cmake script collection avaliable in the build process.
list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/cmake")

# Include external libraries within the project structure (prefered, as no instalation is reqired).
# Each library has an own CMakeLists.txt that should make it avaliabale as a library target,
# thus allowing one to include it as any cmake dependency later on.
add_subdirectory(extern/catch2)
30 31 32
add_subdirectory(extern/picosha2)
add_subdirectory(extern/benchmark_base)
add_subdirectory(extern/benchmark_runner)
33 34

# Include all internal subprojects (library, examples, testing).
35
add_subdirectory(lib/context_switcher)
36 37
add_subdirectory(lib/pls)

38 39 40 41 42 43 44 45
# ...add a custom target that will only build the library when installing.
# This can allow us to speed up the installation on embedded devices.
ADD_CUSTOM_TARGET(install.pls
        ${CMAKE_COMMAND}
        -DBUILD_TYPE=${CMAKE_BUILD_TYPE}
        -P ${CMAKE_BINARY_DIR}/cmake_install.cmake)
ADD_DEPENDENCIES(install.pls context_switcher pls)

46 47 48
# ... second custom target to only build the benchmarks.
ADD_CUSTOM_TARGET(benchmark.pls)

49 50
# Include examples
add_subdirectory(app/playground)
51
add_subdirectory(app/benchmark_fft)
52
add_subdirectory(app/benchmark_unbalanced)
53
add_subdirectory(app/benchmark_matrix)
54
add_subdirectory(app/benchmark_matrix_div_conquer)
FritzFlorian committed
55
add_subdirectory(app/benchmark_fib)
56
add_subdirectory(app/context_switch)
57
add_subdirectory(app/benchmark_matrix_then_fft)
58 59 60

# Add optional tests
option(PACKAGE_TESTS "Build the tests" ON)
61
if (PACKAGE_TESTS)
62 63 64
    enable_testing()
    add_subdirectory(test)
    add_test(NAME AllTests COMMAND tests)
65
endif ()