Fix building with shared OIDN libraries

Previously cmake would error out if it couldn't find the static
libraries even though it can build with shared libraries just fine.
This commit is contained in:
Sebastian Parborg
2019-08-19 15:19:41 +02:00
parent 04f9c795aa
commit 45a09de9dd

View File

@@ -46,6 +46,10 @@ FIND_PATH(OPENIMAGEDENOISE_INCLUDE_DIR
SET(_openimagedenoise_FIND_COMPONENTS
OpenImageDenoise
)
# These are needed when building statically
SET(_openimagedenoise_FIND_STATIC_COMPONENTS
common
mkldnn
)
@@ -65,6 +69,23 @@ FOREACH(COMPONENT ${_openimagedenoise_FIND_COMPONENTS})
LIST(APPEND _openimagedenoise_LIBRARIES "${OPENIMAGEDENOISE_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
FOREACH(COMPONENT ${_openimagedenoise_FIND_STATIC_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(openimagedenoise_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_openimagedenoise_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
MARK_AS_ADVANCED(openimagedenoise_${UPPERCOMPONENT}_LIBRARY)
IF(openimagedenoise_${UPPERCOMPONENT}_LIBRARY)
LIST(APPEND _openimagedenoise_LIBRARIES "${OPENIMAGEDENOISE_${UPPERCOMPONENT}_LIBRARY}")
ENDIF()
ENDFOREACH()
FIND_LIBRARY(OPENIMAGEDENOISE_LIBRARY
NAMES
OpenImageDenoise