project(ParallelSTL VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} LANGUAGES CXX)
-set(PARALLELSTL_BACKEND "serial" CACHE STRING "Threading backend to use. Valid choices are 'serial' and 'tbb'. The default is 'serial'.")
+set(PSTL_PARALLEL_BACKEND "serial" CACHE STRING "Threading backend to use. Valid choices are 'serial' and 'tbb'. The default is 'serial'.")
if (NOT TBB_DIR)
get_filename_component(PSTL_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
add_library(pstl::ParallelSTL ALIAS ParallelSTL)
target_compile_features(ParallelSTL INTERFACE cxx_std_17)
-if (PARALLELSTL_BACKEND STREQUAL "serial")
+if (PSTL_PARALLEL_BACKEND STREQUAL "serial")
message(STATUS "Parallel STL uses the serial backend")
set(_PSTL_PAR_BACKEND_SERIAL ON)
-elseif (PARALLELSTL_BACKEND STREQUAL "tbb")
+elseif (PSTL_PARALLEL_BACKEND STREQUAL "tbb")
find_package(TBB 2018 REQUIRED tbb OPTIONAL_COMPONENTS tbbmalloc)
message(STATUS "Parallel STL uses TBB ${TBB_VERSION} (interface version: ${TBB_INTERFACE_VERSION})")
target_link_libraries(ParallelSTL INTERFACE TBB::tbb)
set(_PSTL_PAR_BACKEND_TBB ON)
else()
- message(FATAL_ERROR "Requested unknown Parallel STL backend '${PARALLELSTL_BACKEND}'.")
+ message(FATAL_ERROR "Requested unknown Parallel STL backend '${PSTL_PARALLEL_BACKEND}'.")
endif()
set(PSTL_GENERATED_HEADERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated_headers")
include(CMakeFindDependencyMacro)
-set(PARALLELSTL_BACKEND "@PARALLELSTL_BACKEND@")
+set(PSTL_PARALLEL_BACKEND "@PSTL_PARALLEL_BACKEND@")
-if (PARALLELSTL_BACKEND STREQUAL "tbb")
+if (PSTL_PARALLEL_BACKEND STREQUAL "tbb")
find_dependency(TBB REQUIRED tbb)
endif()