Skip to content

Commit 437c960

Browse files
committed
Add CMake files for root, gtest and CLW
1 parent 64d81c8 commit 437c960

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed

CLW/CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
project(CLW CXX)
2+
3+
set(SOURCES
4+
CLWCommandQueue.cpp
5+
CLWContext.cpp
6+
CLWDevice.cpp
7+
CLWEvent.cpp
8+
CLWImage2D.cpp
9+
CLWKernel.cpp
10+
CLWParallelPrimitives.cpp
11+
CLWPlatform.cpp
12+
CLWProgram.cpp
13+
ParameterHolder.cpp
14+
ReferenceCounter.cpp)
15+
16+
add_library(CLW STATIC ${SOURCES})
17+
18+
if (UNIX)
19+
target_compile_options(CLW PUBLIC -std=c++11 -fPIC)
20+
elseif (APPLE)
21+
target_compile_options(CLW PUBLIC -std=c++11 -stdlib=libc++)
22+
endif (UNIX)
23+
24+
if (RR_ALLOW_CPU_DEVICES)
25+
target_compile_definitions(CLW PUBLIC RR_ALLOW_CPU_DEVICES=1)
26+
endif(RR_ALLOW_CPU_DEVICES)
27+
28+
target_link_libraries(CLW PUBLIC OpenCL::OpenCL)
29+

CMakeLists.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
cmake_minimum_required(VERSION 3.8)
2+
3+
project(RadeonRays CXX)
4+
5+
option(RR_EMBED_KERNELS "Embed CL kernels into binary module" OFF)
6+
option(RR_ALLOW_CPU_DEVICES "Allows CPU Devices" OFF)
7+
option(RR_USE_OPENCL "Use OpenCL for GPU hit testing" ON)
8+
option(RR_USE_EMBREE "Use Intel(R) Embree for CPU hit testing" OFF)
9+
option(RR_USE_VULKAN "Use vulkan for GPU hit testing" OFF)
10+
option(RR_NO_TESTS "Don't add any unit tests and remove any test functionality from the library" OFF)
11+
option(RR_ENABLE_STATIC "Create static libraries rather than dynamic" OFF)
12+
option(RR_SHARED_CALC "Link Calc(compute abstraction layer) dynamically" OFF)
13+
option(RR_ENABLE_RAYMASK "Enable ray masking in intersection kernels" OFF)
14+
option(RR_TUTORIALS "Add tutorials projects" OFF)
15+
option(RR_SAFE_MATH "use safe math" OFF)
16+
17+
if (RR_SHARED_CALC AND RR_USE_VULKAN)
18+
message(FATAL_ERROR "shared_calc option is not yet supported for Vulkan backend")
19+
endif (RR_SHARED_CALC AND RR_USE_VULKAN)
20+
21+
#Find required packages
22+
find_package(Threads)
23+
24+
if (RR_EMBED_KERNELS)
25+
find_package(PythonInterp 2.7 REQUIRED)
26+
endif(RR_EMBED_KERNELS)
27+
28+
if (RR_USE_OPENCL)
29+
find_package(OpenCL REQUIRED)
30+
endif (RR_USE_OPENCL)
31+
32+
if (RR_USE_VULKAN)
33+
find_package(Vulkan REQUIRED)
34+
add_subdirectory(Anvil)
35+
endif (RR_USE_VULKAN)
36+
37+
if (RR_USE_OPENCL)
38+
add_subdirectory(CLW)
39+
endif (RR_USE_OPENCL)
40+
41+
#add_subdirectory(RadeonRays)
42+
#add_subdirectory(Calc)
43+
44+
if (NOT RR_NO_TESTS)
45+
add_subdirectory(Gtest)
46+
# add_subdirectory(UnitTest)
47+
endif (NOT RR_NO_TESTS)
48+
49+
if (RR_TUTORIALS)
50+
# add_subdirectory(Tutorials)
51+
endif (RR_TUTORIALS)
52+

Gtest/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
project(GTest)
2+
3+
set(SOURCES
4+
src/gtest-all.cc
5+
src/gtest_main.cc)
6+
7+
add_library(GTest STATIC ${SOURCES})
8+
9+
target_include_directories(GTest PUBLIC include)
10+
target_include_directories(GTest PRIVATE .)
11+
target_link_libraries(GTest PUBLIC Threads::Threads)

0 commit comments

Comments
 (0)