Skip to content

Commit

Permalink
Updated example in CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
tay10r committed Mar 28, 2020
1 parent 4323e31 commit 226641c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ add_library(FastBVH INTERFACE)

target_include_directories(FastBVH INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")

add_executable(FastBVH_RayTracerTest RayTracerTest.cpp)
function(add_example name)

target_link_libraries(FastBVH_RayTracerTest PRIVATE FastBVH)
set(target FastBVH_Example_${name})

target_compile_options(FastBVH_RayTracerTest PRIVATE ${cxxflags})
add_executable(${target} ${ARGN})

set_target_properties(FastBVH_RayTracerTest PROPERTIES OUTPUT_NAME RayTracerTest)
target_link_libraries(${target} PRIVATE FastBVH)

target_compile_options(${target} PRIVATE ${cxxflags})

set_target_properties(${target} PROPERTIES OUTPUT_NAME ${name})

endfunction(add_example name)

add_example(Basic examples/Basic.cpp)

0 comments on commit 226641c

Please sign in to comment.