# List all required files here (cmake best practice to NOT automate this step!) add_library(pls STATIC include/pls/pls.h src/pls.cpp include/pls/algorithms/invoke.h include/pls/algorithms/invoke_impl.h include/pls/algorithms/for_each.h include/pls/algorithms/for_each_impl.h include/pls/algorithms/scan.h include/pls/algorithms/scan_impl.h include/pls/dataflow/dataflow.h include/pls/dataflow/internal/inputs.h include/pls/dataflow/internal/outputs.h include/pls/dataflow/internal/token.h include/pls/dataflow/internal/in_port.h include/pls/dataflow/internal/out_port.h include/pls/dataflow/internal/function_node.h include/pls/dataflow/internal/node.h include/pls/dataflow/internal/graph.h include/pls/internal/base/spin_lock.h include/pls/internal/base/tas_spin_lock.h src/internal/base/tas_spin_lock.cpp include/pls/internal/base/ttas_spin_lock.h src/internal/base/ttas_spin_lock.cpp include/pls/internal/base/swmr_spin_lock.h src/internal/base/swmr_spin_lock.cpp include/pls/internal/base/thread.h src/internal/base/thread.cpp include/pls/internal/base/thread_impl.h include/pls/internal/base/barrier.h src/internal/base/barrier.cpp include/pls/internal/base/system_details.h include/pls/internal/base/error_handling.h include/pls/internal/base/alignment.h src/internal/base/alignment.cpp include/pls/internal/data_structures/aligned_stack.h src/internal/data_structures/aligned_stack.cpp include/pls/internal/data_structures/aligned_stack_impl.h include/pls/internal/data_structures/deque.h include/pls/internal/data_structures/locking_deque.h include/pls/internal/data_structures/locking_deque_impl.h include/pls/internal/data_structures/work_stealing_deque.h include/pls/internal/data_structures/work_stealing_deque_impl.h include/pls/internal/data_structures/stamped_integer.h include/pls/internal/helpers/prohibit_new.h include/pls/internal/helpers/profiler.h include/pls/internal/helpers/mini_benchmark.h include/pls/internal/helpers/unique_id.h include/pls/internal/helpers/range.h include/pls/internal/scheduling/thread_state.h include/pls/internal/scheduling/scheduler.h src/internal/scheduling/scheduler.cpp include/pls/internal/scheduling/scheduler_impl.h include/pls/internal/scheduling/task.h src/internal/scheduling/task.cpp include/pls/internal/scheduling/scheduler_memory.h src/internal/scheduling/scheduler_memory.cpp include/pls/internal/scheduling/lambda_task.h include/pls/internal/helpers/seqence.h) # Add everything in `./include` to be in the include path of this project target_include_directories(pls PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src # TODO: Set this up when we require private headers ) # Add cmake dependencies here if needed target_link_libraries(pls Threads::Threads # pthread support ) if (EASY_PROFILER) target_link_libraries(pls easy_profiler) endif () # Rules for istalling the library on a system # ...binaries INSTALL(TARGETS pls EXPORT pls-targets LIBRARY DESTINATION lib/pls ARCHIVE DESTINATION lib/pls ) # ...all headers in `include` INSTALL( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/pls DESTINATION include FILES_MATCHING PATTERN "*.h*" ) # ...allow our project to be a cmake dependency install( EXPORT pls-targets FILE plsTargets.cmake NAMESPACE pls:: DESTINATION lib/pls ) INSTALl( FILES pls-config.cmake DESTINATION lib/pls ) # ...add a custom target that will only build the library when istalling. # 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 pls) # Enable warnings/tidy code checking from our compiler target_compile_options(pls PRIVATE $<$,$,$>: -Wall> $<$: -W4>)