forked from Apress/data-parallel-CPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (34 loc) · 1.33 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: MIT
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
# Try to detect the right SYCL compiler if one is not explicitly specified:
if (NOT CMAKE_CXX_COMPILER)
if (WIN32)
set(CMAKE_CXX_COMPILER icx)
else()
find_program(HAS_ICPX "icpx" NO_CACHE)
if (HAS_ICPX)
set(CMAKE_CXX_COMPILER icpx)
else()
set(CMAKE_CXX_COMPILER clang++)
endif()
endif()
endif()
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release" CACHE PATH "Build Type" FORCE)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
project(DPCPPSamples)
option(NODPL "Disable samples that require the oneAPI DPC++ Library (oneDPL).")
option(NODPCT "Disable samples that require the DPC++ Compatibility Tool (dpct).")
option(NOL0 "Disable samples that require the oneAPI Level Zero Headers and Loader." ON)
option(WITHCUDA "Enable CUDA device support for the samples.")
enable_testing()
add_subdirectory(samples)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/install" CACHE PATH "Install Path" FORCE)
endif()