light/CMakeLists.txt: make it non-fatal if the embree license isn't found

This commit is contained in:
Eric Wasylishen 2021-12-11 13:25:09 -07:00
parent a1609ae1e6
commit 6e96ae7cc2
1 changed files with 8 additions and 2 deletions

View File

@ -79,8 +79,12 @@ if (embree_FOUND)
add_custom_command(TARGET light POST_BUILD add_custom_command(TARGET light POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:embree>" "$<TARGET_FILE_DIR:light>" COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:embree>" "$<TARGET_FILE_DIR:light>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:TBB::tbb>" "$<TARGET_FILE_DIR:light>" COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:TBB::tbb>" "$<TARGET_FILE_DIR:light>")
if (NOT EMBREE_LICENSE STREQUAL EMBREE_LICENSE-NOTFOUND)
add_custom_command(TARGET light POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${EMBREE_LICENSE}" "$<TARGET_FILE_DIR:light>/LICENSE-embree.txt") COMMAND ${CMAKE_COMMAND} -E copy_if_different "${EMBREE_LICENSE}" "$<TARGET_FILE_DIR:light>/LICENSE-embree.txt")
endif()
# so the executable will search for dylib's in the same directory as the executable # so the executable will search for dylib's in the same directory as the executable
if(APPLE) if(APPLE)
@ -104,7 +108,9 @@ if (embree_FOUND)
install(FILES $<TARGET_FILE:TBB::tbb> DESTINATION bin) install(FILES $<TARGET_FILE:TBB::tbb> DESTINATION bin)
endif() endif()
install(FILES ${EMBREE_LICENSE} DESTINATION bin RENAME LICENSE-embree.txt) if (NOT EMBREE_LICENSE STREQUAL EMBREE_LICENSE-NOTFOUND)
install(FILES ${EMBREE_LICENSE} DESTINATION bin RENAME LICENSE-embree.txt)
endif()
endif(embree_FOUND) endif(embree_FOUND)
install(TARGETS light RUNTIME DESTINATION bin) install(TARGETS light RUNTIME DESTINATION bin)