forked from oneapi-src/oneAPI-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (30 loc) · 1.08 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
cmake_minimum_required(VERSION 3.16)
project(OPENVKL_GSG LANGUAGES C CXX)
set(ONEAPI_ROOT "")
if(DEFINED ENV{ONEAPI_ROOT})
set(ONEAPI_ROOT "$ENV{ONEAPI_ROOT}")
message(STATUS "ONEAPI_ROOT FROM ENVIRONMENT: ${ONEAPI_ROOT}")
else()
if(WIN32)
set(ONEAPI_ROOT "C:/Program Files (x86)/Intel/oneAPI")
else()
set(ONEAPI_ROOT /opt/intel/oneapi)
endif()
message(STATUS "ONEAPI_ROOT DEFAULT: ${ONEAPI_ROOT}")
endif(DEFINED ENV{ONEAPI_ROOT})
set(OPENVKL_ROOT ${ONEAPI_ROOT}/openvkl/latest)
set(OPENVKL_INCLUDE_DIR ${OPENVKL_ROOT}/include)
message(STATUS "OPENVKL_INCLUDE_DIR: ${OPENVKL_INCLUDE_DIR}")
find_package(openvkl REQUIRED PATHS ${ONEAPI_ROOT})
if(MSVC)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif(MSVC)
include_directories(${OPENVKL_INCLUDE_DIR})
link_directories(${OPENVKL_ROOT}/lib)
add_executable(vklTutorial src/vklTutorial.c)
target_link_libraries(vklTutorial PRIVATE openvkl)
install(TARGETS vklTutorial RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})