--- kernels/CMakeLists.txt.orig 2020-05-14 01:08:53.000000000 -0400 +++ kernels/CMakeLists.txt 2020-12-08 15:40:57.000000000 -0500 @@ -221,7 +221,10 @@ ENDMACRO() DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES}) -ADD_LIBRARY(embree ${EMBREE_LIB_TYPE} ${EMBREE_LIBRARY_FILES} $) +IF (EMBREE_STATIC_LIB) + SET(BUILD_SHARED_LIBS ON) +ENDIF() +ADD_LIBRARY(embree ${EMBREE_LIBRARY_FILES} $) SET_TARGET_PROPERTIES(embree PROPERTIES COMPILE_FLAGS "${FLAGS_LOWEST}") SET_TARGET_PROPERTIES(embree PROPERTIES COMPILE_DEFINITIONS "EMBREE_LOWEST_ISA") SET_PROPERTY(TARGET embree PROPERTY FOLDER kernels) @@ -347,7 +350,7 @@ INSTALL(EXPORT embree-targets DESTINATION ${EMBREE_CMAKEEXPORT_DIR} COMPONENT devel) # installs libembree3.so link -IF (NOT EMBREE_STATIC_LIB) +IF (EMBREE_STATIC_LIB) INSTALL(TARGETS embree LIBRARY NAMELINK_ONLY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel )