Skip to content

Commit 31bbb36

Browse files
CMakeLists health updates
Signed-off-by: Michael R Carroll <[email protected]>
1 parent 7702741 commit 31bbb36

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

RenderingToolkit/GettingStarted/02_embree_gsg/CMakeLists.txt

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,28 @@ cmake_minimum_required(VERSION 3.16)
22
project(EMBREE_GSG LANGUAGES CXX)
33

44
set(ONEAPI_ROOT "")
5-
if($ENV{ONEAPI_ROOT})
6-
set(ONEAPI_ROOT $ENV{ONEAPI_ROOT})
5+
if(DEFINED ENV{ONEAPI_ROOT})
6+
set(ONEAPI_ROOT "$ENV{ONEAPI_ROOT}")
7+
message(STATUS "ONEAPI_ROOT FROM ENVIRONMENT: ${ONEAPI_ROOT}")
78
else()
8-
if(WIN32)
9-
set(ONEAPI_ROOT "C:/Program Files (x86)/Intel/oneAPI")
10-
else()
11-
set(ONEAPI_ROOT /opt/intel/oneapi)
12-
endif()
13-
endif($ENV{ONEAPI_ROOT})
9+
if(WIN32)
10+
set(ONEAPI_ROOT "C:/Program Files (x86)/Intel/oneAPI")
11+
else()
12+
set(ONEAPI_ROOT /opt/intel/oneapi)
13+
endif()
14+
message(STATUS "ONEAPI_ROOT DEFAULT: ${ONEAPI_ROOT}")
15+
endif(DEFINED ENV{ONEAPI_ROOT})
1416

15-
16-
message(STATUS "ONEAPI_ROOT: ${ONEAPI_ROOT}")
1717
find_package(embree 3.0 REQUIRED PATHS ${ONEAPI_ROOT})
1818

19+
if(MSVC)
20+
set(CMAKE_CXX_STANDARD 11)
21+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
22+
set(CMAKE_CXX_EXTENSIONS OFF)
23+
else()
24+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
25+
endif(MSVC)
26+
1927
include_directories(${EMBREE_INCLUDE_DIR} ${RKCOMMON_INCLUDE_DIRS})
2028
link_directories(${EMBREE_ROOT}/lib ${ONEAPI_ROOT}/rkcommon/latest/lib)
2129

0 commit comments

Comments
 (0)