Skip to content

Commit

Permalink
Add CMake files for root, gtest and CLW
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisBirukov committed Mar 16, 2018
1 parent 64d81c8 commit 437c960
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
29 changes: 29 additions & 0 deletions CLW/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
project(CLW CXX)

set(SOURCES
CLWCommandQueue.cpp
CLWContext.cpp
CLWDevice.cpp
CLWEvent.cpp
CLWImage2D.cpp
CLWKernel.cpp
CLWParallelPrimitives.cpp
CLWPlatform.cpp
CLWProgram.cpp
ParameterHolder.cpp
ReferenceCounter.cpp)

add_library(CLW STATIC ${SOURCES})

if (UNIX)
target_compile_options(CLW PUBLIC -std=c++11 -fPIC)
elseif (APPLE)
target_compile_options(CLW PUBLIC -std=c++11 -stdlib=libc++)
endif (UNIX)

if (RR_ALLOW_CPU_DEVICES)
target_compile_definitions(CLW PUBLIC RR_ALLOW_CPU_DEVICES=1)
endif(RR_ALLOW_CPU_DEVICES)

target_link_libraries(CLW PUBLIC OpenCL::OpenCL)

52 changes: 52 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.8)

project(RadeonRays CXX)

option(RR_EMBED_KERNELS "Embed CL kernels into binary module" OFF)
option(RR_ALLOW_CPU_DEVICES "Allows CPU Devices" OFF)
option(RR_USE_OPENCL "Use OpenCL for GPU hit testing" ON)
option(RR_USE_EMBREE "Use Intel(R) Embree for CPU hit testing" OFF)
option(RR_USE_VULKAN "Use vulkan for GPU hit testing" OFF)
option(RR_NO_TESTS "Don't add any unit tests and remove any test functionality from the library" OFF)
option(RR_ENABLE_STATIC "Create static libraries rather than dynamic" OFF)
option(RR_SHARED_CALC "Link Calc(compute abstraction layer) dynamically" OFF)
option(RR_ENABLE_RAYMASK "Enable ray masking in intersection kernels" OFF)
option(RR_TUTORIALS "Add tutorials projects" OFF)
option(RR_SAFE_MATH "use safe math" OFF)

if (RR_SHARED_CALC AND RR_USE_VULKAN)
message(FATAL_ERROR "shared_calc option is not yet supported for Vulkan backend")
endif (RR_SHARED_CALC AND RR_USE_VULKAN)

#Find required packages
find_package(Threads)

if (RR_EMBED_KERNELS)
find_package(PythonInterp 2.7 REQUIRED)
endif(RR_EMBED_KERNELS)

if (RR_USE_OPENCL)
find_package(OpenCL REQUIRED)
endif (RR_USE_OPENCL)

if (RR_USE_VULKAN)
find_package(Vulkan REQUIRED)
add_subdirectory(Anvil)
endif (RR_USE_VULKAN)

if (RR_USE_OPENCL)
add_subdirectory(CLW)
endif (RR_USE_OPENCL)

#add_subdirectory(RadeonRays)
#add_subdirectory(Calc)

if (NOT RR_NO_TESTS)
add_subdirectory(Gtest)
# add_subdirectory(UnitTest)
endif (NOT RR_NO_TESTS)

if (RR_TUTORIALS)
# add_subdirectory(Tutorials)
endif (RR_TUTORIALS)

11 changes: 11 additions & 0 deletions Gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
project(GTest)

set(SOURCES
src/gtest-all.cc
src/gtest_main.cc)

add_library(GTest STATIC ${SOURCES})

target_include_directories(GTest PUBLIC include)
target_include_directories(GTest PRIVATE .)
target_link_libraries(GTest PUBLIC Threads::Threads)

0 comments on commit 437c960

Please sign in to comment.